Acoustic Research Tool (ART)  v0.10
ARTtimeSimulator Class Reference

Implementation of a simulator in the time domain.

Inheritance diagram for ARTtimeSimulator:
ARTsimulator ARTobject ARTcell

Public Member Functions

 ARTtimeSimulator (const string name, const string sds="", const string lds="", const string htm="")
 Creates a new Simulator object.
virtual void AddTimeModule (ARTItimeModule *timeModule)
 Adds a time module to the current simulation.
virtual void AddSimulationParameter (const string &name, const string &expr)
 Adds a global parameter to the current simulator.
virtual void AddSimulationParameter (const string &name, const std::complex< double > &val)
 Adds a global parameter to the current simulator.
virtual void AddSimulationParameter (const string &name, double val)
 Adds a global parameter to the current simulator.
virtual void SimulateTimeStep (int idx)
 Simulates the time step of the given index.
virtual void SetSimulationParameter (const string &name, const string &expr)
 Sets the value of a global parameter of the current simulator.
virtual void SetSimulationParameter (const string &name, const std::complex< double > &val)
 Sets the value of a global parameter of the current simulator.
virtual void SetSimulationParameter (const string &name, double val)
 Sets the value of a global parameter of the current simulator.
virtual ARTdataPropFindDataPropInSimulator (string exp)
 Returns a data property with the specified name if it is saved in the current simulator.
virtual ARTItimeModuleFindTimeModuleInSimulator (string exp)
 Returns a time module with the given name if it is part of the current simulator.
virtual ~ARTtimeSimulator ()
 Destructor of the ARTtimeSimulator class.
- Public Member Functions inherited from ARTsimulator
 ARTsimulator (const string name, const string domain="invalidDomain", const string sds="", const string lds="", const string htm="")
 Creates a new Simulator object.
virtual ARTpropertyGetDomain ()
 Returns the current domain of the simulator.
virtual ParserX * GetParser ()
 Returns the global parser object of the simulator.
virtual ~ARTsimulator ()
 The destructor of the simulator class is doing nothing as all saved properties will be deallocated by the destructor of the ARTObject class.
- Public Member Functions inherited from ARTobject
 ARTobject (const string name, const string sds="", const string lds="", const string htm="")
 objects must have a name, the rest is optional
 ARTobject (const ARTobject &orig)
 copy constructor
virtual ARTcellclone ()
ARTpropertyGetProperties (ARTproperty *pos)
 iterate through property list (pass NULL to restart iteration, receive NULL after last element)
ARTpropertyFindProperty (const string nam)
 find and return named property (or return NULL if no match)
ARTpropertyAppendProperty (const string name, const string sds="", const string lds="", const string htm="")
 Append new property with given name to ARTobject.
ARTdataPropAppendDataProp (const string name, ARTvariant *val, const string sds="", const string lds="", const string htm="")
 append new data property with given name to ARTobject
