Messages from list : cormas@cirad.fr

Choose a topic among the following archives :

Create more agents in a specific plot

New Message Reply Date view Thread view Subject view Author view

Subject: Create more agents in a specific plot
warong@agri.ubu.ac.th
Date: Tue Mar 28 2006 - 09:06:00 CEST

Dear all,
I have a trouble to add agents in spatial grid of Cormas. I implemented 11
plots belonging to individual family. What I am trying to do is to add and
display family members in each plot. What I can do now is adding only one
family member (agent) into plot (spatial grid) by writing code

In class Villager

myCells
|selectedCells|
selectedCells := OrderedCollection new.
self plots do: [: pl | pl components do: [:c selected Cells add: c]].
^selectedCells

In control and scheduler

initVillagers
|location|
self villagers do: [:v | location := Cormas selectRandomlyFrom: v myCells. v
moveTo: location].

I am looking for a pre-defined method that allows me to add more agents into
a selected plot (cells) but I could not find it.
Do you have any suggestion?
Thanks.

Warong

New Message Reply Date view Thread view Subject view Author view
 

Back to home