Constructor and Description |
---|
PoissonBehavior(long millis)
Creates a behavior that simulates a Poisson arrival process with a
specified average interarrival time.
|
PoissonBehavior(long millis,
java.lang.Runnable runnable)
Creates a behavior that simulates a Poisson arrival process with a
specified average interarrival time.
|
Modifier and Type | Method and Description |
---|---|
void |
action()
This method calls
onTick() for each Poisson arrival. |
static PoissonBehavior |
create(long millis,
java.lang.Runnable runnable)
Creates a new PoissonBehavior which runs the specified Runnable on each arrival.
|
boolean |
done()
Returns true once
stop() is called, false otherwise. |
int |
getPriority()
This method should return a number that denotes the priority of a behavior.
|
int |
getTickCount()
Returns the number of times the
onTick() method of this behavior
has been called (including any ongoing call). |
void |
onStart()
Computes the wakeup time for the first execution of this behavior.
|
void |
onTick()
This method is called for each arrival.
|
void |
reset()
Resets the behavior to its initial state, allowing it to be used again.
|
void |
stop()
Terminates the behavior.
|
agent, agentForService, agentForService, agentsForService, agentsForService, block, block, compareTo, isBlocked, onEnd, println, restart
public PoissonBehavior(long millis)
millis
- average interarrival time in milliseconds.public PoissonBehavior(long millis, java.lang.Runnable runnable)
millis
- average interarrival time in milliseconds.runnable
- Runnable to run.public final void stop()
public final int getTickCount()
onTick()
method of this behavior
has been called (including any ongoing call).onTick()
method has been called.public void onTick()
public void onStart()
onStart
in class Behavior
Behavior.onStart()
public final void action()
onTick()
for each Poisson arrival.action
in class Behavior
Behavior.action()
public boolean done()
stop()
is called, false otherwise.done
in class Behavior
stop()
is called, false otherwise.Behavior.done()
public void reset()
reset
in class Behavior
Behavior.reset()
public int getPriority()
Behavior
getPriority
in class Behavior
public static PoissonBehavior create(long millis, java.lang.Runnable runnable)
millis
- Average inter-arrival time in milliseconds.runnable
- Runnable to run.