| |
libFAUDES
Sections
Index
|
faudes::SimConditionAttribute Class Reference |
Public Types | |
typedef std::vector< StateSet > ::iterator | Iterator |
Convenience typedef. | |
typedef std::vector< StateSet > ::const_iterator | CIterator |
Public Member Functions | |
SimConditionAttribute (void) | |
Default constructor. | |
virtual SimConditionAttribute * | New (void) const |
Construct on heap. | |
virtual bool | IsDefault (void) const |
Test for default value. | |
bool | IsStateCondition (void) const |
Test for state condition. | |
bool | IsEventCondition (void) const |
Test for event condition. | |
bool | IsBreakCondition (void) const |
Test for break condition. | |
bool | IsEnabled (void) const |
Test whether condition is enabled. | |
void | StateCondition (const SimStateConditionAttribute &rStateConditionAttribute) |
Set state condition attribute. | |
void | EventCondition (const SimEventConditionAttribute &rEventConditionAttribute) |
Set event condition attribute. | |
void | BreakCondition (bool on) |
Set break flag. | |
void | Enabled (bool on) |
Set enabled flag. | |
const SimEventConditionAttribute & | EventCondition (void) const |
Get event condition. | |
const SimStateConditionAttribute & | StateCondition (void) const |
Get state condition. | |
void | Reset (void) |
Reset conditions execution state. | |
bool | Satisfied (void) const |
Test whether the condition is currently satisfied. | |
void | Satisfied (bool on, tpTime::Type now) |
Set the condition to be satisfied. | |
Public Attributes | |
SampledDensityFunction | mSamplesPeriod |
Sampled period, at which this condition becomes satisfied. | |
SampledDensityFunction | mSamplesDuration |
Sampled durations, for which this condition remains satisfied. | |
Protected Member Functions | |
virtual void | DoRead (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0) |
Reads the attribute from TokenReader, see AttributeVoid for public wrappers. | |
virtual void | DoWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const |
Writes the attribute to TokenWriter, see AttributeVoid for public wrappers. | |
Protected Attributes | |
bool | mEventCondition |
Indicate precense of a event condition. | |
bool | mStateCondition |
Indicate precense of a state condition. | |
bool | mBreakCondition |
Indicate that we halt simulation when this condition is satisfied. | |
bool | mEnabled |
Indicate that this condition should be considere at all. | |
SimEventConditionAttribute | mEventConditionAttribute |
Event based condotion data. | |
SimStateConditionAttribute | mStateConditionAttribute |
State based condotion data. | |
bool | mSatisfied |
Condotion state: recorded as satisfied. | |
tpTime::Type | mActivationTime |
Condition state: when last satisfied became true. |
typedef std::vector<StateSet>::iterator faudes::SimConditionAttribute::Iterator |
Convenience typedef.
typedef std::vector<StateSet>::const_iterator faudes::SimConditionAttribute::CIterator |
faudes::SimConditionAttribute::SimConditionAttribute | ( | void | ) | [inline] |
Default constructor.
Cinstructs a SimConditionAttribute of with no type ie neither state condition nor event condition.
virtual SimConditionAttribute* faudes::SimConditionAttribute::New | ( | void | ) | const [inline, virtual] |
Construct on heap.
Technically not a constructor, this function creates an object with the same type. It is the callers reponsabilty to delete the object when no longer needed.
Reimplemented from faudes::AttributeVoid.
virtual bool faudes::SimConditionAttribute::IsDefault | ( | void | ) | const [inline, virtual] |
Test for default value.
Reimplemented from faudes::AttributeVoid.
bool faudes::SimConditionAttribute::IsStateCondition | ( | void | ) | const [inline] |
Test for state condition.
bool faudes::SimConditionAttribute::IsEventCondition | ( | void | ) | const [inline] |
Test for event condition.
bool faudes::SimConditionAttribute::IsBreakCondition | ( | void | ) | const [inline] |
Test for break condition.
bool faudes::SimConditionAttribute::IsEnabled | ( | void | ) | const [inline] |
Test whether condition is enabled.
void faudes::SimConditionAttribute::StateCondition | ( | const SimStateConditionAttribute & | rStateConditionAttribute | ) | [inline] |
Set state condition attribute.
Define this attribute to represent the specified state condition.
rStateConditionAttribute | Define state condition |
void faudes::SimConditionAttribute::EventCondition | ( | const SimEventConditionAttribute & | rEventConditionAttribute | ) | [inline] |
Set event condition attribute.
Define this attribute to represent the specified event condition.
rEventConditionAttribute | Define event condition |
void faudes::SimConditionAttribute::BreakCondition | ( | bool | on | ) | [inline] |
Set break flag.
on | True, to indicate that this condition halts simulation. |
void faudes::SimConditionAttribute::Enabled | ( | bool | on | ) | [inline] |
Set enabled flag.
on | True, to indicate that this condition is to be monitored during simulation. |
const SimEventConditionAttribute& faudes::SimConditionAttribute::EventCondition | ( | void | ) | const [inline] |
Get event condition.
Note that the attribute can only return meaningful data if it actually is an event condition.
const SimStateConditionAttribute& faudes::SimConditionAttribute::StateCondition | ( | void | ) | const [inline] |
Get state condition.
Note that the attribute can only return meaningful data if it actually is an state condition.
void faudes::SimConditionAttribute::Reset | ( | void | ) | [inline] |
Reset conditions execution state.
The execution state of a condition consists of all data accumulated during simulation eg statistical data and whether or not the condition is currently satisfied. The execution state resides in the attribute for pragmatic reasons only.
bool faudes::SimConditionAttribute::Satisfied | ( | void | ) | const [inline] |
Test whether the condition is currently satisfied.
This is part of the condition execution state.
void faudes::SimConditionAttribute::Satisfied | ( | bool | on, | |
tpTime::Type | now | |||
) |
Set the condition to be satisfied.
This is part of the condition execution state. Since it is the executor that determines whether a condition is satisfied, and since the condition state resides in the attribute, the executor is meant to notify state changes.
on | True, if the conditions is considered satisfied | |
now | Time at which the state change occures |
void faudes::SimConditionAttribute::DoRead | ( | TokenReader & | rTr, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | [protected, virtual] |
Reads the attribute from TokenReader, see AttributeVoid for public wrappers.
If the current token indicates a condition section, the method reads the condition data from that section. Else it does nothing. Exceptions may only be thrown on invalid data within the condition section. The label argiment is ignored, we use hardcoded labled "EventCondition" and "StateCondition" to figure the type of condition. When a ParallelExecutor is provided as context, it is used to interpret symbolc state names of a state condition.
rTr | TokenReader to read from | |
rLabel | Section to read | |
pContext | Read context to provide contextual information |
Exception |
|
Reimplemented from faudes::AttributeVoid.
void faudes::SimConditionAttribute::DoWrite | ( | TokenWriter & | rTw, | |
const std::string & | rLabel = "" , |
|||
const Type * | pContext = 0 | |||
) | const [protected, virtual] |
Writes the attribute to TokenWriter, see AttributeVoid for public wrappers.
Writes a condition section to include data on state- or event-condition. The label argument is ignored, we use hardcoded keywords "EventCondition" and StateCondition". When a ParallelExecutor is provided as context, it state conditions are written with symbolic state names.
rTw | TokenWriter to write to | |
rLabel | Section to write | |
pContext | Read context to provide contextual information |
Exception |
|
Reimplemented from faudes::AttributeVoid.
Sampled period, at which this condition becomes satisfied.
Sampled durations, for which this condition remains satisfied.
bool faudes::SimConditionAttribute::mEventCondition [protected] |
Indicate precense of a event condition.
bool faudes::SimConditionAttribute::mStateCondition [protected] |
Indicate precense of a state condition.
bool faudes::SimConditionAttribute::mBreakCondition [protected] |
Indicate that we halt simulation when this condition is satisfied.
bool faudes::SimConditionAttribute::mEnabled [protected] |
Indicate that this condition should be considere at all.
Event based condotion data.
State based condotion data.
bool faudes::SimConditionAttribute::mSatisfied [protected] |
Condotion state: recorded as satisfied.
Condition state: when last satisfied became true.
libFAUDES 2.13a c++ source docu by doxygen 1.5.6