Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdManager Class Reference

A class that manages the execution of a simulation. More...

#include <rdManager.h>

List of all members.

Public Member Functions

virtual ~rdManager ()
 Destructor.

 rdManager (rdModel *model, rdControlSet *aControlSet=NULL)
 Construct a simulation manager.

void setSessionName (const char *name)
 Set the session name of this rdManager instance.

const char * getSessionName () const
 Get the session name of this rdManager instance.

rdModelgetModel () const
 Get the model.

rdControlSetsetControlSet (rdControlSet *aControlSet)
 Set a control set for use during a dynamic simulation.

rdControlSetgetControlSet () const
 Get the control set.

rdIntegRKFgetIntegrator () const
 Get the integrator.

void setInitialTime (double aTI)
 Set the initial time of the simulation.

double getInitialTime () const
 Get the initial time of the simulation.

void setFinalTime (double aTF)
 Set the final time of the simulation.

double getFinalTime () const
 Get the final time of the simulation.

void setFirstDT (double aDT)
 Set the first time step taken in an integration.

double getFirstDT () const
 Get the first time step taken in an integration.

bool initializeStates ()
 Initialize the states for integration.

bool initializeStates (double *aY, double *aYP=NULL)
 Initialize the states for integration.

bool integrate ()
 Integrate the equations of motion for the specified model.

bool integrate (int startIndex)
 Integrate the equations of motion for the specified model starting at the states which are stored at the specified index.

bool integrate (double startTime)
 Integrate the equations of motion for the specified model starting at the states which occured at or just prior to aStartTime.

rdControlSetconstructControlSet ()
 Construct a control set for the model.


Private Member Functions

void setNull ()
 Set all member variables to their NULL values.

bool constructStates ()
 Construct the states.

bool constructIntegrator ()
 Construct the integrator.

bool constructStorage ()
 Construct the storage utility.


Private Attributes

char _sessionName [rdObject_NAME_LENGTH]
 Simulation session name.

rdModel_model
 Model for which the simulation is performed.

int _ny
 Number of states.

double * _y
 Array of states.

int _nyp
 Number of pseudostates.

double * _yp
 Array of pseudostates.

rdControlSet_controlSet
 Control set for the simulation.

rdControlSet_defaultControlSet
 Default control set for the simulation.

rdIntegRKF_integ
 Integrator.

double _ti
 Initial time of the simulation.

double _tf
 Final time of the simulation.

double _firstDT
 First dt in an integration.


Detailed Description

A class that manages the execution of a simulation.


Constructor & Destructor Documentation

rdManager::rdManager rdModel model,
rdControlSet aControlSet = NULL
 

Construct a simulation manager.

Parameters:
aModel Model used in the simulation.
aControlSet Control set used in the simulation.


Member Function Documentation

rdControlSet * rdManager::constructControlSet  ) 
 

Construct a control set for the model.

All the controls in the set are constructed as rdControlLinear controls.

rdControlSet * rdManager::getControlSet  )  const
 

Get the control set.

Returns:
Current control set. NULL is returned if a user-specified control set is not currently set.

double rdManager::getFinalTime  )  const
 

Get the final time of the simulation.

Returns:
Final time.

double rdManager::getFirstDT  )  const
 

Get the first time step taken in an integration.

Returns:
First integration time step.

double rdManager::getInitialTime  )  const
 

Get the initial time of the simulation.

Returns:
Initial time.

bool rdManager::initializeStates double *  aY,
double *  aYP = NULL
 

Initialize the states for integration.

This version sets the states to the specified states and pseudostates.

Parameters:
aY Specified states.
aYP Specified pseudostates.
Returns:
true when successful, false otherwise.

bool rdManager::initializeStates  ) 
 

Initialize the states for integration.

This version sets the states and pseudostates to the initial states and pseudostates of the model.

bool rdManager::integrate double  startTime  ) 
 

Integrate the equations of motion for the specified model starting at the states which occured at or just prior to aStartTime.

aStartTime is given in the normalized time units used by the manager and the integrator.

The starting states are obtained from storage. If there are no states in storage, the integration begins from the default initial states of the model. Otherwise, the integration starts from the states which are closest to aStartTime, but not after aStartTime.

Note that it is not guarranteed that the actual start time will be very close to the requested start time. How close the requested start time is to the actual start time dependes on the resolution of the stored states.

Parameters:
aStartTime Normalized time at which to begin the integration.
Returns:
true on successful integration, false otherwise.

Todo:
Check restarting integrations at the very last time step of a previous integration.

bool rdManager::integrate int  startIndex  ) 
 

Integrate the equations of motion for the specified model starting at the states which are stored at the specified index.

The starting states are obtained from storage. If there are no states in storage, the integration begins from the default initial states of the model. Otherwise, the integration starts from the closest posible index.

bool rdManager::integrate  ) 
 

Integrate the equations of motion for the specified model.

This method starts the integration at the initial default states of the model.

rdControlSet * rdManager::setControlSet rdControlSet aControlSet  ) 
 

Set a control set for use during a dynamic simulation.

Note that the simulation manager does not delete the control set; the caller is responsible for the memory management of the control set object. For this reason, a pointer to the previous user-specified control set is returned so that the caller can delete the previous user-specified control set if appropriate.

Parameters:
aControlSet New control set for the simulation.
Returns:
Previous user-specified control set; NULL is there was no user-specified control set.

void rdManager::setFinalTime double  aTF  ) 
 

Set the final time of the simulation.

Parameters:
aTF Final time.

void rdManager::setFirstDT double  aDT  ) 
 

Set the first time step taken in an integration.

Parameters:
aDT First integration time step.

void rdManager::setInitialTime double  aTI  ) 
 

Set the initial time of the simulation.

Parameters:
aTI Initial time.


Member Data Documentation

rdControlSet* rdManager::_defaultControlSet [private]
 

Default control set for the simulation.

This control set is used in the event the user specified control set is invalid for some reason.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:11 2003 for Simulation Software by doxygen1.3