Simpact Cyan
Population based event driven simulation using mNRM
Public Member Functions | List of all members
PopulationAlgorithmInterface Class Referenceabstract

An interface for a population based mNRM algorithm. More...

#include <populationinterfaces.h>

Inheritance diagram for PopulationAlgorithmInterface:
Inheritance graph
[legend]

Public Member Functions

virtual bool_t init ()=0
 Abstract function to initialize the implementation used.
 
virtual bool_t run (double &tMax, int64_t &maxEvents, double startTime=0)=0
 This should be called to actually start the simulation, do not call Algorithm::evolve for this. More...
 
virtual void setAboutToFireAction (PopulationAlgorithmAboutToFireInterface *pAction)=0
 Allows you to set the action that needs to be performed before firing an event dynamically. More...
 
virtual void onNewEvent (PopulationEvent *pEvt)=0
 When a new event has been created, it must be injected into the simulation using this function.
 
virtual double getTime () const =0
 Must return the simulation tilme of the algorithm.
 
virtual GslRandomNumberGeneratorgetRandomNumberGenerator () const =0
 Must return the random number generator used by the algorithm.
 

Detailed Description

An interface for a population based mNRM algorithm.

Member Function Documentation

◆ run()

virtual bool_t PopulationAlgorithmInterface::run ( double &  tMax,
int64_t &  maxEvents,
double  startTime = 0 
)
pure virtual

This should be called to actually start the simulation, do not call Algorithm::evolve for this.

Parameters
tMaxStop the simulation if the simulation time exceeds the specified time. Upon completion of the function, this variable will contain the actual simulation time stopped.
maxEventsIf positive, the simulation will stop if this many events have been executed. Set to a negative value to disable this limit. At the end of the simulation, this variable will contain the number of events executed.
startTimeThe start time of the simulation, can be used to continue where a previous call to this function left off.

Implemented in PopulationAlgorithmTesting, PopulationAlgorithmSimple, and PopulationAlgorithmAdvanced.

◆ setAboutToFireAction()

virtual void PopulationAlgorithmInterface::setAboutToFireAction ( PopulationAlgorithmAboutToFireInterface pAction)
pure virtual

Allows you to set the action that needs to be performed before firing an event dynamically.

When implementing a new population based algorithm you must make sure that this way the action performed by Algorithm::onAboutToFire can be changed at run time.

Implemented in PopulationAlgorithmTesting, PopulationAlgorithmSimple, and PopulationAlgorithmAdvanced.


The documentation for this class was generated from the following file: