net.sourceforge.jabm.mixing
Class RandomArrivalAgentMixer

java.lang.Object
  extended by net.sourceforge.jabm.mixing.RandomArrivalAgentMixer
All Implemented Interfaces:
java.io.Serializable, AgentMixer
Direct Known Subclasses:
FullRandomArrivalAgentMixer

public class RandomArrivalAgentMixer
extends java.lang.Object
implements AgentMixer, java.io.Serializable

With this mixer, on any given time step an agent arrival event is generated with a given probability. The agent is picked uniformly at random from the group.

See Also:
Serialized Form
 

Field Summary
protected  double arrivalProbability
          The probability with which an agent arrives at the simulation on any given tick.
static java.util.ArrayList<Agent> EMPTY_LIST
           
protected  cern.jet.random.engine.RandomEngine prng
           
 
Constructor Summary
RandomArrivalAgentMixer()
           
RandomArrivalAgentMixer(cern.jet.random.engine.RandomEngine prng)
           
 
Method Summary
 void eventOccurred(SimEvent event)
           
 void fireAgentArrivalEvent(Agent agent, AgentList group, SimulationController simulation)
           
 double getArrivalProbability()
           
 cern.jet.random.engine.RandomEngine getPrng()
           
 void invokeAgentInteractions(Population population, SimulationController simulation)
          Schedule events of type AgentArrivalEvent for each agent in the simulation.
 void invokeInteractions(AgentList group, SimulationController simulation)
           
 void setArrivalProbability(double arrivalProbability)
          Configure the probability with which an agent will arrive in any given tick.
 void setPrng(cern.jet.random.engine.RandomEngine prng)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prng

protected cern.jet.random.engine.RandomEngine prng

arrivalProbability

protected double arrivalProbability
The probability with which an agent arrives at the simulation on any given tick.


EMPTY_LIST

public static final java.util.ArrayList<Agent> EMPTY_LIST
Constructor Detail

RandomArrivalAgentMixer

public RandomArrivalAgentMixer(cern.jet.random.engine.RandomEngine prng)

RandomArrivalAgentMixer

public RandomArrivalAgentMixer()
Method Detail

invokeInteractions

public void invokeInteractions(AgentList group,
                               SimulationController simulation)

fireAgentArrivalEvent

public void fireAgentArrivalEvent(Agent agent,
                                  AgentList group,
                                  SimulationController simulation)

invokeAgentInteractions

public void invokeAgentInteractions(Population population,
                                    SimulationController simulation)
Description copied from interface: AgentMixer
Schedule events of type AgentArrivalEvent for each agent in the simulation.

Specified by:
invokeAgentInteractions in interface AgentMixer

eventOccurred

public void eventOccurred(SimEvent event)

getPrng

public cern.jet.random.engine.RandomEngine getPrng()

setPrng

public void setPrng(cern.jet.random.engine.RandomEngine prng)

getArrivalProbability

public double getArrivalProbability()

setArrivalProbability

public void setArrivalProbability(double arrivalProbability)
Configure the probability with which an agent will arrive in any given tick.