Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Re: RAM problem during simulations

New Message Reply Date view Thread view Subject view Author view

Subject: Re: RAM problem during simulations
From: Pierre Bommel (bommel@cirad.fr)
Date: jeu aoû 30 2001 - 16:07:53 CEST

laurent lardon a écrit :

> When I am computing a simulation, I have observed
> that the memory allocated to visual works was growing
> (from 11 Mo to 50 Mo for a 15000 step simulation).
> I think that the lap between Matlab and Cormas that I
> open and close each time step can explain this. Does
> anyone know a solution for this ?
>
> - I am using a PC with 160 Mo RAM and powered by
> Windows NT 5 (Win2k)-
> Thank you

Hello Laurent,

I don't think (but I am not sure !) that your problem of RAM consumption
is due to the connection between Cormas and Matlab.
I would rather say that your model uses all the internal memory because
of charts that are extreamly memory-consumer, especially for long
simulations. Indeed, the data to display the charts are stored in RAM
and are restored only at the end of simulation for the display.
Also, for long runs, it is safe to comment the #initCharts and
#updateCharts: methods.
I hope your simulations will run better ... !
Best regards,

    Pierre

PS: If you want to visualize your data, you should rather save your data
in a file (on the disk) and use them, after the simulation, in a
appropriate graphic tool (like Excel). Below, I explain how to do this :

First of all, you have to init your file in the init method of your
controler. For example, add the method :
initSave
     aCollec := OrderedCollection new.
     aCollec add: 'time ; id ; stock'. "for example"
     self initFile: 'myAgents.txt' dataCollection: aCollec separator:
';'. "myAgents.txt is the name of the file I want to
create"

Then, in the step method of your controler, you can add :
    self saveData: t.

And add saveData: method :
saveData: time
 | aCollec |
     theAgents do:
       [:a |
           aCollec := OrderedCollection new.
           aCollec add: time;
           add: a id;
           add: a stock.
           self updateFile: 'myAgents.txt' dataCollection: aCollec
separator: ';']

New Message Reply Date view Thread view Subject view Author view
 

Back to home