swarm-modeling
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Time control


From: Li An
Subject: Time control
Date: Sun, 12 Jan 2003 14:30:16 -0500

Hi,
In a Java Swarm modeling, suppose I have a simulation of 15 years. If I want to report something (say, age of a person, person[1]) at a certain year (year j), should I use Globals.env.getCurrentTime() to represent that time?
For instance, in regular Java code, it should look like this:
...
for (int j=0;j<endTime;j++) {
...
d=(Person)personList.get(1);//want to take out the second person in the list
System.out.println("At year "+(j+1)+"person 1's age is "+d.getAge());
...
}
Should we use Globals.env.getCurrentTime() to replace j in above print command? In a Swarm /Java code for the same job, do we not usually use the for loop to control time? Instead, we let the schedule to control the time by using something like "modelSchedule.at$createAction(0,modelActions)"?
Thanks,
Li

Li An
Systems Modeling Lab
Department of Fisheries and Wildlife
Michigan State University
East Lansing, MI 48824
Phone (Work): 517-353-7981
Fax: 517-432-1699
Web:http://www.ku.edu/~pauljohn/sdg/member_pages/An_Li.html
http://www.msu.edu/~anli



                 ==================================
  Swarm-Modelling is for discussion of Simulation and Modelling techniques
  esp. using Swarm.  For list administration needs (esp. [un]subscribing),
  please send a message to <address@hidden> with "help" in the
  body of the message.
                 ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]