Detailed Description

Recurring structure in hierarchies designed according to the I/O based DES framework.

The HioModule class is a composite pattern providing access to the components of a I/O-controller synthesis problem for a composite I/O-plant:

  • Operator-constraint: describes liveness properties of I/O-plant, together with environment-constraint
  • Plant: abstraction and at the same time specification of the external closed-loop behaviour of the HioModule.
  • Controller enforcing the desired behaviour
  • children-vector of (pointers to) subordinate HioModules
  • Environment
  • Environment-constraint: describes liveness properties of I/O-plant, together with operator-constraint

The plants of the subordinate HioModules and the environment form the uncontrolled behaviour of the HioModule.

Definition at line 41 of file hio_module.h.

#include <hio_module.h>

Public Member Functions

 HioModule (void)
 constructor More...
 
 HioModule (const HioModule &rOtherHioModule)
 copy constructor More...
 
virtual ~HioModule (void)
 virtual destructor More...
 
void Clear ()
 Clear all members of the HioModule. More...
 
void Name (const std::string &rName)
 Set name of HioModule. More...
 
std::string Name () const
 Return name of HioModule. More...
 
void Index (const Idx Index)
 Set index of HioModule. More...
 
Idx Index () const
 Return index of HioModule. More...
 
void OpConstr (const HioConstraint &rOpConstr)
 Set Operator-Constraint of HioModule. More...
 
HioConstraint OpConstr () const
 Return Operator-Constraint of HioModule. More...
 
void Plant (const HioPlant &rHioPlant)
 Set HioPlant of HioModule. More...
 
HioPlant Plant () const
 Return HioPlant of HioModule. More...
 
void Controller (const HioController &rHioController)
 Set HioController of HioModule. More...
 
HioController Controller () const
 Return HioController of HioModule. More...
 
std::vector< HioModule * > Children () const
 Return Children of HioModule. More...
 
void Children (const std::vector< HioModule * > &rChildren)
 Set Children of HioModule. More...
 
void Environment (const HioEnvironment &rHioEnvironment)
 Set HioEnvironment of HioModule. More...
 
HioEnvironment Environment () const
 Return HioEnvironment of HioModule. More...
 
void EnvConstr (const HioConstraint &rEnvConstr)
 Set Environment-Constraint of HioModule. More...
 
HioConstraint EnvConstr () const
 Return Environment-Constraint of HioModule. More...
 
void InsChild (HioModule *rChild)
 Insert HioModule to list of children. More...
 
void Position (const int Xpos, const int Ypos)
 This is a function to set the x and y position of the HioModule. More...
 
void TypeHioModule (int type[5])
 This is a function to set the type of the HioModule; by type we mean an array of length 5 where each position has a specific semnification: More...
 
void ReadHioPlant (const std::string path)
 This function reads the model from the given library and sets the following private variables of the HioModule. More...
 
void ReadHioEnv (const std::string path)
 This function reads the model describing the interaction of IO-Plants with the environment and sets the private variable mIOEnvironment. More...
 
void AdjusTimedGenerator (const Generator &rOldGen, const int i, Generator &rResGen)
 This function converts a generator by renaming all events from "CBx_..." to "CBi_...";. More...
 
void AdjustHioPlant (const HioPlant &rOldHioPlant, const int i, HioPlant &rResult)
 AdjustHioPlant(): convenience function (derived from AdjusTimedGenerator())to allow also the conversion of HioPlants. More...
 
void AdjustAlphabet (const EventSet &rOldAlph, const int i, EventSet &rResAlph)
 This function converts an alphabet by renaming all events from "CBx_..." to "CBi_..."; as a standard all events used in this plugin have the following name format: "CBx_..."; Warning: This function does not preserves the attributes of the events! More...
 
void AdjustHioEnvironment (const HioEnvironment &rHioEnvX, const HioModule *rHioModule1, const HioModule *rHioModule2, HioEnvironment &rResEnv)
 AdjustEnvironment(): In order to describe the interaction between two IO-Plants we use the IO-Environment. More...
 
