|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmadkit.kernel.AbstractAgent
madkit.kernel.Agent
turtlekit.kernel.Launcher
public abstract class Launcher
This agent sets up, launches and manages Turtle based simulations. You have to defined a subclass of this one to custom and launch a simulation. Yo have at least to override the addSimulationAgents method to create the agents you want to launch in your simulation: turtles, viewers and observers. To declare patch variables (PatchVariable objects) you have to override the initializePatchVariables method.
Field Summary | |
---|---|
static java.lang.String |
COMMUNITY
|
Constructor Summary | |
---|---|
Launcher()
The constructor is where you have to change the default values of the simulation parameters using the corresponding accessors. |
Method Summary | |
---|---|
void |
activate()
MadKit usage |
protected void |
addMyScheduler(TurtleScheduler s)
add a specific scheduler (that overrides the scheduleWorld method for example) |
void |
addObserver(Observer theObserver,
boolean hasGUI)
Add a specified Observer to the simulation. |
void |
addObserver(Observer theObserver,
boolean hasGUI,
java.lang.String agentName)
Add a specified Observer to the simulation. |
protected void |
addPatchVariable(PatchVariable variable)
Be careful, use this method only in the initializeSimulation method. |
abstract void |
addSimulationAgents()
Override this method is compulsory (abstract). |
protected void |
addTurtle(Turtle t)
place a turtle at a random patch |
protected void |
addTurtle(Turtle t,
int u,
int v)
place a turtle on the patch (u,v). |
void |
addViewer()
Add a default world viewer with the current cell size. |
void |
addViewer(int cellS)
add a default world viewer with the specified cell size: cellS |
void |
addViewer(Viewer v)
add a specific world viewer with the current cell size |
void |
addViewer(Viewer v,
int cellS)
add a specific world viewer with the specified cell size: cellS |
void |
addViewer(Viewer v,
int cellS,
java.lang.String viewerName)
add a specific world viewer with the specified cell size: cellS |
void |
addViewer(Viewer v,
java.lang.String viewerName)
add a specific world viewer with the current cell size |
void |
end()
MadKit kernel usage. |
int |
getCellSize()
|
int |
getHeight()
|
java.lang.String |
getSimulationName()
|
int |
getWidth()
|
void |
initGUI()
MadKit kernel usage |
protected void |
initializePatchVariables()
override this method is not compulsory, but it is where you have to initialize the patch variables and their properties(evaporation, diffusion...): Once you have created a new PatchVariable object and set its properties with the methods of the class PatchVariable(setEvapCoef, setDiffuseCoef and setDefaultValue) You have to add it to the simulation using the addPatchVariable method: protected void initializePatchVariables() { PatchVariable p = new PatchVariable("flavor"); p.setDiffuseCoef(0.3153); //Optional p.setEvapCoef(0.025); //Optional p.setDefaultValue(32); //Optional addPatchVariable(a); } |
void |
launchPython()
|
void |
live()
MadKit kernel usage |
void |
setCellSize(int add)
|
void |
setCyclePause(int add)
|
void |
setHeight(int add)
|
void |
setSimulationName(java.lang.String name)
|
void |
setWidth(int add)
|
void |
setWrapModeOn(boolean b)
|
void |
stopOrResumeSimulation()
|
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 final java.lang.String COMMUNITY
Constructor Detail |
---|
public Launcher()
Method Detail |
---|
public final void setWidth(int add)
public final int getWidth()
public final void setCellSize(int add)
public final int getCellSize()
public final void setHeight(int add)
public final int getHeight()
public final java.lang.String getSimulationName()
public final void setSimulationName(java.lang.String name)
public final void setCyclePause(int add)
public final void setWrapModeOn(boolean b)
protected final void addTurtle(Turtle t)
protected final void addTurtle(Turtle t, int u, int v)
public final void addObserver(Observer theObserver, boolean hasGUI, java.lang.String agentName)
public final void addObserver(Observer theObserver, boolean hasGUI)
public final void addViewer()
public final void addViewer(int cellS)
public final void addViewer(Viewer v, int cellS, java.lang.String viewerName)
public final void addViewer(Viewer v, int cellS)
public final void addViewer(Viewer v, java.lang.String viewerName)
public final void addViewer(Viewer v)
protected final void addMyScheduler(TurtleScheduler s)
protected final void addPatchVariable(PatchVariable variable)
protected void initializePatchVariables()
public abstract void addSimulationAgents()
public final void initGUI()
initGUI
in class AbstractAgent
public void activate()
activate
in class AbstractAgent
public final void live()
live
in class Agent
public final void end()
end
in class AbstractAgent
public void launchPython() throws java.lang.Exception
java.lang.Exception
public void stopOrResumeSimulation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |