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

Interface for a simulation state for the population-based algorithm, specifying member functions that need to be implemented. More...

#include <populationinterfaces.h>

Inheritance diagram for PopulationStateInterface:
Inheritance graph
[legend]
Collaboration diagram for PopulationStateInterface:
Collaboration graph
[legend]

Public Member Functions

virtual PersonBase ** getAllPeople ()=0
 Returns a list to the current living members in the population, introduced into the simulation using PopulationStateInterface::addNewPerson.
 
virtual PersonBase ** getMen ()=0
 Same as PopulationStateInterface::getAllPeople, but only the men are returned.
 
virtual PersonBase ** getWomen ()=0
 Same as PopulationStateInterface::getAllPeople, but only the women are returned.
 
virtual PersonBase ** getDeceasedPeople ()=0
 Returns the people who were part of the simulation but who are now deceased (intended for result analysis, not to be used during the simulation).
 
virtual int getNumberOfPeople () const =0
 Returns the number of people in the array returned by PopulationStateInterface::getAllPeople.
 
virtual int getNumberOfMen () const =0
 Returns the number of people in the array returned by PopulationStateInterface::getMen.
 
virtual int getNumberOfWomen () const =0
 Returns the number of people in the array returned by PopulationStateInterface::getWomen.
 
virtual int getNumberOfDeceasedPeople () const =0
 Returns the number of people in the array returned by PopulationStateInterface::getDeceasedPeople.
 
virtual void addNewPerson (PersonBase *pPerson)=0
 When a new person is introduced into the population, this function must be used to tell the simulation about this. More...
 
virtual void setPersonDied (PersonBase *pPerson)=0
 When a person has died, this function must be called to inform the simulation about this. More...
 
virtual void markAffectedPerson (PersonBase *pPerson) const =0
 This should only be called from within the PopulationEvent::markOtherAffectedPeople function, to indicate which other persons are also affected by the event (other than the persons mentioned in the event constructor.
 
void setExtraStateInfo (PopulationStateExtra *pExtra)
 This allows you to store additional information for a state that implements this PopulationStateInterface class, note that this is not automatically deleted in the destructor.
 
PopulationStateExtragetExtraStateInfo () const
 Retrieves the PopulationStateExtra instance that was stored using PopulationStateInterface::setExtraStateInfo.
 
- Public Member Functions inherited from State
double getTime () const
 Retrieve the current simulation time, which is stored by the Algorithm instance in use (note that until Algorithm::evolve is first called, the time has it's initial value of zero, may be important when starting the simulation from another time).
 
void setTime (double t)
 Set the simulation time, which is normally only done by the Algorithm in use (but may be necessary when starting the simulation from a time different than zero, see State::getTime).
 

Detailed Description

Interface for a simulation state for the population-based algorithm, specifying member functions that need to be implemented.

Member Function Documentation

◆ addNewPerson()

virtual void PopulationStateInterface::addNewPerson ( PersonBase pPerson)
pure virtual

When a new person is introduced into the population, this function must be used to tell the simulation about this.

In essence this function will make sure that the person appears in the arrays returned by PopulationStateInterface::getAllPeople, PopulationStateInterface::getMen and PopulationStateInterface::getWomen.

◆ setPersonDied()

virtual void PopulationStateInterface::setPersonDied ( PersonBase pPerson)
pure virtual

When a person has died, this function must be called to inform the simulation about this.

This function will set the time of death for the person and will remove the person from the arrays with living people (PopulationStateInterface::getAllPeople, PopulationStateInterface::getMen and PopulationStateInterface::getWomen).


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