DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Attributes | List of all members
Diades::Automata::Experimental::ControlPattern< Fsm > Class Template Reference

A control pattern is a mapping between the set of Events of a StateMachine and a Boolean. More...

#include <ControlPattern.hh>

Public Types

using Event = typename Fsm::EventPropertyId
 
using Events = std::unordered_set< Event >
 
using EventIterator = typename Events::const_iterator
 

Public Member Functions

 ControlPattern (const Fsm &fsm)
 Default constructor (every event is enabled) More...
 
bool enabled (const Event &e) const
 Check whether the event is currently enabled. More...
 
bool disabled (const Event &e) const
 Check whether the event is currently disabled. More...
 
bool unknown (const Event &e) const
 Check whether the event is currently unknown. More...
 
bool enable (const Event &e)
 Enable an event of the StateMachine. More...
 
bool disable (const Event &e)
 Disable an event of the StateMachine. More...
 
EventIterator enabledEventBegin () const
 start iterator over the range of enabled events More...
 
EventIterator enabledEventEnd () const
 end iterator over the range of enabled events More...
 
EventIterator disabledEventBegin () const
 start iterator over the range of disabled events More...
 
EventIterator disabledEventEnd () const
 end iterator over the range of disabled events More...
 

Private Attributes

const Fsm & _fsm
 
Events _enabled
 
Events _disabled
 

Detailed Description

template<typename Fsm>
class Diades::Automata::Experimental::ControlPattern< Fsm >

A control pattern is a mapping between the set of Events of a StateMachine and a Boolean.

This data structure is exactly the one that is defined in the Ramadge and Wonham paper: "Supervisory Control of a Class of Discrete Event Processes, SIAM Journal on Control and Optimization, 1987" An Event might be enabled or disabled. If an Event is enabled in a state of the machine, it means that a controller allows for the trigger of it in the State. If an Event is disabled in that state, it means that a controller does allow the StateMachine to trigger the Event in that state. In Ramadge and Wonham's paper, there are notions of controllable ans uncontrollable events. And only controllable events can be disabled (uncontrollable events cannot be disabled). The notion of controllable/uncontrollable events is NOT managed in a ControlPattern. A ControlPattern only manages the set of enabled/disabled events (extended ControlPattern). Typically a ControlPattern is a element of the Gamma set in the RW's paper extended with the uncontrollable events.

Definition at line 37 of file ControlPattern.hh.

Member Typedef Documentation

◆ Event

template<typename Fsm>
using Diades::Automata::Experimental::ControlPattern< Fsm >::Event = typename Fsm::EventPropertyId

Definition at line 40 of file ControlPattern.hh.

◆ EventIterator

template<typename Fsm>
using Diades::Automata::Experimental::ControlPattern< Fsm >::EventIterator = typename Events::const_iterator

Definition at line 42 of file ControlPattern.hh.

◆ Events

template<typename Fsm>
using Diades::Automata::Experimental::ControlPattern< Fsm >::Events = std::unordered_set<Event>

Definition at line 41 of file ControlPattern.hh.

Constructor & Destructor Documentation

◆ ControlPattern()

template<typename Fsm>
Diades::Automata::Experimental::ControlPattern< Fsm >::ControlPattern ( const Fsm &  fsm)
inline

Default constructor (every event is enabled)

Parameters
[in]fsmthe StateMachine associated with this new ControlPattern

By default, any event type of the StateMachine is enabled

Definition at line 56 of file ControlPattern.hh.

Member Function Documentation

◆ disable()

template<typename Fsm>
bool Diades::Automata::Experimental::ControlPattern< Fsm >::disable ( const Event e)
inline

Disable an event of the StateMachine.

Only accept events from the associated StateMachine

Parameters
[in]ean Event of the StateMachine
Returns
return true if and only if the event e is turned to be disabled (i.e. e is in the associated StateMachine and was not disabled yet).

Definition at line 135 of file ControlPattern.hh.

References Diades::Automata::Experimental::ControlPattern< Fsm >::disabled().

Referenced by trimDdAutStates2().

◆ disabled()

