eosim::core::Experiment Class Reference
[Running Simulations]

#include <eosim/core/experiment.hpp>

Collaboration diagram for eosim::core::Experiment:

Collaboration graph
[legend]
List of all members.

Detailed Description

Experiment Manager.

Author:
Sebastián Alaggia
Version:
1.0.1
Date:
2005

This class handles the execution of a simulation. It is a main class in EOSimulator. While Model is defines the system, Experiment handles the runs.


Public Member Functions

 Experiment ()
 The constructor creates an Experiment.
 ~Experiment ()
 The destructor deletes all the entities scheduled.
void run (double simTime)
 This operation simulates the connected model until simTime.
void setModel (Model *model)
 This operation links an experiment to model.
void schedule (double offset, Entity *who)
 This operation schedules who at the simulation’s actual time plus offset.
void setSeed (unsigned long seed)
 This operation uses seed to assign a new seed to all distribution registered in the model.
void registerDist (dist::Distribution *dist)
 This operation register dist in the experiment.
void registerCEvent (CEvent *cEv)
 This operation register cEv in the experiment.
double getSimTime ()
 This operation returns the simulation’s actual time.


Constructor & Destructor Documentation

Experiment::~Experiment (  ) 

The destructor deletes all the entities scheduled.

Warning:
It is assumed that all entities were created dynamically, so every entity stored is deleted.


Member Function Documentation

void Experiment::run ( double  simTime  ) 

This operation simulates the connected model until simTime.

Note:
Experiment could simulate any Model which use event method or three phase approach. The simulation actual time is not reseted after a run, the first run starts at zero, but next runs starts when the previous finished.
Warning:
The experiment must be connected to a model.

void Experiment::setModel ( Model model  ) 

This operation links an experiment to model.

Note:
This operation is automatically invoked by EOSimulator, the programmer shouldn’t use it.
Warning:
The model must be not null.

void Experiment::schedule ( double  offset,
Entity who 
)

This operation schedules who at the simulation’s actual time plus offset.

Note:
It is assumed that who knows to which event it is scheduled.

void Experiment::setSeed ( unsigned long  seed  ) 

This operation uses seed to assign a new seed to all distribution registered in the model.

Note:
To obtain different runs, set different seeds in the experiment.
Warning:
The experiment must be connected to a model.

void Experiment::registerDist ( dist::Distribution dist  ) 

This operation register dist in the experiment.

Note:
The programmer shouldn’t invoke this operation because it’s invoked automatically by EOSimulator.
Warning:
The experiment must be connected to a model.

void Experiment::registerCEvent ( CEvent cEv  ) 

This operation register cEv in the experiment.

Note:
The programmer shouldn’t invoke this operation because it’s invoked automatically by EOSimulator.
Warning:
The experiment must be connected to a model.


Generated on Tue Oct 14 16:48:47 2008 for EOSimulator by  doxygen 1.5.2