class devssim

The devssim functions as the root coordinator for a simulation.

Inheritance:


Public Methods

[more] devssim(devs* model, adevs::stime_t t0 = 0.0)
Creates and initializes a simulator for the model with initial time t0
[more]void step(stime_t dt)
Step the simulator by dt units of time.
[more]void step(stime_t dt, indexed& input)
Steps the simulator after applying the port_values in the input list to the top level model.
[more]void computeNextOutput(indexed& result)
Computes the output of the top level model at tN.
[more]inline void run()
Run the simulator
[more]inline void run(stime_t t_max)
Run the simulator until tN > t_max
[more]inline void run(unsigned i)
Run the simulator through i cycles
[more]void run(stime_t t_max, unsigned max_cycles)
Run the simulator through to t_max or max_cycles (whichever comes first)
[more]stime_t timeCurrent()
Returns the current simulation time
[more]stime_t timeNext()
Returns the time of next event
[more]stime_t timeLast()
Returns the time of of the last event
[more]bool isPassive()
Returns true if tN = INFINITY, false otherwise
[more]virtual void reset(stime_t t0, bool reset_model = true)
Resets the simulator.
[more]virtual void reset(bool reset_model = true)
[more]virtual bool halt()
Returns true if the simulator should stop, false otherwise.
[more]virtual ~devssim()
Deletes the root simulator and all of its components
[more]static inline void setThreadLimit(int limit)
Set the thread limit for running parallel simulations.

Protected Fields

[more]devs* model


Inherited from object:

Public Methods

ovirtual bool operator==(const object &obj) const
ovirtual bool operator!=(const object &obj) const
ovirtual unsigned int hashcode() const
ovirtual object* clone() const


Documentation

The devssim functions as the root coordinator for a simulation. In generally, it should not be sub-classed, except to override the halt () method.
o devssim(devs* model, adevs::stime_t t0 = 0.0)
Creates and initializes a simulator for the model with initial time t0

ovoid step(stime_t dt)
Step the simulator by dt units of time. Throws a ScheduleException if dt < 0 or if (timeCurrent() + dt) > timeNext ().

ovoid step(stime_t dt, indexed& input)
Steps the simulator after applying the port_values in the input list to the top level model. The input list is emptied by the step method. Input objects delivered to the simulator are adopted by the simulator (i.e. the caller should not tamper with the input after the step call has been made).

ovoid computeNextOutput(indexed& result)
Computes the output of the top level model at tN. The indexed list provided to the method is filled with port_value objects, one for each item on the output ports. The port_value objects and their value objects are owned by the caller.

The state of the model is not changed by called this method, provided that the output_func method does not cause a state change. Garbage collection is not performed at the end of the output computation, and so objects outputted by the output_func() are not destroyed. These objects ARE deleted when the next state change is computed (i.e. via step or run).

This method fails with a CloneException if any of the output objects do not support the clone() method.

oinline void run()
Run the simulator

oinline void run(stime_t t_max)
Run the simulator until tN > t_max

oinline void run(unsigned i)
Run the simulator through i cycles

ovoid run(stime_t t_max, unsigned max_cycles)
Run the simulator through to t_max or max_cycles (whichever comes first)

ostime_t timeCurrent()
Returns the current simulation time

ostime_t timeNext()
Returns the time of next event

ostime_t timeLast()
Returns the time of of the last event

obool isPassive()
Returns true if tN = INFINITY, false otherwise

ovirtual void reset(stime_t t0, bool reset_model = true)
Resets the simulator. If model = true, reset the model attached to the simulator as well.

ovirtual void reset(bool reset_model = true)

ovirtual bool halt()
Returns true if the simulator should stop, false otherwise. This method is called by the root coordinator/simulator at the end of each simulation cycle.

ovirtual ~devssim()
Deletes the root simulator and all of its components

ostatic inline void setThreadLimit(int limit)
Set the thread limit for running parallel simulations. A value of 0 will result in a sequentail run. (default is 0)

odevs* model


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.