|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swarm.BaseImpl | +--swarm.objectbase.SwarmImpl | +--Model
The Model class has methods that build objects and it also tells them to do things. Please note the use of both Lists and Sets here. For each student, it creates a set of "contacts" that serves an important role in the Student class. Note also that when a crime occurs, a Policeman is created and told to investigate.
Constructor Summary | |
Model(swarm.defobj.Zone aZone,
int n)
Creates a new Model instance. |
Method Summary | |
swarm.activity.Activity |
activateIn(swarm.objectbase.Swarm swarmContext)
Describe activateIn method here. |
java.lang.Object |
buildActions()
We want to repeatedly process the list of agents. |
java.lang.Object |
buildObjects()
Create a List and fill it with N student objects. |
void |
checkAgents()
Tell the agents to sayHi |
java.lang.Object |
checkForCrime()
Randomly designate some student as the criminal, give his fingerprint to a policeman, and tell the policeman to conduct the investigation. |
java.lang.Object |
getStudentList()
|
java.lang.Object |
go()
A go method is needed because we need to run the activity structure that was created in buildActions() and put into the time scheme by activateIn(). |
Methods inherited from class swarm.objectbase.SwarmImpl |
allocIVars, allocIVarsComponent, compare, copyIVars, copyIVarsComponent, describe, describeForEach, describeForEachID, describeID, drop, freeIVars, freeIVarsComponent, getActivity, getCompleteProbeMap, getComponentZone, getDisplayName, getInternalZone, getName, getPageSize, getPopulation, getProbeForVariable, getProbeMap, getSynchronizationType, getTypeName, getZone, perform, perform$with, perform$with$with, perform$with$with$with, respondsTo, setDisplayName, xfprint, xfprintid, xprint, xprintid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Model(swarm.defobj.Zone aZone, int n)
Model
instance.aZone
- a Zone
valuen
- an int
valueMethod Detail |
public java.lang.Object buildObjects()
buildObjects
in class swarm.objectbase.SwarmImpl
Object
valuepublic void checkAgents()
public java.lang.Object checkForCrime()
Object
valuepublic java.lang.Object buildActions()
buildActions
in class swarm.objectbase.SwarmImpl
Object
valuepublic swarm.activity.Activity activateIn(swarm.objectbase.Swarm swarmContext)
activateIn
method here.activateIn
in class swarm.objectbase.SwarmImpl
swarmContext
- a Swarm
valueActivity
valuepublic java.lang.Object go()
Object
valuepublic java.lang.Object getStudentList()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |