adevs
|
#include <adevs_par_simulator.h>
Public Member Functions | |
ParSimulator (Devs< X, T > *model, MessageManager< X > *msg_manager=NULL) | |
ParSimulator (Devs< X, T > *model, LpGraph &g, MessageManager< X > *msg_manager=NULL) | |
T | nextEventTime () |
Get the model's next event time. | |
void | execUntil (T stop_time) |
~ParSimulator () |
This is the conservative simulator described in "Building Software for Simulation". Models, network and atomic, can be assigned to specific threads (processors) by calling the setProc() method. The components of a network will inherit its thread assignment. Model's with an explicit assignment must have a positive lookahead. Atomic models that are unassigned, by inheritance or otherwise, must have a positive lookahead and will be assigned randomly to a thread. Note that this simulator does not support dynamic structure models.
adevs::ParSimulator::ParSimulator | ( | Devs< X, T > * | model, |
MessageManager< X > * | msg_manager = NULL |
||
) |
Create a simulator for the provided model. The Atomic components will be assigned to the preferred processors, or assigned randomly if no preference is given or the preference can not be satisfied. The message manager is used to handle inter-thread events. If msg_manager is NULL, the assignment and copy constructors of output objects are used and their is no explicit cleanup (see the MessageManager documentation). This constructor assumes all to all connection of the processors.
References adevs::LpGraph::addEdge().
adevs::ParSimulator::ParSimulator | ( | Devs< X, T > * | model, |
LpGraph & | g, | ||
MessageManager< X > * | msg_manager = NULL |
||
) |
This constructor accepts a directed graph whose edges tell the simulator which processes feed input to which other processes. For example, a simulator with processors 1, 2, and 3 where 1 -> 2 and 2 -> 3 would have two edges: 1->2 and 2->3.
adevs::ParSimulator::~ParSimulator | ( | ) |
Deletes the simulator, but leaves the model intact. The model must exist when the simulator is deleted, so delete the model only after the simulator is deleted.
void adevs::ParSimulator::execUntil | ( | T | stop_time | ) | [virtual] |
Execute the simulator until the next event time is greater than the specified value. There is no global clock, so this must be the actual time that you want to stop.
Implements adevs::AbstractSimulator< X, T >.