public abstract class Environment extends java.lang.Object implements Schedulable
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object[] |
params
The parameters that are passed to
onInitialization() |
DEFAULT_SLEEP
Constructor and Description |
---|
Environment(Scheduling _scheduling,
java.lang.Object... params)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
cycle()
A cycle of the schedulable system
|
java.util.Random |
getRandom()
Getter for the random object
|
Scheduler |
getScheduler()
Getter for the scheduler
|
void |
onCycle()
This method is called at each cycle of the environment
|
void |
onInitialEntitiesCreation()
This method is called after the initialization process of the environment to
create entities
|
void |
onInitialization()
This method is called during the initialization process of the environment
|
void |
onSchedulingStarts()
This method is called when the scheduler starts
|
void |
onSchedulingStops()
This method is called when the scheduler stops (by stopCondition or explicit
stop)
|
protected void |
onUpdateRender()
Override this method to update rendering related to the environment
|
void |
setSeed(long _seed)
Set the seed for the common random object.
|
boolean |
stopCondition()
Check if the schedulable must be stopped by the scheduler.
|
protected java.lang.Object[] params
onInitialization()
public Environment(Scheduling _scheduling, java.lang.Object... params)
_scheduling
- The scheduling of the environmentparams
- The parameters to initialize the environmentpublic Scheduler getScheduler()
public void setSeed(long _seed)
_seed
- The seed to initialize the random objectpublic void onInitialization()
public void onInitialEntitiesCreation()
public void onCycle()
public boolean stopCondition()
Schedulable
stopCondition
in interface Schedulable
public final void cycle()
Schedulable
cycle
in interface Schedulable
protected void onUpdateRender()
public java.util.Random getRandom()
public void onSchedulingStarts()
Schedulable
onSchedulingStarts
in interface Schedulable
public void onSchedulingStops()
Schedulable
onSchedulingStops
in interface Schedulable