ARTdataPropAppendDataProp (const string name, const double val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const float val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const int val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (const string name, const string *val, const string sds="", const string lds="", const string htm="")
ARTdataPropAppendDataProp (ARTdataProp *dataProp)
ARTlistPropAppendListProp (const string name, const string sds="", const string lds="", const string htm="")
 append new listableProperty with given name
bool DeleteProperty (ARTproperty *prp)
 delete current property (which was recently accessed by GetProperties, FindProperty or AppendProperty)
ARTmethodGetMethods (ARTmethod *pos)
 iterate through method list (pass NULL to restart iteration, receive NULL after last element)
ARTmethodFindMethod (const string nam)
 find and return named method (or return NULL if no match)
ARTmethodAppendMethod (const string name, const string sds="", const string lds="", const string htm="")
 append new method with given name
bool DeleteMethod (ARTmethod *mtd)
 delete current method (which was recently accessed by GetProperties, FindProperty or AppendProperty)
void SetPropertyList (list< ARTproperty * > &l)
void CopyPropertyListEntries (ARTobject *obj)
 copies properties from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
void CopyMethodListEntries (ARTobject *obj)
 copies methods from other objects (also copying the objects of all list-entries). OVERWRITES list own list!
list< ARTproperty * > GetPropertyList ()
list< ARTmethod * > GetMethodList ()
- Public Member Functions inherited from ARTcell
 ARTcell (const string name="", const string sds="", const string lds="", const string htm="")
 ARTcell (const ARTcell &orig)
const string & GetName () const
const string & GetShortDescription () const
const string & GetLongDescription () const
const string & GetHelpFilename () const
void SetName (const string name)

Protected Member Functions

virtual void initStandardSimulParams ()
 Adds the default global parameters (sampling frequency "T" and global time "t") to the current simulator.
virtual void clean ()
 Deallocates all previously allocated objects.
virtual void addParamsToModule (ARTItimeModule *timeModule)
 Adds all global parameters to the given time module.
virtual void addParamToCurrentModules (ARTdataProp *newParam)
 Adds a new global parameter to all currently registered time modules.

Additional Inherited Members

- Public Attributes inherited from ARTsimulator
ARTlistPropuserElements
 Pointer to the user elements of the simulator, mainly used by the frequency Simulator.
ARTlistPropcircuits
 Pointer to all internal circuits, mainly used by the frequency Simulator.
- Protected Attributes inherited from ARTsimulator
ARTproperty domain_
 Defines the domain type (frequency or time) of the current simulator.
ParserX * parser_
 A parser object which can be used for assignment calculations of global simulation parameters.

Constructor & Destructor Documentation

ARTtimeSimulator::ARTtimeSimulator ( const string  name,
const string  sds = "",
const string  lds = "",
const string  htm = "" 
)

Creates a new Simulator object.

Parameters
[in]nameDefines the unique identifier of the simulator.
[in]sdsShort description (single line) of the created simulator.
[in]ldsLong description of the created simulator.
[in]htmPath to help file in HTML format.

Member Function Documentation

void ARTtimeSimulator::addParamsToModule ( ARTItimeModule timeModule)
protectedvirtual

Adds all global parameters to the given time module.

Parameters
[in]timeModuleTime module to which the parameters will be added.
void ARTtimeSimulator::addParamToCurrentModules ( ARTdataProp newParam)
protectedvirtual

Adds a new global parameter to all currently registered time modules.

Parameters
[in]newParamThe new global parameter which will be registered to all current time modules.
void ARTtimeSimulator::AddSimulationParameter ( const string &  name,
const string &  expr 
)
virtual

Adds a global parameter to the current simulator.

Parameters
[in]nameA unique identifier for the simulation parameter.
[in]exprA calculation expression for the paramenter.
Exceptions
ARTerrorIf a parameter with the same name is already part of the current simulator.
void ARTtimeSimulator::AddSimulationParameter ( const string &  name,
const std::complex< double > &  val 
)
virtual

Adds a global parameter to the current simulator.

Parameters
[in]nameA unique identifier for the simulation parameter.
[in]valA complex number to initialize the parameter.
Exceptions
ARTerrorIf a parameter with the same name is already part of the current simulator.
void ARTtimeSimulator::AddSimulationParameter ( const string &  name,
double  val 
)
virtual

Adds a global parameter to the current simulator.

Parameters
[in]nameA unique identifier for the simulation parameter.
[in]valA real number to initialize the parameter.
Exceptions
ARTerrorIf a parameter with the same name is already part of the current simulator.
void ARTtimeSimulator::AddTimeModule ( ARTItimeModule timeModule)
virtual

Adds a time module to the current simulation.

Exceptions
ARTerrorIf a module with the same name is already part of the current simulator.
void ARTtimeSimulator::clean ( )
protectedvirtual

Deallocates all previously allocated objects.

Currently not used.

ARTdataProp * ARTtimeSimulator::FindDataPropInSimulator ( string  exp)
virtual

Returns a data property with the specified name if it is saved in the current simulator.

Finds the data property represented by the string exp; This can be a data property of an element or model in the simulator (then the string is something like "Cyl.length") or a data property of the simulator itself.

Parameters
[in]expThe name/identifier of the property. May contain a dot '.' in order to access hierarchical properties, e.g., "foo.bar".
Exceptions
ARTerrorIn case the specified property could not be found in the current simulator.

Reimplemented from ARTsimulator.

ARTItimeModule * ARTtimeSimulator::FindTimeModuleInSimulator ( string  exp)
virtual

Returns a time module with the given name if it is part of the current simulator.

Parameters
[in]expName of the time module to find.
Exceptions
ARTerrorIf no time valid module with the given name could be found.
void ARTtimeSimulator::initStandardSimulParams ( )
protectedvirtual

Adds the default global parameters (sampling frequency "T" and global time "t") to the current simulator.

Will be called by the class constructor.

void ARTtimeSimulator::SetSimulationParameter ( const string &  name,
const string &  expr 
)
virtual

Sets the value of a global parameter of the current simulator.

Parameters
[in]nameThe unique identifier of the global parameter.
[in]exprA calculation expression for the parameter.
Exceptions
ARTerrorIf no parameter with the specified name could be found in the current simulator.
void ARTtimeSimulator::SetSimulationParameter ( const string &  name,
const std::complex< double > &  val 
)
virtual

Sets the value of a global parameter of the current simulator.

Parameters
[in]nameThe unique identifier of the global parameter.
[in]valThe complex value to set the parameter.
Exceptions
ARTerrorIf no parameter with the specified name could be found in the current simulator.
void ARTtimeSimulator::SetSimulationParameter ( const string &  name,
double  val 
)
virtual

Sets the value of a global parameter of the current simulator.

Parameters
[in]nameThe unique identifier of the global parameter.
[in]valThe real value to set the parameter.
Exceptions
ARTerrorIf no parameter with the specified name could be found in the current simulator.
void ARTtimeSimulator::SimulateTimeStep ( int  idx)
virtual

Simulates the time step of the given index.

Parameters
[in]idxThe index to simulate.
Exceptions
ARTerrorIf no global parameter "t" could be found in the current simulator.