void AdjustHioController (const HioController &rHioController, const HioModule *HioModule1, const HioModule *HioModule2, HioController &rResCont)
 AdjustHioController: convenience function derived from AdjustHioEnvironment() in order to adjust an IOController to any two IO-Plants which must enforce a well-defined specification. More...
 
void RenameHioModule (const int i)
 this function renames all relevant member of the HioModule. More...
 
std::vector< std::string > ChooseSpec (const std::string path)
 chooseSpec: this function searches through an appropriate folder (based on the maximal capacity resulting from the ChildList) for available specifications and allows the user to choose one of the found specifications; After the user has chosen a specification, this function sets the IO-Plant, the constraints and the alphabets of the actual HioModule. More...
 
void Compute ()
 Compute: this function prepares the data required for HioSynth() function. More...
 
bool FindController ()
 FindController(): this function searches in the folder of a chosen specification for an already computed IO-controller which enforces this specification. More...
 
void SaveController ()
 Save: this function saves the computed controller in the same folder with the specification that this controller enforces. More...
 
std::string MyPath ()
 MyPath(): based on the type of the HioModule, this is a convenience function to establish the local path where to Write/Read from. More...
 
int Xpos () const
 function to call the x-Position of the HioModule More...
 
int Ypos () const
 function to call the y-Position of the HioModule More...
 
int * TypeHioModule () const
 function to call the Type of the HioModule More...
 
void EncodeType (const std::string type)
 function to encode to Type of the HioModule (function has only an informational character). More...
 

Private Attributes

std::string mName
 
Idx mIndex
 
HioConstraint mOpConstr
 
HioPlant mPlant
 
HioController mController
 
std::vector< HioModule * > mChildren
 
HioEnvironment mEnvironment
 
HioConstraint mEnvConstr
 
int mType [5]
 
int mXpos
 
int mYpos
 

Constructor & Destructor Documentation

◆ HioModule() [1/2]

faudes::HioModule::HioModule ( void  )

constructor

Definition at line 16 of file hio_module.cpp.

◆ HioModule() [2/2]

faudes::HioModule::HioModule ( const HioModule rOtherHioModule)

copy constructor

Definition at line 21 of file hio_module.cpp.

◆ ~HioModule()

virtual faudes::HioModule::~HioModule ( void  )
inlinevirtual

virtual destructor

Definition at line 59 of file hio_module.h.

Member Function Documentation

◆ AdjustAlphabet()

void faudes::HioModule::AdjustAlphabet ( const EventSet rOldAlph,
const int  i,
EventSet rResAlph 
)

This function converts an alphabet by renaming all events from "CBx_..." to "CBi_..."; as a standard all events used in this plugin have the following name format: "CBx_..."; Warning: This function does not preserves the attributes of the events!

Parameters
rOldAlphAlphabet to convert
inew parameter to replace x
rResAlphReference to the resulting converted alphabet (result)

Definition at line 374 of file hio_module.cpp.

◆ AdjustHioController()

void faudes::HioModule::AdjustHioController ( const HioController rHioController,
const HioModule HioModule1,
const HioModule HioModule2,
HioController rResCont 
)

AdjustHioController: convenience function derived from AdjustHioEnvironment() in order to adjust an IOController to any two IO-Plants which must enforce a well-defined specification.

Parameters
rHioControllerthe input controller to convert
HioModule1pointer to first HioModule
HioModule2pointer to second HioModule
rResContReference to resulting controller

◆ AdjustHioEnvironment()

void faudes::HioModule::AdjustHioEnvironment ( const HioEnvironment rHioEnvX,
const HioModule rHioModule1,
const HioModule rHioModule2,
HioEnvironment rResEnv 
)

AdjustEnvironment(): In order to describe the interaction between two IO-Plants we use the IO-Environment.

This function adjusts the master copy (IOEnvironmentX) to the two IO-Plants. The position of the plants to each other must be set.