template<typename Fsm>
bool Diades::Automata::Experimental::ControlPattern< Fsm >::disabled ( const Event e) const
inline

Check whether the event is currently disabled.

Parameters
[in]eEvent of the StateMachine
Returns
true if the event e is disabled

Definition at line 80 of file ControlPattern.hh.

Referenced by Diades::Automata::Experimental::ControlPattern< Fsm >::disable(), and Diades::Automata::Experimental::ControlPattern< Fsm >::unknown().

◆ disabledEventBegin()

template<typename Fsm>
EventIterator Diades::Automata::Experimental::ControlPattern< Fsm >::disabledEventBegin ( ) const
inline

start iterator over the range of disabled events

Returns
the start iterator over the range of disabled events in this ControlPattern

Definition at line 170 of file ControlPattern.hh.

◆ disabledEventEnd()

template<typename Fsm>
EventIterator Diades::Automata::Experimental::ControlPattern< Fsm >::disabledEventEnd ( ) const
inline

end iterator over the range of disabled events

Returns
the end iterator over the range of disabled events in this ControlPattern

Definition at line 178 of file ControlPattern.hh.

◆ enable()

template<typename Fsm>
bool Diades::Automata::Experimental::ControlPattern< Fsm >::enable ( const Event e)
inline

Enable an event of the StateMachine.

Only accept events from the associated StateMachine

Parameters
[in]ean Event of the StateMachine
Returns
return true if and only if the event e is turned to be enabled (i.e. e is in the associated StateMachine and was not enabled yet).

Definition at line 110 of file ControlPattern.hh.

References Diades::Automata::Experimental::ControlPattern< Fsm >::enabled().

◆ enabled()

template<typename Fsm>
bool Diades::Automata::Experimental::ControlPattern< Fsm >::enabled ( const Event e) const
inline

Check whether the event is currently enabled.

Parameters
[in]eEvent of the StateMachine
Returns
true if the event e is enabled

Definition at line 68 of file ControlPattern.hh.

Referenced by Diades::Automata::Experimental::controlledTrimmingDeadlockState(), Diades::Automata::Experimental::ControlPattern< Fsm >::enable(), and Diades::Automata::Experimental::ControlPattern< Fsm >::unknown().

◆ enabledEventBegin()

template<typename Fsm>
EventIterator Diades::Automata::Experimental::ControlPattern< Fsm >::enabledEventBegin ( ) const
inline

start iterator over the range of enabled events

Returns
the start iterator over the range of enabled events in this ControlPattern

Definition at line 154 of file ControlPattern.hh.

◆ enabledEventEnd()

template<typename Fsm>
EventIterator Diades::Automata::Experimental::ControlPattern< Fsm >::enabledEventEnd ( ) const
inline

end iterator over the range of enabled events

Returns
the end iterator over the range of enabled events in this ControlPattern

Definition at line 162 of file ControlPattern.hh.

◆ unknown()

template<typename Fsm>
bool Diades::Automata::Experimental::ControlPattern< Fsm >::unknown ( const Event e) const
inline

Check whether the event is currently unknown.

Parameters
[in]eEvent of the StateMachine
Returns
true if the event e is unknown, typically a event type has been inserted in the associated machine and the ControlPattern is not aware. Use enable/disable to handle it

Definition at line 94 of file ControlPattern.hh.

References Diades::Automata::Experimental::ControlPattern< Fsm >::disabled(), and Diades::Automata::Experimental::ControlPattern< Fsm >::enabled().

Member Data Documentation

◆ _disabled

template<typename Fsm>
Events Diades::Automata::Experimental::ControlPattern< Fsm >::_disabled
private

Definition at line 47 of file ControlPattern.hh.

◆ _enabled

template<typename Fsm>
Events Diades::Automata::Experimental::ControlPattern< Fsm >::_enabled
private

Definition at line 46 of file ControlPattern.hh.

◆ _fsm

template<typename Fsm>
const Fsm& Diades::Automata::Experimental::ControlPattern< Fsm >::_fsm
private

Definition at line 45 of file ControlPattern.hh.


The documentation for this class was generated from the following file: