public class DefaultSchedule extends Object implements Schedule
| Modifier and Type | Field and Description |
|---|---|
protected int |
id |
| Constructor and Description |
|---|
DefaultSchedule() |
DefaultSchedule(RegionSet regions) |
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusListener(ScheduleStatusListener l) |
void |
finish() |
int |
getCurrentTick()
Returns the current tick (which is the next tick that is performed)
|
int |
getEndTick() |
int |
getStartTick() |
int |
getTargetTick() |
void |
initialise(ModelData data,
RunInfo info,
Region extent) |
void |
register(TickAction o)
Registers the object in case any actions are going to be called on it e.g.
|
void |
run()
Runs the simulation from predefined start to predefined end tick.
|
void |
runFromTo(int start,
int end)
Runs the simulation from given start to end tick.
|
void |
runUntil(int target)
Runs the simulation until the (intermediate) target tick.
|
void |
setEndTick(int end)
Sets the simualtion's final tick.
|
void |
setRegions(RegionSet regions) |
void |
setStartTick(int tick)
Sets the simulation's start tick.
|
void |
setTargetTick(int target)
Sets and (intermediate) target tick.
|
void |
setTargetToNextTick()
Sets the simulation's target tick to the current tick (which is the next tick that is
performed).
|
void |
tick()
Runs the simulation a single tick.
|
boolean |
unregister(TickAction o)
Removes the given
TickAction from this schedule to prevent the
action from being performed in future. |
public DefaultSchedule()
public DefaultSchedule(RegionSet regions)
public void initialise(ModelData data, RunInfo info, Region extent) throws Exception
initialise in interface Initialisabledata - model datainfo - run informationextent - region the initialisable object belongs toExceptionpublic void tick()
Schedulepublic void runFromTo(int start,
int end)
SchedulerunFromTo in interface ScheduleSchedule.runFromTo(int, int)public void runUntil(int target)
SchedulerunUntil in interface ScheduleSchedule.runUntil(int)public void run()
Schedulerun in interface ScheduleSchedule.run()public void setTargetTick(int target)
SchedulesetTargetTick in interface ScheduleSchedule.setTargetTick(int)public void setEndTick(int end)
SchedulesetEndTick in interface ScheduleSchedule.setEndTick(int)public int getEndTick()
getEndTick in interface Schedulepublic int getTargetTick()
getTargetTick in interface Schedulepublic int getStartTick()
getStartTick in interface Schedulepublic void setTargetToNextTick()
SchedulesetTargetToNextTick in interface Schedulepublic void register(TickAction o)
Schedulepublic boolean unregister(TickAction o)
ScheduleTickAction from this schedule to prevent the
action from being performed in future.unregister in interface Scheduleo - tick actionSchedule.unregister(org.volante.abm.schedule.TickAction)public void setStartTick(int tick)
SchedulesetStartTick in interface ScheduleSchedule.setStartTick(int)public int getCurrentTick()
SchedulegetCurrentTick in interface Schedulepublic void setRegions(RegionSet regions)
setRegions in interface Schedulepublic void addStatusListener(ScheduleStatusListener l)
addStatusListener in interface Schedule