Parameters
rHioEnvXthe master copy generator of the environment model
rHioModule1first HioModule
rHioModule2second HioModule
rResEnvReference to the resulting environment.

Definition at line 413 of file hio_module.cpp.

◆ AdjustHioPlant()

void faudes::HioModule::AdjustHioPlant ( const HioPlant rOldHioPlant,
const int  i,
HioPlant rResult 
)

AdjustHioPlant(): convenience function (derived from AdjusTimedGenerator())to allow also the conversion of HioPlants.

Parameters
rOldHioPlantHioPlant to convert
inew parameter to replace x
rResultReference to the resulting converted HioPlant (result)

Definition at line 288 of file hio_module.cpp.

◆ AdjusTimedGenerator()

void faudes::HioModule::AdjusTimedGenerator ( const Generator rOldGen,
const int  i,
Generator rResGen 
)

This function converts a generator by renaming all events from "CBx_..." to "CBi_...";.

all properties of the input generator are inherited by the output generator; as a standard all events used in this plugin have the following name format: "CBx_..."

Parameters
rOldGengenerator to convert
inew parameter to replace x
rResGenReference to the resulting converted generator (result)

Definition at line 220 of file hio_module.cpp.

◆ Children() [1/2]

std::vector< HioModule * > faudes::HioModule::Children ( ) const

Return Children of HioModule.

Returns
Children of the HioModule

Definition at line 106 of file hio_module.cpp.

◆ Children() [2/2]

void faudes::HioModule::Children ( const std::vector< HioModule * > &  rChildren)

Set Children of HioModule.

Parameters
rChildrenvector of children to set

Definition at line 101 of file hio_module.cpp.

◆ ChooseSpec()

std::vector< std::string > faudes::HioModule::ChooseSpec ( const std::string  path)

chooseSpec: this function searches through an appropriate folder (based on the maximal capacity resulting from the ChildList) for available specifications and allows the user to choose one of the found specifications; After the user has chosen a specification, this function sets the IO-Plant, the constraints and the alphabets of the actual HioModule.

The path must have the following format: "../Spec/"

Warning: The computation of the IO-Controller is not triggered by this function, it must be started separately!

Parameters
pathPath to the folder containing the specifications
Returns
list of strings with available specifications

Definition at line 807 of file hio_module.cpp.

◆ Clear()

void faudes::HioModule::Clear ( void  )

Clear all members of the HioModule.

Definition at line 35 of file hio_module.cpp.

◆ Compute()

void faudes::HioModule::Compute ( )

Compute: this function prepares the data required for HioSynth() function.

If all data is available, HioSynth() is called and the resulting generator is the IOController for the given specification.

Definition at line 880 of file hio_module.cpp.

◆ Controller() [1/2]

HioController faudes::HioModule::Controller ( ) const

Return HioController of HioModule.

Returns
HioController of HioModule

Definition at line 96 of file hio_module.cpp.

◆ Controller() [2/2]

void faudes::HioModule::Controller ( const HioController rHioController)

Set HioController of HioModule.

Parameters
rHioControllerHioController to set

Definition at line 91 of file hio_module.cpp.

◆ EncodeType()

void faudes::HioModule::EncodeType ( const std::string  type)

function to encode to Type of the HioModule (function has only an informational character).

*************** Interpretation of mType[] *******
************* Capacity:        mType[0] *********
************* Take from left:  mType[1] *********
************* Take from right: mType[2] *********
************* Deliver to left: mType[3] *********
************* Deliver to left: mType[4] *********
*************************************************
Parameters
typethe type to be encoded

Definition at line 1079 of file hio_module.cpp.

◆ EnvConstr() [1/2]

HioConstraint faudes::HioModule::EnvConstr ( ) const

Return Environment-Constraint of HioModule.

Returns
Environment-Constraint of HioModule

Definition at line 127 of file hio_module.cpp.

◆ EnvConstr() [2/2]

void faudes::HioModule::EnvConstr ( const HioConstraint rEnvConstr)

Set Environment-Constraint of HioModule.

Parameters
rEnvConstrEnvironment-Constraint to set

Definition at line 121 of file hio_module.cpp.

◆ Environment() [1/2]

HioEnvironment faudes::HioModule::Environment ( ) const

Return HioEnvironment of HioModule.

Returns
HioEnvironment of HioModule

Definition at line 116 of file hio_module.cpp.

◆ Environment() [2/2]

void faudes::HioModule::Environment ( const HioEnvironment rHioEnvironment)

Set HioEnvironment of HioModule.

Parameters
rHioEnvironmentHioEnvironment to set

Definition at line 111 of file hio_module.cpp.

◆ FindController()

bool faudes::HioModule::FindController ( )

FindController(): this function searches in the folder of a chosen specification for an already computed IO-controller which enforces this specification.

Furthermore must the IO-controller only be adjusted to the IO-Modules that we need to control. (to adjust call adjustController())

Returns
true if a IO-Controller is available

Definition at line 990 of file hio_module.cpp.

◆ Index() [1/2]

Idx faudes::HioModule::Index ( ) const

Return index of HioModule.

Returns
Index of HioModule

Definition at line 61 of file hio_module.cpp.

◆ Index() [2/2]

void faudes::HioModule::Index ( const Idx  Index)

Set index of HioModule.

Parameters
IndexIndex to set

Definition at line 66 of file hio_module.cpp.

◆ InsChild()

void faudes::HioModule::InsChild ( HioModule rChild)

Insert HioModule to list of children.

Parameters
rChildChild HioModule to insert to list of children

Definition at line 132 of file hio_module.cpp.

◆ MyPath()

std::string faudes::HioModule::MyPath ( )

MyPath(): based on the type of the HioModule, this is a convenience function to establish the local path where to Write/Read from.

(This function is used up to now only by FindController() and SaveController())

Returns
string: path to the actual IO-Module

Definition at line 1024 of file hio_module.cpp.

◆ Name() [1/2]

std::string faudes::HioModule::Name ( void  ) const

Return name of HioModule.

Returns
Name of HioModule

Definition at line 51 of file hio_module.cpp.

◆ Name() [2/2]

void faudes::HioModule::Name ( const std::string &  rName)

Set name of HioModule.

Parameters
rNameName to set

Definition at line 56 of file hio_module.cpp.

◆ OpConstr() [1/2]

HioConstraint faudes::HioModule::OpConstr ( ) const

Return Operator-Constraint of HioModule.

Returns
Operator-Constraint of HioModule

Definition at line 76 of file hio_module.cpp.

◆ OpConstr() [2/2]

void faudes::HioModule::OpConstr ( const HioConstraint rOpConstr)

Set Operator-Constraint of HioModule.

Parameters
rOpConstrOperator-Constraint to set

Definition at line 71 of file hio_module.cpp.

◆ Plant() [1/2]

HioPlant faudes::HioModule::Plant ( ) const

Return HioPlant of HioModule.

Returns
HioPlant of HioModule

Definition at line 86 of file hio_module.cpp.

◆ Plant() [2/2]

void faudes::HioModule::Plant ( const HioPlant rHioPlant)

Set HioPlant of HioModule.

Parameters
rHioPlantHioPlant to set

Definition at line 81 of file hio_module.cpp.

◆ Position()

void faudes::HioModule::Position ( const int  Xpos,
const int  Ypos 
)

This is a function to set the x and y position of the HioModule.

Parameters
XposPosition at the X-Axis of an x0y-System
YposPosition at the Y-Axis of an x0y-System

Definition at line 141 of file hio_module.cpp.

◆ ReadHioEnv()

void faudes::HioModule::ReadHioEnv ( const std::string  path)

This function reads the model describing the interaction of IO-Plants with the environment and sets the private variable mIOEnvironment.

As a next logical step this generator must be adapted to the IO-Plants that interact with each other.

Parameters
pathstring path indicating to the folder of the library to load;

Definition at line 210 of file hio_module.cpp.

◆ ReadHioPlant()

void faudes::HioModule::ReadHioPlant ( const std::string  path)

