Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: cormas error?

New Message Reply Date view Thread view Subject view Author view

Subject: Re: cormas error?
From: Pierre Bommel (bommel@cirad.fr)
Date: Tue Aug 24 2004 - 12:07:19 CEST

Hello Paolo,

It 's nice to hear you from so far !
Well you are right and I don't understand why this line has changed !
For those who are interested, I attach the right method to ‘file-in’.
Thank you very much for this bug tracking, Paolo.
Hope to see you soon...

    Pierre

Paolo Campo a écrit :

>
>
> Hello.
>
> <?xml:namespace prefix = o ns =
> "urn:schemas-microsoft-com:office:office" />
>
> I recently installed the Cormas 2004 version.I encountered a problem
> with a model that uses the method
> ‘setFragmentedEntities:from:attribute:’.I don’t encounter this problem
> in Cormas 2003.I checked the method for both the 2003 and 2004
> versions and I noticed a difference, particularly on this line:
>
> Cormas2004 version:
>
> fragmentedEntity type: collec first type.
>
> Cormas2003 version:
>
> fragmentedEntity type: (collec first perform: attributeName).
>
> So, unlike in the 2003 version wherein the attribute‘type’ of the
> fragmented entities are assigned with values based on the
> user-specified attribute from its components, in the 2004 version the
> attribute ‘type’ of the fragmented entities are assigned with the
> values of the attribute ‘type’ of its components. In the model I
> loaded, the fragmented entities are composed of elementary spatial
> entities that don’t have the attribute ‘type’; thus an error
> occurs.Also, I want the value of the attribute ‘type’ to be that of
> the value of the attribute I specified.
>
> For the meantime, to deal with the error, I changed this method in the
> 2004 version to what it was in the 2003 version by using ‘file-out’
> and ‘file-in’.
>
> I would like to ask if this is an error or if the change made for this
> particular method in Cormas 2004 was purposely done?Also, I would like
> to ask if I did the right thing by reverting the method to its
> previous version?Wouldn’t it be better to use the previous form of
> this method rather than the new one, not only for the case of the
> model I loaded but also for other models using this method?If I am
> wrong about this, could someone please enlighten me?I included the
> entire method for both versions at the end of this email for
> reference.
>
> Thanks and best regards,
>
> Paolo
> From Cormas 2004 version
>
> setFragmentedEntities: compoundEntity from: baseEntity
> attribute: attributeName
>
> "baseEntity = a Class name inheriting from <SpatialEntity>
>
> (can be <SpatialEntityCell> or <SpatialEntityAggregate> or
> <SpatialEntityNotConnex>)
>
> compoundEntity = a Class name inheriting from
> <SpatialEntityNotConnex>"
>
> | fragmentedEntity beInstances collec|
>
> self boundaries = #closed ifFalse: [^self warningBoundaries].
>
> self resetCompoundSpatialEntity: compoundEntity
> andTheirComponents: baseEntity.
>
> beInstances := (self cormasModel perform: ('the' , baseEntity name
> asString , 's') asSymbol) copy asOrderedCollection.
>
> [beInstances isEmpty]
>
> whileFalse:
>
> [collec := beInstances select: [:c | (beInstances first
> perform: attributeName)
>
> = (c perform: attributeName)].
>
> beInstances removeAll: collec.
>
> fragmentedEntity := compoundEntity new: self.
>
> fragmentedEntity addComponents: collec.
>
> fragmentedEntity type: collec first type.
>
> (self spatialEntities at: compoundEntity name)
>
> add: fragmentedEntity].
>
> (self spatialEntities at: compoundEntity name)
>
> do: [:c | c show].
>
> self cormasModel perform: ('the' , compoundEntity name asString ,
> 's:') asSymbol with: (self spatialEntities at: compoundEntity name)
> from Cormas 2003 version
>
> setFragmentedEntities: compoundEntity from: baseEntity
> attribute: attributeName
>
> "baseEntity = a Class name inheriting from <SpatialEntity>
>
> (can be <SpatialEntityCell> or <SpatialEntityAggregate> or
> <SpatialEntityNotConnex>)
>
> compoundEntity = a Class name inheriting from
> <SpatialEntityNotConnex>"
>
> | fragmentedEntitybeInstancescollec |
>
> self boundaries = #closed ifFalse: [^self warningBoundaries].
>
> self resetCompoundSpatialEntity: compoundEntity
> andTheirComponents: baseEntity.
>
> beInstances := (self cormasModel perform: ('the' , baseEntity name
> asString , 's') asSymbol) copy asOrderedCollection.
>
> [beInstances isEmpty]
>
> whileFalse:
>
> [collec := beInstances select: [:c | (beInstances first
> perform: attributeName)
>
> = (c perform: attributeName)].
>
> beInstances removeAll: collec.
>
> fragmentedEntity := compoundEntity new: self.
>
> fragmentedEntity addComponents: collec.
>
> fragmentedEntity type: (collec first perform: attributeName).
>
> (self spatialEntities at: compoundEntity name)
>
> add: fragmentedEntity].
>
> (self spatialEntities at: compoundEntity name)
>
> do: [:c | c show].
>
> self cormasModel perform: ('the' , compoundEntity name asString ,
> 's:') asSymbol with: (self spatialEntities at: compoundEntity name)
> -----------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Mail is new and improved - Check it out!

--
***********************************
  Pierre Bommel
  CIRAD TA 60/15
  73, rue Jean-François Breton
  34398 Montpellier cedex 5 France
  Phone: +33 (0)4 67 59 38 53
  Fax: +33 (0)4 67 59 38 27
  http://cormas.cirad.fr
***********************************

<?xml version="1.0"?>

<st-source> <time-stamp>From VisualWorks® NonCommercial, 7.2 of lundi 3 novembre 2003 on mardi 24 août 2004 at 1:00:23</time-stamp>

<methods> <class-id>CormasNS.Kernel.SpaceModel</class-id> <category>CSE (regular) - instance creation</category>

<body>setFragmentedEntities: compoundEntity from: baseEntity attribute: attributeName "baseEntity = a Class name inheriting from &lt;SpatialEntity&gt; (can be &lt;SpatialEntityCell&gt; or &lt;SpatialEntityAggregate&gt; or &lt;SpatialEntityNotConnex&gt;) compoundEntity = a Class name inheriting from &lt;SpatialEntityNotConnex&gt;"

| fragmentedEntity beInstances collec | self boundaries = #closed ifFalse: [^self warningBoundaries]. self resetCompoundSpatialEntity: compoundEntity andTheirComponents: baseEntity. beInstances := (self cormasModel perform: ('the' , baseEntity name asString , 's') asSymbol) copy asOrderedCollection. [beInstances isEmpty] whileFalse: [collec := beInstances select: [:c | (beInstances first perform: attributeName) = (c perform: attributeName)]. beInstances removeAll: collec. fragmentedEntity := compoundEntity new: self. fragmentedEntity addComponents: collec. fragmentedEntity type: (collec first perform: attributeName). (self spatialEntities at: compoundEntity name) add: fragmentedEntity]. (self spatialEntities at: compoundEntity name) do: [:c | c show]. self cormasModel perform: ('the' , compoundEntity name asString , 's:') asSymbol with: (self spatialEntities at: compoundEntity name)</body> </methods>

</st-source>

New Message Reply Date view Thread view Subject view Author view
 

Back to home