faudes::HioModule Class Reference
|
Public Member Functions | |
HioModule (void) | |
constructor | |
HioModule (const HioModule &rOtherHioModule) | |
copy constructor | |
virtual | ~HioModule (void) |
virtual destructor | |
void | Clear () |
Clear all members 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 length 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 | AdjusTimedGenerator (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 AdjusTimedGenerator())to allow also the conversion of HioPlants. | |
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! | |
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. | |
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 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. | |
void | Compute () |
Compute: this function prepares the data required for HioSynth() function. | |
bool | FindController () |
FindController(): this function searches in the folder of a chosen 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 |
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:
The plants of the subordinate HioModules and the environment form the uncontrolled behaviour of the HioModule.
Definition at line 42 of file hio_module.h.
faudes::HioModule::HioModule | ( | void | ) |
constructor
Definition at line 15 of file hio_module.cpp.
faudes::HioModule::HioModule | ( | const HioModule & | rOtherHioModule | ) |
copy constructor
Definition at line 20 of file hio_module.cpp.
virtual faudes::HioModule::~HioModule | ( | void | ) | [inline, virtual] |
virtual destructor
Definition at line 60 of file hio_module.h.
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!
rOldAlph | Alphabet to convert | |
i | new parameter to replace x | |
rResAlph | Reference to the resulting converted alphabet (result) |
Definition at line 373 of file hio_module.cpp.
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.
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.
rHioEnvX | the master copy generator of the environment model | |
rHioModule1 | first HioModule | |
rHioModule2 | second HioModule | |
rResEnv | Reference to the resulting environment. |
Definition at line 412 of file hio_module.cpp.
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.
rOldHioPlant | HioPlant to convert | |
i | new parameter to replace x | |
rResult | Reference to the resulting converted HioPlant (result) |
Definition at line 287 of file hio_module.cpp.
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_..."
rOldGen | generator to convert | |
i | new parameter to replace x | |
rResGen | Reference to the resulting converted generator (result) |
Definition at line 219 of file hio_module.cpp.
void faudes::HioModule::Children | ( | const std::vector< HioModule * > & | rChildren | ) |
Set Children of HioModule.
rChildren | vector of children to set |
Definition at line 100 of file hio_module.cpp.
std::vector< HioModule * > faudes::HioModule::Children | ( | ) | const |
Return Children of HioModule.
Definition at line 105 of file hio_module.cpp.
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!
path | Path to the folder containing the specifications |
Definition at line 806 of file hio_module.cpp.
void faudes::HioModule::Clear | ( | void | ) |
Clear all members of the HioModule.
Definition at line 34 of file hio_module.cpp.
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 879 of file hio_module.cpp.
HioController faudes::HioModule::Controller | ( | ) | const |
Return HioController of HioModule.
Definition at line 95 of file hio_module.cpp.
void faudes::HioModule::Controller | ( | const HioController & | rHioController | ) |
Set HioController of HioModule.
rHioController | HioController to set |
Definition at line 90 of file hio_module.cpp.
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] ********* *************************************************
type | the type to be encoded |
Definition at line 1079 of file hio_module.cpp.
HioConstraint faudes::HioModule::EnvConstr | ( | ) | const |
Return Environment-Constraint of HioModule.
Definition at line 126 of file hio_module.cpp.
void faudes::HioModule::EnvConstr | ( | const HioConstraint & | rEnvConstr | ) |
Set Environment-Constraint of HioModule.
rEnvConstr | Environment-Constraint to set |
Definition at line 120 of file hio_module.cpp.
HioEnvironment faudes::HioModule::Environment | ( | ) | const |
Return HioEnvironment of HioModule.
Definition at line 115 of file hio_module.cpp.
void faudes::HioModule::Environment | ( | const HioEnvironment & | rHioEnvironment | ) |
Set HioEnvironment of HioModule.
rHioEnvironment | HioEnvironment to set |
Definition at line 110 of file hio_module.cpp.
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())
Definition at line 989 of file hio_module.cpp.
Idx faudes::HioModule::Index | ( | ) | const |
void faudes::HioModule::Index | ( | const Idx | Index | ) |
Set index of HioModule.
Index | Index to set |
Definition at line 65 of file hio_module.cpp.
void faudes::HioModule::InsChild | ( | HioModule * | rChild | ) |
Insert HioModule to list of children.
rChild | Child HioModule to insert to list of children |
Definition at line 131 of file hio_module.cpp.
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())
Definition at line 1024 of file hio_module.cpp.
std::string faudes::HioModule::Name | ( | void | ) | const |
void faudes::HioModule::Name | ( | const std::string & | rName | ) |
HioConstraint faudes::HioModule::OpConstr | ( | ) | const |
Return Operator-Constraint of HioModule.
Definition at line 75 of file hio_module.cpp.
void faudes::HioModule::OpConstr | ( | const HioConstraint & | rOpConstr | ) |
Set Operator-Constraint of HioModule.
rOpConstr | Operator-Constraint to set |
Definition at line 70 of file hio_module.cpp.
HioPlant faudes::HioModule::Plant | ( | ) | const |
Return HioPlant of HioModule.
Definition at line 85 of file hio_module.cpp.
void faudes::HioModule::Plant | ( | const HioPlant & | rHioPlant | ) |
Set HioPlant of HioModule.
rHioPlant | HioPlant to set |
Definition at line 80 of file hio_module.cpp.
void faudes::HioModule::Position | ( | const int | Xpos, | |
const int | Ypos | |||
) |
This is a function to set the x and y position of the HioModule.
Xpos | Position at the X-Axis of an x0y-System | |
Ypos | Position at the Y-Axis of an x0y-System |
Definition at line 140 of file hio_module.cpp.
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.
path | string path indicating to the folder of the library to load; |
Definition at line 209 of file hio_module.cpp.
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,...)
path | string path indicating to the folder of the library to load; (required format: ../CBx/) |
todo: for GUI load image
Definition at line 157 of file hio_module.cpp.
void faudes::HioModule::RenameHioModule | ( | const int | i | ) |
this function renames all relevant member of the HioModule.
These are: mHioPlant, mLcConstr, mLeConstr, mHioEnvironment, mHioController, mName
i | the new Id of the HioModule |
Definition at line 770 of file hio_module.cpp.
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.
int * faudes::HioModule::TypeHioModule | ( | ) | const |
function to call the Type of the HioModule
Definition at line 1068 of file hio_module.cpp.
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] ********* *************************************************
type | type of the HioModule |
Definition at line 147 of file hio_module.cpp.
int faudes::HioModule::Xpos | ( | ) | const |
function to call the x-Position of the HioModule
Definition at line 1055 of file hio_module.cpp.
int faudes::HioModule::Ypos | ( | ) | const |
function to call the y-Position of the HioModule
Definition at line 1062 of file hio_module.cpp.
std::vector<HioModule*> faudes::HioModule::mChildren [private] |
Definition at line 513 of file hio_module.h.
HioController faudes::HioModule::mController [private] |
Definition at line 510 of file hio_module.h.
HioConstraint faudes::HioModule::mEnvConstr [private] |
Definition at line 519 of file hio_module.h.
Definition at line 516 of file hio_module.h.
Idx faudes::HioModule::mIndex [private] |
Definition at line 501 of file hio_module.h.
std::string faudes::HioModule::mName [private] |
Definition at line 498 of file hio_module.h.
HioConstraint faudes::HioModule::mOpConstr [private] |
Definition at line 504 of file hio_module.h.
HioPlant faudes::HioModule::mPlant [private] |
Definition at line 507 of file hio_module.h.
int faudes::HioModule::mType[5] [private] |
Definition at line 526 of file hio_module.h.
int faudes::HioModule::mXpos [private] |
Definition at line 530 of file hio_module.h.
int faudes::HioModule::mYpos [private] |
Definition at line 531 of file hio_module.h.
libFAUDES 2.23h --- 2014.04.03 --- c++ api documentaion by doxygen