Subject: RE : add initagents
From: Christophe Le Page (christophe.l@chula.ac.th)
Date: Fri Jun 16 2006 - 13:02:27 CEST
Hi Miao,
Suppose you have written a method like this:
createAgent: aClass number: anInteger
anInteger timesRepeat: [self newEntity: aClass]
Then you can use it in the "init" method
init
...
self createAgent: AgentClass number: 10
as well as in the "step:" method
step: t
...
(t \\ 10) isZero ifTrue: [self createAgent: AgentClass number: 10]
> -----Message d'origine-----
> De : owner-cormas@cirad.cirad.fr [mailto:owner-cormas@cirad.cirad.fr] De
> la part de Miao Wang
> Envoyé : vendredi 2 juin 2006 12:53
> À : cormas@cirad.fr
> Objet : add initagents
>
> Hi everyone!
>
> Is it possible to change the number of initagents during the simulation?
> For example when t=0 the initagents number is 10, when t=10, other 10
> initagents are added ,not interfering the former 10 agents' status?
>
> Thank you very much !
>
> Mira
>
>
> Miao Wang at Geomatics
> School of Civil Engineering and Geosciences
> G.19, Cassie Building,
> University of Newcastle Upon Tyne, NE1 7RU
> England
> Email: miao.wang1@ncl.ac.uk