eosim::core::Entity Class Reference
[Modeling Clases]

#include <eosim/core/entity.hpp>

Collaboration diagram for eosim::core::Entity:

Collaboration graph
[legend]
List of all members.

Detailed Description

Entity.

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

This is the parent class of all entities. Entity is a class that represents objects or components of the system whose activities are modeled. EOSimulator provides a primitive entity which has both a BEvent and a time stamp that indicates the entity’s last bounded event, the clock. If your model needs a more specific entity, just implement a new subclass.

There’s a particular issue when it comes to entities: All entities of a system must be created dynamically, even global or permanent entities. And only temporary entities must be deleted when they leave the system.

That's because of the way that EOSimulator containers are implemented. Entity containers have pointers to its elements, in order to avoid copies. When their destructor is called, it destroys every entity stored. When a simulation ends, every entity is scheduled or waiting in a queue, so they are in an EOSimulator’s container. Entity containers have pointers to its elements, in order to avoid copies. When their destructor is called, it destroys every entity stored. This policy is imposed by EOSimulator but it must be controlled by the user (see Collections).


Public Member Functions

 Entity ()
 The constructor creates an Entity. Remember, all entities must be created dynamically, even global entities.
virtual ~Entity ()
 The destructor of Entity.
void setBEvent (BEvent *bEv)
 This operation sets the entity’s next BEvent to bEv.
void setClock (double clock)
 This operation sets the time when the next BEvent is going to occur.
double getClock ()
 Returns the time of the last entity’s B event.
void processEvent ()
 This operation process the routine of the entity’s actual BEvent.


Member Function Documentation

void Entity::setBEvent ( BEvent bEv  ) 

This operation sets the entity’s next BEvent to bEv.

Note:
Entities have to know to which event they are scheduled. The BCalendar only schedule the entity to a certain time, not to a certain event. If setBEvent is invoked with null, the simulation aborts immediately displaying an error message.
Warning:
The programmer should not use this operation, it is invoked directly by EOSimulator.

Note:
Entities have to know to which event they are scheduled. The BCalendar only schedule the entity to a certain time, not to a certain event.
Warning:
The programmer should not use this operation, it is invoked directly by EOSimulator.

If setBEvent is invoked with null, the simulation aborts immediately displaying an error message.

void Entity::setClock ( double  clock  ) 

This operation sets the time when the next BEvent is going to occur.

Warning:
The programmer should not use this operation, it is invoked directly by EOSimulator.

void Entity::processEvent (  ) 

This operation process the routine of the entity’s actual BEvent.

Warning:
The programmer should not use this operation, it is invoked directly by EOSimulator.


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