Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

loop and ID

New Message Reply Date view Thread view Subject view Author view

Subject: loop and ID
From: Pierre-Marcel GORAL (corran_pmg@hotmail.com)
Date: Wed May 05 2004 - 11:54:33 CEST

      Hello everybody!

I try to use functions in an economical model, in order to change the configuration of the economical environment, to observe the behaviours of my agents.
To do this I need to implement a certain amount of functionnalities using the ID of the agents. Is it possible to read those IDs, and with what kind of methods?

I've got another question: it seems that in Cormas the loop of the "for(i=0;i<...;i++)" kind is written like:

x to: y do: [:a | something].

That's OK, but how do I use the index variable in the block executed during the loop??? I need this in order to compare it with ID, joining the first problem... You know, just like this in pseudo C:

for(i=0;i<...;i++){
 (anAttrib of the agent whose ID == i) = 1;
  }

Thanks for all!

Pierre-Marcel GORAL



Hotmail : un compte GRATUIT qui vous suit partout et tout le temps ! Cliquez-ici

New Message Reply Date view Thread view Subject view Author view
 

Back to home