|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Agent
madkit.kernel.Scheduler
warbot.kernel.WarbotScheduler
public final class WarbotScheduler
Field Summary | |
---|---|
static java.lang.String |
AUTHOR
|
static java.lang.String |
DATE
|
static java.lang.String |
VERSION
|
Method Summary | |
---|---|
void |
activate()
This method is initially called when the micro-kernel registers the agent. |
void |
end()
the end method will remove all the activators which have been used by the scheduler. |
long |
getCycleNumber()
|
boolean |
isRunning()
|
void |
live()
This method defines the main behavior of threaded agents. |
void |
setEnvironment(WarbotEnvironment w)
|
void |
setRunning(boolean t)
|
Methods inherited from class madkit.kernel.Scheduler |
---|
addActivator, addActivator, getActivators, removeActivator, removeAllActivators |
Methods inherited from class madkit.kernel.Agent |
---|
connectAgencyToAgency, createPlace, createPlace, enableMobility, enableMobility, exitImmediatlyOnKill, getAgencyNamed, joinPlace, joinPlace, joinPlace, pause, receiveMessage, run, waitNextMessage, waitNextMessage |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String VERSION
public static java.lang.String AUTHOR
public static java.lang.String DATE
Method Detail |
---|
public long getCycleNumber()
public void setRunning(boolean t)
public boolean isRunning()
public void setEnvironment(WarbotEnvironment w)
public void activate()
AbstractAgent
Here is a typical example (taken from the PingPong
agent of MadKit (plugin demos)) :
public void activate() { try { createGroup(true,"ping-pong",null,null); println ("No ping-pong group : I created one"); creator=true; } catch (OrganizationRequestException e) { // the group already exists creator=false; println ("A ping-pong group already exists : I will join"); } requestRole("ping-pong","player",null); }
activate
in class AbstractAgent
public void live()
Agent
live
in class Agent
public void end()
Scheduler
super.end()
first in order to ease the removal of simulated agents which will be killed.
Doing so can greatly improved the "killing time" of simulation engines
end
in class Scheduler
AbstractAgent.end()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |