faudes::SimConditionAttribute Class Reference
[Simulation Condition Attributes]

#include <sp_simconditionset.h>

Inheritance diagram for faudes::SimConditionAttribute:

faudes::AttributeVoid List of all members.

Detailed Description

Attribute for a simulation condition.

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 SimEventConditionAttributeEventCondition (void) const
 Inspect event condition.
const SimStateConditionAttributeStateCondition (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.


Member Typedef Documentation

typedef std::vector<StateSet>::const_iterator faudes::SimConditionAttribute::CIterator
 

Definition at line 107 of file sp_simconditionset.h.

typedef std::vector<StateSet>::iterator faudes::SimConditionAttribute::Iterator
 

Convenience typedef.

Definition at line 106 of file sp_simconditionset.h.


Constructor & Destructor Documentation

faudes::SimConditionAttribute::SimConditionAttribute void   )  [inline]
 

Default constructor.

Definition at line 110 of file sp_simconditionset.h.


Member Function Documentation

void faudes::SimConditionAttribute::BreakCondition bool  on  )  [inline]
 

Set break flag.

Definition at line 141 of file sp_simconditionset.h.

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. The context argument may be provided to use the appropriate state symbols for stateconditions.

Parameters:
rTr TokenReader to read from
rLabel Section to read
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 1)

Reimplemented from faudes::AttributeVoid.

Definition at line 75 of file sp_simconditionset.cpp.

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". The context argument is used to provide appropriate state symbol tables.

Parameters:
rTw TokenWriter to write to
rLabel Section to write
pContext Read context to provide contextual information
Exceptions:
Exception 
  • IO error (id 2)

Reimplemented from faudes::AttributeVoid.

Definition at line 29 of file sp_simconditionset.cpp.

void faudes::SimConditionAttribute::Enabled bool  on  )  [inline]
 

Set enabled flag.

Definition at line 144 of file sp_simconditionset.h.

const SimEventConditionAttribute& faudes::SimConditionAttribute::EventCondition void   )  const [inline]
 

Inspect event condition.

Definition at line 147 of file sp_simconditionset.h.

void faudes::SimConditionAttribute::EventCondition const SimEventConditionAttribute rEventConditionAttribute  )  [inline]
 

Set event condition attribute.

Definition at line 137 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::IsBreakCondition void   )  const [inline]
 

Does this attribute define a break condition?

Definition at line 124 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::IsDefault void   )  const [inline]
 

Test for default value.

Reimplemented from faudes::AttributeVoid.

Definition at line 114 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::IsEnabled void   )  const [inline]
 

Is this condition active?

Definition at line 127 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::IsEventCondition void   )  const [inline]
 

Does this attribute define a event condition?

Definition at line 121 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::IsStateCondition void   )  const [inline]
 

Does this attribute define a state condition?

Definition at line 118 of file sp_simconditionset.h.

void faudes::SimConditionAttribute::Reset void   )  [inline]
 

Reset conditions execution state.

Definition at line 153 of file sp_simconditionset.h.

void faudes::SimConditionAttribute::Satisfied bool  on,
tpTime::Type  now
 

Indicate that the condition became satisfied/dissatisfied at the specifie time.

Definition at line 182 of file sp_simconditionset.cpp.

bool faudes::SimConditionAttribute::Satisfied void   )  const [inline]
 

Test whether the condition is recorded to be satisfied.

Definition at line 158 of file sp_simconditionset.h.

const SimStateConditionAttribute& faudes::SimConditionAttribute::StateCondition void   )  const [inline]
 

Inspect state condition.

Definition at line 150 of file sp_simconditionset.h.

void faudes::SimConditionAttribute::StateCondition const SimStateConditionAttribute rStateConditionAttribute  )  [inline]
 

Set state condition attribute.

Definition at line 130 of file sp_simconditionset.h.


Member Data Documentation

tpTime::Type faudes::SimConditionAttribute::mActivationTime [protected]
 

Condition state: when last satisfied became true.

Definition at line 193 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::mBreakCondition [protected]
 

Indicate that we halt simulation when this condition is satisfied.

Definition at line 178 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::mEnabled [protected]
 

Indicate that this condition should be considere at all.

Definition at line 181 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::mEventCondition [protected]
 

Indicate precense of a event condition.

Definition at line 172 of file sp_simconditionset.h.

SimEventConditionAttribute faudes::SimConditionAttribute::mEventConditionAttribute [protected]
 

Event based condotion data.

Definition at line 184 of file sp_simconditionset.h.

SampledDensityFunction faudes::SimConditionAttribute::mSamplesDuration
 

Condition state: sampled condition durations.

Definition at line 167 of file sp_simconditionset.h.

SampledDensityFunction faudes::SimConditionAttribute::mSamplesPeriod
 

Condition state: sampled condition periods.

Definition at line 164 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::mSatisfied [protected]
 

Condotion state: recorded as satisfied.

Definition at line 190 of file sp_simconditionset.h.

bool faudes::SimConditionAttribute::mStateCondition [protected]
 

Indicate precense of a state condition.

Definition at line 175 of file sp_simconditionset.h.

SimStateConditionAttribute faudes::SimConditionAttribute::mStateConditionAttribute [protected]
 

State based condotion data.

Definition at line 187 of file sp_simconditionset.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 10 08:13:18 2008 for libFAUDES 2.11v by  doxygen 1.4.4