This function reads the model from the given library and sets the following private variables of the HioModule.

The library must contain the following files:

 plantCBx.gen - IO-Plant model of the simulated work unit (to set mIOPlant);
 constrP_CBx.gen - Operator constraints of the IO Plant model (if the
                   model doesn't require any operator constraints at
                   least an empty generator must be available) (mLcConstr)
 constrE_CBx.gen - Environment constraints of the IO Plant model (at
                   least an empty generator must be available) (mLeConstr)

for GUI purpose: symbolic picture of the work unit in *.png format

The file names must be given as described above, and the events respect the following format: "CBx_..." (e.g.: CBx_rdy, CBx_full, CBx_stby,...)

Parameters
pathstring path indicating to the folder of the library to load; (required format: ../CBx/)

todo: for GUI load image

Definition at line 158 of file hio_module.cpp.

◆ RenameHioModule()

void faudes::HioModule::RenameHioModule ( const int  i)

this function renames all relevant member of the HioModule.

These are: mHioPlant, mLcConstr, mLeConstr, mHioEnvironment, mHioController, mName

Parameters
ithe new Id of the HioModule

Definition at line 771 of file hio_module.cpp.

◆ SaveController()

void faudes::HioModule::SaveController ( )

Save: this function saves the computed controller in the same folder with the specification that this controller enforces.

Definition at line 1012 of file hio_module.cpp.

◆ TypeHioModule() [1/2]

int * faudes::HioModule::TypeHioModule ( ) const

function to call the Type of the HioModule

Returns
array of length 5 describing the type of the HioModule

Definition at line 1068 of file hio_module.cpp.

◆ TypeHioModule() [2/2]

void faudes::HioModule::TypeHioModule ( int  type[5])

This is a function to set the type of the HioModule; by type we mean an array of length 5 where each position has a specific semnification:

*************** Interpretation of mType[] *******
************* Capacity:        mType[0] *********
************* Take from left:  mType[1] *********
************* Take from right: mType[2] *********
************* Deliver to left: mType[3] *********
************* Deliver to left: mType[4] *********
*************************************************
Parameters
typetype of the HioModule

Definition at line 148 of file hio_module.cpp.

◆ Xpos()

int faudes::HioModule::Xpos ( ) const

function to call the x-Position of the HioModule

Returns
x-Position of the HioModule

Definition at line 1055 of file hio_module.cpp.

◆ Ypos()

int faudes::HioModule::Ypos ( ) const

function to call the y-Position of the HioModule

Returns
y-Position of the HioModule

Definition at line 1062 of file hio_module.cpp.

Member Data Documentation

◆ mChildren

std::vector<HioModule*> faudes::HioModule::mChildren
private

Definition at line 512 of file hio_module.h.

◆ mController

HioController faudes::HioModule::mController
private

Definition at line 509 of file hio_module.h.

◆ mEnvConstr

HioConstraint faudes::HioModule::mEnvConstr
private

Definition at line 518 of file hio_module.h.

◆ mEnvironment

HioEnvironment faudes::HioModule::mEnvironment
private

Definition at line 515 of file hio_module.h.

◆ mIndex

Idx faudes::HioModule::mIndex
private

Definition at line 500 of file hio_module.h.

◆ mName

std::string faudes::HioModule::mName
private

Definition at line 497 of file hio_module.h.

◆ mOpConstr

HioConstraint faudes::HioModule::mOpConstr
private

Definition at line 503 of file hio_module.h.

◆ mPlant

HioPlant faudes::HioModule::mPlant
private

Definition at line 506 of file hio_module.h.

◆ mType

int faudes::HioModule::mType[5]
private

Definition at line 525 of file hio_module.h.

◆ mXpos

int faudes::HioModule::mXpos
private

Definition at line 529 of file hio_module.h.

◆ mYpos

int faudes::HioModule::mYpos
private

Definition at line 530 of file hio_module.h.


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

libFAUDES 2.32f --- 2024.12.22 --- c++ api documentaion by doxygen