SimulationChain
 All Classes Functions Variables Pages
ISISO Interface Referenceabstract

#include <ISISO.h>

Inheritance diagram for ISISO:

Public Member Functions

virtual double Simulate (double)=0
 Outputs one step of the simualtion given one sample of the input. More...
 
virtual void GetOutputHistory (std::vector< double > &) const =0
 Outputs all output samples recorded by far.
 
virtual void EraseOutputHistory ()=0
 Deletes all recorded samples of output.
 
virtual void SetOutputHistory (std::vector< double > &)=0
 Set output history.
 
virtual void SetInputHistory (std::vector< double > &)=0
 Set input history.
 
virtual void SaveState (boost::property_tree::ptree &) const =0
 Adds internal object state data to the stream object.
 
virtual void LoadState (boost::property_tree::ptree::value_type const &)=0
 Load internal object state data from tree. Each object manages the data itself.
 
virtual void SetID (int)=0
 Enables user to set an ID of the object. User must ensure that the name is unique.
 
virtual int GetID () const =0
 Fetches object's ID. More...
 
virtual void SetName (std::string &)=0
 Registers a name with the object. User must ensure that the name is unique.
 
virtual const std::string & GetName () const =0
 Fetches object's name. More...
 
virtual void GetName (boost::property_tree::ptree &) const =0
 Builds a tree containing names and types of all children nodes.
 
virtual void SetParent (ISISO *)=0
 Sets object's parent. There can be only one parent of the same object.
 
virtual ISISOGetParent ()=0
 Fetches object's parent pointer. More...
 
virtual void AddChild (std::shared_ptr< ISISO >)=0
 Allows adding children to the object.
 
virtual void RemoveChild (std::shared_ptr< ISISO >)=0
 Removes a child of the object.
 
virtual void GetChildren (std::list< std::weak_ptr< ISISO > > &) const =0
 Fetches the list of object's children.
 
virtual bool RemoveObject (int)=0
 Allows to remove the object. Function searches all the children of the object. More...
 
virtual ISISOSearchObject (const std::string &)=0
 Searches all the children of the object to find object with the specified name. More...
 
virtual ISISOFindFirstRegulator ()=0
 Searches the tree for the first regulator object. Implements BFS algorithm. More...
 
virtual ObjType GetType () const =0
 Retrive object functional type. More...
 
virtual void SetType (ObjType)=0
 Set object functional type.
 
virtual void SetStreamForOutput (std::shared_ptr< std::ostream >)=0
 Set the output stream for object output values.
 
virtual void SetVariableToStoreCurrentOutput (std::weak_ptr< double >)=0
 Set the variable to store the current output value.
 
virtual void SetVariableToStoreCurrentInput (std::weak_ptr< double >)=0
 Set the variable to store the current input value.
 
virtual void RemoveStreamForOutput ()=0
 Disable the output stream for objects input values.
 
virtual bool MoveObjectToFront (ISISO *FrontObject)=0
 Move object to the front so it can be run first.
 
virtual void ResetMemory ()=0
 Resets objects memory (reset generators if present).
 

Detailed Description

Intefrace to be used in the simulation loop. Part of the composite design pattern.

Main features:
  • simulate method with one input and one output,
  • saving and loading state - serialization,
  • enables recording both input and output of every object into i/o stream,
  • can be used to create a self-organising tree,
  • automatic parent/children relation handling, with only one parent and many children,
  • deallocating children of the destroyed node based on smart pointers,
  • searching objects using BFS or DFS algorithm.

Member Function Documentation

virtual ISISO* ISISO::FindFirstRegulator ( )
pure virtual

Searches the tree for the first regulator object. Implements BFS algorithm.

Returns
Return pointer to first found regulator.

Implemented in CSimNode.

Here is the caller graph for this function:

virtual int ISISO::GetID ( ) const
pure virtual

Fetches object's ID.

Returns
ID of the object.

Implemented in CSimNode.

virtual const std::string& ISISO::GetName ( ) const
pure virtual

Fetches object's name.

Returns
Reference to the objects name.

Implemented in CSimNode.

Here is the caller graph for this function:

virtual ISISO* ISISO::GetParent ( )
pure virtual

Fetches object's parent pointer.

Returns
Pointer to the parent.

Implemented in CSimNode.

virtual ObjType ISISO::GetType ( ) const
pure virtual

Retrive object functional type.

Returns
Returns type of the object.

Implemented in CSimNode.

virtual bool ISISO::RemoveObject ( int  )
pure virtual

Allows to remove the object. Function searches all the children of the object.

Returns
True if object successfuly removed.

Implemented in CSimNode.

virtual ISISO* ISISO::SearchObject ( const std::string &  )
pure virtual

Searches all the children of the object to find object with the specified name.

Returns
Pointer to found object or nullptr.

Implemented in CSimNode, and CRegulator.

Here is the caller graph for this function:

virtual double ISISO::Simulate ( double  )
pure virtual

Outputs one step of the simualtion given one sample of the input.

Returns
Next simulation output.

Implemented in CSimNode, CSimObject, CRegulator, CGPC, CPIDRegulator, and CPRegulator.


The documentation for this interface was generated from the following files: