Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: loading (partial) environments

New Message Reply Date view Thread view Subject view Author view

Subject: Re: loading (partial) environments
From: Christophe Le Page (lepage@cirad.fr)
Date: Fri Dec 27 2002 - 18:21:32 CET

Hello Stan,

To do what you need, here are two new methods of the SpaceModel class.
Just "File-in" the attached file in your image and save it.

The first method, called #exportAttribute:fromClass:, build a text file
named ClassNameAttributeName.txt in the "maps" subdirectory of your model.
The second one, called #importAttribute:fromClass:, read this text file
and reset the values of the corresponding attribute (and only this one !)
from the content of the file.

In the #init method of your model, you can add this instruction:
        self spaceModel exportAttribute: #state fromClass: #Cell
And then in the #step: method of your model, you can use this one:
        self spaceModel importAttribute: #state fromClass: #Cell

This will be included in the new kernel of Cormas2003, which is almost
ready (you can download the version from December 26 on the Cormas
web site).

Happy new year to everybody !
clp

Stanislas Boissau a écrit :
>
> Hi,
> I would like to load a partial environment during the run of a simulation.
> This means that if my cells have 2 attributes (i.e. state and level), I
> want to load an environment changing only the "state" attribute and leaving
> the "level" attribute unchanged. Until now, I saved an environment with the
> "state" attribute and load it through the step method but the problem is
> that it changes the "level" attribute to nil. So this is not a solution...
> Could anyone help me?
> By the way, I wish you all a happy new year.
> Cheers
> Stan

-- 
Christophe Le Page
CIRAD - TERA
TA 60/15 - 34398 Montpellier Cedex 5 - France
Tél: +33 467 593 832  Fax: +33 467 593 827
http://cormas.cirad.fr

New Message Reply Date view Thread view Subject view Author view
 

Back to home