#include <sp_simconditionset.h>
Inheritance diagram for faudes::SimConditionAttribute:
In order to extract statistical data from a simulation by a LoggingExecutor or some derived class, so called simulation conditions are defined. At any instance of time, a condition is satisfied or dissatisfied. Statistical data can then be requested regarding the period and duration of each condition. Currently, two types of conditions are available:
A Condition may be flagged as a break condition to halt simulation when satisfied. A condition may be enabled for tracking or not.
The class SimConditionAttribute summarizes all data to represent faudes simulation conditions. It also holds some state of the condition wrt execution and provides an interface for sampling. The latter may be seperated to a different class in a future revision. The class SimConditionAttribute does, however, not implement any test whether or not a condition is satisfied. This is done by the LoggingExecutor.
As a faudes attribute, conditions can be referenced by names the via std faudes container TaNameSet. Token io should be done in the context of a particular ParallelExecutor using ParallelExecutor methods.
Definition at line 101 of file sp_simconditionset.h.
Public Types | |
typedef std::vector< StateSet >::iterator | Iterator |
Convenience typedef. | |
typedef std::vector< StateSet >::const_iterator | CIterator |
Public Member Functions | |
SimConditionAttribute (void) | |
Default constructor. | |
bool | IsDefault (void) const |
Test for default value. | |
bool | IsStateCondition (void) const |
Does this attribute define a state condition? | |
bool | IsEventCondition (void) const |
Does this attribute define a event condition? | |
bool | IsBreakCondition (void) const |
Does this attribute define a break condition? | |
bool | IsEnabled (void) const |
Is this condition active? | |
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 |
Inspect event condition. | |
const SimStateConditionAttribute & | StateCondition (void) const |
Inspect state condition. | |
void | Reset (void) |
Reset conditions execution state. | |
bool | Satisfied (void) const |
Test whether the condition is recorded to be satisfied. | |
void | Satisfied (bool on, tpTime::Type now) |
Indicate that the condition became satisfied/dissatisfied at the specifie time. | |
Public Attributes | |
SampledDensityFunction | mSamplesPeriod |
Condition state: sampled condition periods. | |
SampledDensityFunction | mSamplesDuration |
Condition state: sampled condition durations. | |
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. |
|
Definition at line 107 of file sp_simconditionset.h. |
|
Convenience typedef.
Definition at line 106 of file sp_simconditionset.h. |
|
Default constructor.
Definition at line 110 of file sp_simconditionset.h. |
|
Set break flag.
Definition at line 141 of file sp_simconditionset.h. |
|
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. The context argument may be provided to use the appropriate state symbols for stateconditions.
Reimplemented from faudes::AttributeVoid. Definition at line 75 of file sp_simconditionset.cpp. |
|
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". The context argument is used to provide appropriate state symbol tables.
Reimplemented from faudes::AttributeVoid. Definition at line 29 of file sp_simconditionset.cpp. |
|
Set enabled flag.
Definition at line 144 of file sp_simconditionset.h. |
|
Inspect event condition.
Definition at line 147 of file sp_simconditionset.h. |
|
Set event condition attribute.
Definition at line 137 of file sp_simconditionset.h. |
|
Does this attribute define a break condition?
Definition at line 124 of file sp_simconditionset.h. |
|
Test for default value.
Reimplemented from faudes::AttributeVoid. Definition at line 114 of file sp_simconditionset.h. |
|
Is this condition active?
Definition at line 127 of file sp_simconditionset.h. |
|
Does this attribute define a event condition?
Definition at line 121 of file sp_simconditionset.h. |
|
Does this attribute define a state condition?
Definition at line 118 of file sp_simconditionset.h. |
|
Reset conditions execution state.
Definition at line 153 of file sp_simconditionset.h. |
|
Indicate that the condition became satisfied/dissatisfied at the specifie time.
Definition at line 182 of file sp_simconditionset.cpp. |
|
Test whether the condition is recorded to be satisfied.
Definition at line 158 of file sp_simconditionset.h. |
|
Inspect state condition.
Definition at line 150 of file sp_simconditionset.h. |
|
Set state condition attribute.
Definition at line 130 of file sp_simconditionset.h. |
|
Condition state: when last satisfied became true.
Definition at line 193 of file sp_simconditionset.h. |
|
Indicate that we halt simulation when this condition is satisfied.
Definition at line 178 of file sp_simconditionset.h. |
|
Indicate that this condition should be considere at all.
Definition at line 181 of file sp_simconditionset.h. |
|
Indicate precense of a event condition.
Definition at line 172 of file sp_simconditionset.h. |
|
Event based condotion data.
Definition at line 184 of file sp_simconditionset.h. |
|
Condition state: sampled condition durations.
Definition at line 167 of file sp_simconditionset.h. |
|
Condition state: sampled condition periods.
Definition at line 164 of file sp_simconditionset.h. |
|
Condotion state: recorded as satisfied.
Definition at line 190 of file sp_simconditionset.h. |
|
Indicate precense of a state condition.
Definition at line 175 of file sp_simconditionset.h. |
|
State based condotion data.
Definition at line 187 of file sp_simconditionset.h. |