Package org.simplesim.simulator
Class ConcurrentDESimulator
java.lang.Object
org.simplesim.simulator.BasicSimulator
org.simplesim.simulator.SequentialDESimulator
org.simplesim.simulator.ConcurrentDESimulator
- All Implemented Interfaces:
Simulator
Concurrent simulator for discrete event models using multiple threads
This simulator identifies all due agents of a model using a global event
queue. Then the doEventSim method of these imminent agents are called
in a concurrent mode and with no specific order.
This implementation is especially useful to run DES models.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.simplesim.simulator.Simulator
Simulator.InvalidSimulatorStateException -
Constructor Summary
ConstructorsConstructorDescriptionQuick start constructor of a new concurrent discrete-event simulator with a given modelConcurrentDESimulator(BasicDomain root, EventQueue<Agent> queue, MessageForwardingStrategy forwarding) Constructs a new concurrent simulator with given model, queue implementation and messaging strategy -
Method Summary
Methods inherited from class org.simplesim.simulator.BasicSimulator
getCurrentEventList, getRootDomain, getSimulationTime, registerEventsProcessedListener, unregisterEventsProcessedListener
-
Constructor Details
-
ConcurrentDESimulator
public ConcurrentDESimulator(BasicDomain root, EventQueue<Agent> queue, MessageForwardingStrategy forwarding) Constructs a new concurrent simulator with given model, queue implementation and messaging strategy- Parameters:
root- the root domain of the modelqueue- the queue implementation to use as global event queueforwarding- the strategy to use for message forwarding
-
ConcurrentDESimulator
Quick start constructor of a new concurrent discrete-event simulator with a given modelUses
RecursiveMessageForwardingand aHeapEventQueueas default options.- Parameters:
root- the root domain of the model
-
-
Method Details
-
runSimulation
Description copied from class:BasicSimulatorStarts a simulation run- Specified by:
runSimulationin interfaceSimulator- Overrides:
runSimulationin classSequentialDESimulator- Parameters:
stop- simulation time when the simulation should stop
-