faudes::SimEventAttribute Class Reference
[Simulation Event Attributes]

#include <sp_simeventset.h>

Inheritance diagram for faudes::SimEventAttribute:

faudes::AttributeCFlags faudes::AttributeFlags faudes::AttributeVoid List of all members.

Detailed Description

Attribute for an event in the context of simulation.

When simulating one or more generators, at each instance of time there will be one or more transitions enabled. In order resolve this non-determinism in a defined way, each event may be equipped with either one of the following properties.

Note that the SimEventAttribute just holds the data to define the properties, a semantic implementation is in faudes::ProposingExecutor. The current implementation also stores simulation state data (ie evaluations of random variables), but this is likely to change in a future revision.

As a faudes attribute, SimEventAttribute provides token io and is prepared for the use in the context of a faudes container. The file format of a set of events equipped with simulation attributes is illustrated by the below example for the simulation of a simple machine:

 <SimEvents>

 % machine start: prioritised event with priority 100
 "alpha"    
 <Priority> 100  </Priority>  

 % machine finsh: gauss distributed event with mue=10 and sigma=5
 "beta"   
 <Stochastic> +State+  +Gauss+  <Parameter> 10  5  </Parameter> </Stochastic>

 % break down: gauss distributed event with mue=20 and sigma=5
 "mue"   
 <Stochastic> +State+  +Gauss+  <Parameter> 20  5  </Parameter> </Stochastic>

 % machine repair: prioritised event with priority 100
 "lambda"    
 <Priority> 100  </Priority>  

 </SimEvents>

Definition at line 149 of file sp_simeventset.h.

Public Member Functions

 SimEventAttribute (void)
 Default constructor (priority 0).
bool IsDefault (void) const
 Test for default value (priority 0).
bool IsStochastic (void) const
 Does this attribute define stochastic properties?
bool IsPriority (void) const
 Does this attribute define priority properties?
void Stochastic (const SimStochasticEventAttribute &rStochasticAttribute)
 Set stochastic attribute.
void Priority (const SimPriorityEventAttribute &rPriorityAttribute)
 Set priority attribute.
const SimPriorityEventAttributePriority (void) const
 Get priority properties.
const SimStochasticEventAttributeStochastic (void) const
 Get stochastic properties.

Public Attributes

tpTime::Type mScheduledFor
 Stochastic state: next scheduled occurence of this event.
tpTime::Type mExpiresAt
 Stochastic state: validity of recent schedule.
tpTime::Type mDelayFor
 Stochastic state: amount of time to defer the event.
TimeInterval mReferenceInterval
 Stochastic state: domain of schedule.

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 mStochastic
 Indicate precense of stochastic behaviour.
bool mPriority
 Indicate precense of priority property.
SimPriorityEventAttribute mPriorityAttribute
 Priority definition data.
SimStochasticEventAttribute mStochasticAttribute
 Stochastic definition data.


Constructor & Destructor Documentation

faudes::SimEventAttribute::SimEventAttribute void   )  [inline]
 

Default constructor (priority 0).

Definition at line 154 of file sp_simeventset.h.


Member Function Documentation

void faudes::SimEventAttribute::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 simulation event section, the method reads all consecutive simulation attributes. Else it does nothing. Exceptions may only be thrown on invalid data within the section. The label argument is ignored, we use hardcoded keywords for the four attributes. The context argument is ignored.

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::AttributeCFlags.

Definition at line 51 of file sp_simeventset.cpp.

void faudes::SimEventAttribute::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 all present simulation event attributes to include the defining data. The label argument is ignored, we use hardcoded keywords. The context argument is ignored.

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::AttributeCFlags.

Definition at line 15 of file sp_simeventset.cpp.

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

Test for default value (priority 0).

Reimplemented from faudes::AttributeCFlags.

Definition at line 158 of file sp_simeventset.h.

bool faudes::SimEventAttribute::IsPriority void   )  const [inline]
 

Does this attribute define priority properties?

Definition at line 165 of file sp_simeventset.h.

bool faudes::SimEventAttribute::IsStochastic void   )  const [inline]
 

Does this attribute define stochastic properties?

Definition at line 162 of file sp_simeventset.h.

const SimPriorityEventAttribute& faudes::SimEventAttribute::Priority void   )  const [inline]
 

Get priority properties.

Definition at line 176 of file sp_simeventset.h.

void faudes::SimEventAttribute::Priority const SimPriorityEventAttribute rPriorityAttribute  )  [inline]
 

Set priority attribute.

Definition at line 172 of file sp_simeventset.h.

const SimStochasticEventAttribute& faudes::SimEventAttribute::Stochastic void   )  const [inline]
 

Get stochastic properties.

Definition at line 179 of file sp_simeventset.h.

void faudes::SimEventAttribute::Stochastic const SimStochasticEventAttribute rStochasticAttribute  )  [inline]
 

Set stochastic attribute.

Definition at line 168 of file sp_simeventset.h.


Member Data Documentation

tpTime::Type faudes::SimEventAttribute::mDelayFor
 

Stochastic state: amount of time to defer the event.

Definition at line 188 of file sp_simeventset.h.

tpTime::Type faudes::SimEventAttribute::mExpiresAt
 

Stochastic state: validity of recent schedule.

Definition at line 185 of file sp_simeventset.h.

bool faudes::SimEventAttribute::mPriority [protected]
 

Indicate precense of priority property.

Definition at line 199 of file sp_simeventset.h.

SimPriorityEventAttribute faudes::SimEventAttribute::mPriorityAttribute [protected]
 

Priority definition data.

Definition at line 202 of file sp_simeventset.h.

TimeInterval faudes::SimEventAttribute::mReferenceInterval
 

Stochastic state: domain of schedule.

Definition at line 191 of file sp_simeventset.h.

tpTime::Type faudes::SimEventAttribute::mScheduledFor
 

Stochastic state: next scheduled occurence of this event.

Definition at line 179 of file sp_simeventset.h.

bool faudes::SimEventAttribute::mStochastic [protected]
 

Indicate precense of stochastic behaviour.

Definition at line 196 of file sp_simeventset.h.

SimStochasticEventAttribute faudes::SimEventAttribute::mStochasticAttribute [protected]
 

Stochastic definition data.

Definition at line 205 of file sp_simeventset.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