libFAUDES

Sections

Index

faudes::HioModule Class Reference
[Hierarchical I/O Systems PlugIn]

#include <hio_module.h>

List of all members.


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.

Public Member Functions

 HioModule (void)
 constructror
 HioModule (const HioModule &rOtherHioModule)
 copy constructror
virtual ~HioModule (void)
 virtual destructor
void Clear ()
 Clear all mebers of the HioModule.
void Name (const std::string &rName)
 Set name of HioModule.
std::string Name () const
 Return name of HioModule.
void Index (const Idx Index)
 Set index of HioModule.
Idx Index () const
 Return index of HioModule.
void OpConstr (const HioConstraint &rOpConstr)
 Set Operator-Constraint of HioModule.
HioConstraint OpConstr () const
 Return Operator-Constraint of HioModule.
void Plant (const HioPlant &rHioPlant)
 Set HioPlant of HioModule.
HioPlant Plant () const
 Return HioPlant of HioModule.
void Controller (const HioController &rHioController)
 Set HioController of HioModule.
HioController Controller () const
 Return HioController of HioModule.
std::vector< HioModule * > Children () const
 Return Children of HioModule.
void Children (const std::vector< HioModule * > &rChildren)
 Set Children of HioModule.
void Environment (const HioEnvironment &rHioEnvironment)
 Set HioEnvironment of HioModule.
HioEnvironment Environment () const
 Return HioEnvironment of HioModule.
void EnvConstr (const HioConstraint &rEnvConstr)
 Set Environment-Constraint of HioModule.
HioConstraint EnvConstr () const
 Return Environment-Constraint of HioModule.
void InsChild (HioModule *rChild)
 Insert HioModule to list of children.
void Position (const int Xpos, const int Ypos)
 This is a function to set the x and y position of the HioModule.
void TypeHioModule (int type[5])
 This is a function to set the type of the HioModule; by type we mean an array of lenght 5 where each position has a specific semnification:.
void ReadHioPlant (const std::string path)
 This function reads the model from the given library and sets the following private variables of the HioModule.
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.
void AdjustGenerator (const Generator &rOldGen, const int i, Generator &rResGen)
 This function converts a generator by renaming all events from "CBx_..." to "CBi_...";.
void AdjustHioPlant (const HioPlant &rOldHioPlant, const int i, HioPlant &rResult)
 AdjustHioPlant(): convenience function (derived from AdjustGenerator())to allow also the conversion of HioPlants.
void AdjustAlphabet (const EventSet &rOldAlph, const int i, EventSet &rResAlph)
 Ahis 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!
void AdjustHioEnvironment (const HioEnvironment &rHioEnvX, const HioModule *rHioModule1, const HioModule *rHioModule2, HioEnvironment &rResEnv)
 AdjustEnvironmet(): In order to describe the interaction between two IO-Plants we use the IO-Environment.
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.
void RenameHioModule (const int i)
 this function renames all relevant member of the HioModule.
std::vector< std::string > ChooseSpec (const std::string path)
 chooseSpec: this function searches thru an apappropriate 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.
void Compute ()
 Compute: this function prepares the data required for HioSynth() function.
bool FindController ()
 FindController(): this function searches in the folder of a choosen specification for an already computed IO-controller which enforces this specification.
void SaveController ()
 Save: this function saves the computed controller in the same folder with the specification that this controller enforces.
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.
int Xpos () const
 function to call the x-Position of the HioModule
int Ypos () const
 function to call the y-Position of the HioModule
int * TypeHioModule () const
 function to call the Type of the HioModule
void EncodeType (const std::string type)
 function to encode to Type of the HioModule (function has only an informational character).

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

faudes::HioModule::HioModule ( void   ) 

constructror

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

copy constructror

virtual faudes::HioModule::~HioModule ( void   )  [inline, virtual]

virtual destructor


Member Function Documentation

void faudes::HioModule::Clear ( void   ) 

Clear all mebers of the HioModule.

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

Set name of HioModule.

Parameters:
rName Name to set

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

Return name of HioModule.

Returns:
Name of HioModule

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

Set index of HioModule.

Parameters:
Index Index to set

Idx faudes::HioModule::Index (  )  const

Return index of HioModule.

Returns:
Index of HioModule

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

Set Operator-Constraint of HioModule.

Parameters:
rOpConstr Operator-Constraint to set

HioConstraint faudes::HioModule::OpConstr (  )  const

Return Operator-Constraint of HioModule.

Returns:
Operator-Constraint of HioModule

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

Set HioPlant of HioModule.

Parameters:
rHioPlant HioPlant to set

HioPlant faudes::HioModule::Plant (  )  const

Return HioPlant of HioModule.

Returns:
HioPlant of HioModule

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

Set HioController of HioModule.

Parameters:
rHioController HioController to set

HioController faudes::HioModule::Controller (  )  const

Return HioController of HioModule.

Returns:
HioController of HioModule

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

Return Children of HioModule.

Returns:
Children of the HioModule

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

Set Children of HioModule.

Parameters:
rChildren vector of children to set

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

Set HioEnvironment of HioModule.

Parameters:
rHioEnvironment HioEnvironment to set

HioEnvironment faudes::HioModule::Environment (  )  const

Return HioEnvironment of HioModule.

Returns:
HioEnvironment of HioModule

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

Set Environment-Constraint of HioModule.

Parameters:
rEnvConstr Environment-Constraint to set

HioConstraint faudes::HioModule::EnvConstr (  )  const

Return Environment-Constraint of HioModule.

Returns:
Environment-Constraint of HioModule

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

Insert HioModule to list of children.

Parameters:
rChild Child HioModule to insert to list of children

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:
Xpos Position at the X-Axis of an x0y-System
Ypos Position at the Y-Axis of an x0y-System

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 lenght 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:
type type of the HioModule

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:
path string path indicating to the folder of the library to load; (required format: ../CBx/)
todo: for GUI load image

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:
path string path indicating to the folder of the library to load;

void faudes::HioModule::AdjustGenerator ( 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:
rOldGen generator to convert
i new parameter to replace x
rResGen Reference to the resulting converted generator (result)

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

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

Parameters:
rOldHioPlant HioPlant to convert
i new parameter to replace x
rResult Reference to the resulting converted HioPlant (result)

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

Ahis 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:
rOldAlph Alphabet to convert
i new parameter to replace x
rResAlph Reference to the resulting converted alphabet (result)

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

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

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

Parameters:
rHioEnvX the master copy generator of the environment model
rHioModule1 first HioModule
rHioModule2 second HioModule
rResEnv Reference to the resulting environment.

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:
rHioController the input controller to convert
HioModule1 pointer to first HioModule
HioModule2 pointer to second HioModule
rResCont Reference to resulting controller

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

this function renames all relevant member of the HioModule.

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

Parameters:
i the new Id of the HioModule

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

chooseSpec: this function searches thru an apappropriate 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:
path Path to the folder containing the specifications
Returns:
list of strings with available specificatinons

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.

bool faudes::HioModule::FindController (  ) 

FindController(): this function searches in the folder of a choosen 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 ajustController())

Returns:
true if a IO-Controller is available

void faudes::HioModule::SaveController (  ) 

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

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

int faudes::HioModule::Xpos (  )  const

function to call the x-Position of the HioModule

Returns:
x-Position of the HioModule

int faudes::HioModule::Ypos (  )  const

function to call the y-Position of the HioModule

Returns:
y-Position of the HioModule

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

function to call the Type of the HioModule

Returns:
array of lenght 5 decribing the type of the HioModule

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:
type the type to be encoded


Member Data Documentation

std::string faudes::HioModule::mName [private]

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

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

int faudes::HioModule::mXpos [private]

int faudes::HioModule::mYpos [private]


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

libFAUDES 2.13a c++ source docu by doxygen 1.5.6