eosim::core::BCalendar             EoSimulator Programmer's Manual

 

NAME

      BCalendar: B Events Calendar

 

SYNOPSIS

      #include <eosim/core/bcalendar.hpp>

 

      namespace eosim {

      namespace core {

 

            class BCalendar {

            public:

                  BCalendar ();

                  ~BCalendar ();

                  void bPhase ();

                  bool isStopped();

                  void schedule (double offset_, Entity* who_);

                  void setEndTime (double when_);

                  double getSimTime();

            };

     

      }

      }

 

DESCRIPTION

This class handles the B Events Calendar. The class main responsibility is to schedule entities for a certain time to a certain bounded event. It also handles the simulation time.

 

CLASS OPERATIONS

BCalendar ():

      The constructor creates an empty BCalendar ready to operate.

     

~BCalendar ():

      The destructor deletes all the entities scheduled. It is assumed that all the entities had been created dynamically, so every entity stored is deleted.

     

void bPhase ():

            This operation performs both A phase and B phase. First, the simulation time is advanced to the time of the first scheduled event. Then BCalendar process all events which are scheduled at the actual simulation time.

           

bool isStopped():

            This operation returns true if the simulation is terminated.

     

void schedule (double offset_, Entity* who_):

            This operation schedules who_ at the simulation’s actual time plus offset_. It is assumed that who_ knows to which event is scheduled.

     

void setEndTime (double when_):

            This operation sets the simulation’s end time. All simulations starts at 0.

     

double getSimTime():

            This operation returns the simulation’s actual time.

           

 

SEE ALSO

      eosim::core::BEvent

eosim::core::Entity

eosim::core::Experiment

eosim::utils::EntityQueueOrdered