|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpeersim.core.Scheduler
public class Scheduler
A binary function over the time points. That is,
for each time point returns a boolean value.
The concept of time depends on the simulation model. Current time
has to be set by the simulation engine, irrespective of the model,
and can be read using CommonState.getTime()
. This scheduler
is interpreted over those time points.
In this simple implementation the valid times will be
from, from+step, from+2*step, etc,
where the last element is strictly less than until.
Alternatively, if at is defined, then the schedule will be a single
time point. If FINAL is
defined, it is also added to the set of active time points.
It refers to the time after the simulation has finished (see
CommonState.getPhase()
).
Parameter Summary | |
---|---|
step
Defaults to 1. |
|
at
Defaults to -1. |
|
from
Defaults to 0. |
|
until
Defaults to Long.MAX_VALUE. |
|
FINAL
Defines if component is active after the simulation has finished. |
Field Summary | |
---|---|
boolean |
fin
|
long |
from
|
protected long |
next
The next scheduled time point. |
long |
step
|
long |
until
|
Constructor Summary | |
---|---|
Scheduler(java.lang.String prefix)
Reads configuration parameters from the component defined by prefix . |
|
Scheduler(java.lang.String prefix,
boolean useDefault)
Reads configuration parameters from the component defined by prefix . |
Method Summary | |
---|---|
boolean |
active()
true if current time point is covered by this scheduler |
boolean |
active(long time)
true if given time point is covered by this scheduler |
long |
getNext()
Returns the next time point. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Parameter Detail |
---|
step
at
from
until
FINAL
CommonState.getPhase()
Field Detail |
---|
public final long step
public final long from
public final long until
public final boolean fin
protected long next
Constructor Detail |
---|
public Scheduler(java.lang.String prefix)
prefix
. "step" defaults to 1.
public Scheduler(java.lang.String prefix, boolean useDefault)
prefix
. If useDefault is false, then at least parameter
"step" must be explicitly defined. Otherwise "step"
defaults to 1.
Method Detail |
---|
public boolean active(long time)
public boolean active()
public long getNext()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |