DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
Diades::Automata::SubConfiguration Class Reference

#include <SubConfiguration.hh>

Public Types

typedef set< Topology::ConnectionConnectionSet
 
typedef ConnectionSet::const_iterator ConnectionIterator
 
typedef set< Topology::NodeComponentSet
 
typedef ComponentSet::const_iterator ComponentIterator
 
typedef Diades::Utils::Exception< SubConfigurationException
 

Public Member Functions

 SubConfiguration ()
 
 SubConfiguration (const Topology &topology)
 
 SubConfiguration (const Topology &topology, Topology::Node root)
 
bool valid () const
 
 SubConfiguration (const SubConfiguration &subConf)
 
SubConfigurationoperator= (const SubConfiguration &subConf)
 
 ~SubConfiguration ()
 
bool operator== (const SubConfiguration &subconf) const
 
bool operator!= (const SubConfiguration &subconf) const
 
bool operator< (const SubConfiguration &subconf) const
 
void addConnection (Topology::Connection connection)
 
bool isRelaxed (Topology::Connection connection) const
 
bool containsComponentNode (Topology::Node compNode) const
 
bool isExternal (Topology::Connection connection) const
 
bool isEffective (Topology::Connection connection) const
 
const Topologytopology () const
 
unsigned numberOfComponents () const
 
unsigned numberOfEffectiveConnections () const
 
ConnectionIterator effectiveConnectionBegin () const
 
ConnectionIterator effectiveConnectionEnd () const
 
unsigned numberOfRelaxedConnections () const
 
ConnectionIterator relaxedConnectionBegin () const
 
ConnectionIterator relaxedConnectionEnd () const
 
unsigned numberOfExternalConnections () const
 
ConnectionIterator externalConnectionBegin () const
 
ConnectionIterator externalConnectionEnd () const
 
ComponentIterator componentBegin () const
 
ComponentIterator componentEnd () const
 
Topology::Node root () const
 
void setRoot (Topology::Node newRoot)
 
bool isMaximal () const
 
void maximise ()
 
void clear ()
 
void importSubConf (istream &is)
 
void exportSubConf (ostream &os)
 

Static Public Member Functions

static string typeName ()
 

Private Attributes

Topology::Node _root
 
ComponentSet _components
 
ConnectionSet _effective
 
ConnectionSet _relaxed
 
ConnectionSet _external
 
const Topology_topology
 

Detailed Description

This class implements a sub-configuration of the network. Given a topology and a root node, it can represent any sub-configuration of the topology by simply adding or removing connections in the sub-configuration. Here are some definitions:

Definition at line 35 of file SubConfiguration.hh.

Member Typedef Documentation

◆ ComponentIterator

typedef ComponentSet::const_iterator Diades::Automata::SubConfiguration::ComponentIterator

Definition at line 42 of file SubConfiguration.hh.

◆ ComponentSet

Definition at line 41 of file SubConfiguration.hh.

◆ ConnectionIterator

typedef ConnectionSet::const_iterator Diades::Automata::SubConfiguration::ConnectionIterator

Definition at line 40 of file SubConfiguration.hh.

◆ ConnectionSet

Definition at line 39 of file SubConfiguration.hh.

◆ Exception

Definition at line 59 of file SubConfiguration.hh.

Constructor & Destructor Documentation

◆ SubConfiguration() [1/4]

Diades::Automata::SubConfiguration::SubConfiguration ( )
inline

Default constructor

Definition at line 64 of file SubConfiguration.hh.

◆ SubConfiguration() [2/4]

Diades::Automata::SubConfiguration::SubConfiguration ( const Topology topology)
inline
Parameters
topologyThe underlying Topology of the network

Definition at line 75 of file SubConfiguration.hh.

References require, and Diades::Automata::Topology::valid().

◆ SubConfiguration() [3/4]

Diades::Automata::SubConfiguration::SubConfiguration ( const Topology topology,
Topology::Node  root 
)
inline
Parameters
topologyThe underlying Topology of the network
rootthe root node considered in this network

Definition at line 99 of file SubConfiguration.hh.

References Diades::Automata::Topology::contains(), Diades::Automata::Topology::nodeConnectionBegin(), Diades::Automata::Topology::nodeConnectionEnd(), require, and Diades::Automata::Topology::valid().

◆ SubConfiguration() [4/4]

Diades::Automata::SubConfiguration::SubConfiguration ( const SubConfiguration subConf)
inline

Copy constructor

Definition at line 131 of file SubConfiguration.hh.

◆ ~SubConfiguration()

Diades::Automata::SubConfiguration::~SubConfiguration ( )
inline

Definition at line 157 of file SubConfiguration.hh.

References operator==().

Member Function Documentation

◆ addConnection()

void Diades::Automata::SubConfiguration::addConnection ( Topology::Connection  connection)

Make a connection effective in the sub-configuration, An external connection involves one (and only one) component of the current sub-configuration. A relaxed one involves two components of the sub-configuration but is not effective. A connection involving two components that are not in the current subconfiguration is neither called external, nor relaxed.

Update the other connections whose status may change with this adding.

Parameters
connectiona connection

Referenced by operator!=().

◆ clear()

void Diades::Automata::SubConfiguration::clear ( )
inline

◆ componentBegin()

ComponentIterator Diades::Automata::SubConfiguration::componentBegin ( ) const
inline

Definition at line 275 of file SubConfiguration.hh.

Referenced by main().

◆ componentEnd()

ComponentIterator Diades::Automata::SubConfiguration::componentEnd ( ) const
inline

Definition at line 279 of file SubConfiguration.hh.

Referenced by main().

◆ containsComponentNode()

bool Diades::Automata::SubConfiguration::containsComponentNode ( Topology::Node  compNode) const
inline
Returns
true if compNode is involved in the current SubConfiguration

Definition at line 200 of file SubConfiguration.hh.

◆ effectiveConnectionBegin()

ConnectionIterator Diades::Automata::SubConfiguration::effectiveConnectionBegin ( ) const
inline

Definition at line 243 of file SubConfiguration.hh.

Referenced by main().

◆ effectiveConnectionEnd()

ConnectionIterator Diades::Automata::SubConfiguration::effectiveConnectionEnd ( ) const
inline

Definition at line 247 of file SubConfiguration.hh.

Referenced by main().

◆ exportSubConf()

void Diades::Automata::SubConfiguration::exportSubConf ( ostream &  os)

output operator Produce a stream with the following format (cf Alban Grastien)

    p sub nb_comp nb_effective_connections
    Comp0, Comp1, ..., CompN;
    label_event_connection_1: Comp11, Comp12, ...., Comp1M1;
    ....
    label_event_connection_K: CompK1, CompK2, ...., CompKMK;
    ;

Referenced by clear().

◆ externalConnectionBegin()

ConnectionIterator Diades::Automata::SubConfiguration::externalConnectionBegin ( ) const
inline

Definition at line 267 of file SubConfiguration.hh.

Referenced by main().

◆ externalConnectionEnd()

ConnectionIterator Diades::Automata::SubConfiguration::externalConnectionEnd ( ) const
inline

Definition at line 271 of file SubConfiguration.hh.

Referenced by main().

◆ importSubConf()

void Diades::Automata::SubConfiguration::importSubConf ( istream &  is)

input operator Get a subconfiguration from the following stream format. Be aware that this stream must contains labels compatible with the underlying topology of the subconfiguration. The root is Comp0

    p sub nb_comp nb_effective_connections
    Comp0, Comp1, ..., CompN;
    label_event_connection_1: Comp11, Comp12, ...., Comp1M1;
    ....
    label_event_connection_K: CompK1, CompK2, ...., CompKMK;
    ;

Referenced by clear(), and main().

◆ isEffective()

bool Diades::Automata::SubConfiguration::isEffective ( Topology::Connection  connection) const
inline
Returns
true if the connection is effective in the subconfiguration. That is both of the components associated to the connection belongs to the subconfiguration and the connection is considered to be activated (not relaxed)

Definition at line 222 of file SubConfiguration.hh.

◆ isExternal()

bool Diades::Automata::SubConfiguration::isExternal ( Topology::Connection  connection) const
inline
Returns
true if the connection is not involved at all in the SubConfiguration, that is one (and only one) of the components involved with the connection does not belong to the sub-configuration, the other component belongs to the configuration

Definition at line 211 of file SubConfiguration.hh.

◆ isMaximal()

bool Diades::Automata::SubConfiguration::isMaximal ( ) const

Referenced by main(), and root().

◆ isRelaxed()

bool Diades::Automata::SubConfiguration::isRelaxed ( Topology::Connection  connection) const
inline
Returns
true if the connection is ralaxed in the subconfiguration. That is both of the components associated to the connection belongs to the subconfiguration and the connection is considered to be deactivated (relaxed, not effective)

Definition at line 192 of file SubConfiguration.hh.

◆ maximise()

void Diades::Automata::SubConfiguration::maximise ( )
inline

Definition at line 298 of file SubConfiguration.hh.

◆ numberOfComponents()

unsigned Diades::Automata::SubConfiguration::numberOfComponents ( ) const
inline
Returns
the number of components involved in the current Subconfiguration.

Definition at line 236 of file SubConfiguration.hh.

Referenced by main().

◆ numberOfEffectiveConnections()

unsigned Diades::Automata::SubConfiguration::numberOfEffectiveConnections ( ) const
inline

Definition at line 239 of file SubConfiguration.hh.

Referenced by main().

◆ numberOfExternalConnections()

unsigned Diades::Automata::SubConfiguration::numberOfExternalConnections ( ) const
inline

Definition at line 263 of file SubConfiguration.hh.

Referenced by main().

◆ numberOfRelaxedConnections()

unsigned Diades::Automata::SubConfiguration::numberOfRelaxedConnections ( ) const
inline

Definition at line 251 of file SubConfiguration.hh.

Referenced by main().

◆ operator!=()

bool Diades::Automata::SubConfiguration::operator!= ( const SubConfiguration subconf) const
inline

Difference operator

Definition at line 165 of file SubConfiguration.hh.

References addConnection(), and operator<().

◆ operator<()

bool Diades::Automata::SubConfiguration::operator< ( const SubConfiguration subconf) const

Comparison operator

Referenced by operator!=().

◆ operator=()

SubConfiguration& Diades::Automata::SubConfiguration::operator= ( const SubConfiguration subConf)
inline

Assignation operator

Definition at line 143 of file SubConfiguration.hh.

References _components, _effective, _external, _relaxed, _root, and _topology.

◆ operator==()

bool Diades::Automata::SubConfiguration::operator== ( const SubConfiguration subconf) const

Equality operator

Referenced by ~SubConfiguration().

◆ relaxedConnectionBegin()

ConnectionIterator Diades::Automata::SubConfiguration::relaxedConnectionBegin ( ) const
inline

Definition at line 255 of file SubConfiguration.hh.

Referenced by main().

◆ relaxedConnectionEnd()

ConnectionIterator Diades::Automata::SubConfiguration::relaxedConnectionEnd ( ) const
inline

Definition at line 259 of file SubConfiguration.hh.

Referenced by main().

◆ root()

Topology::Node Diades::Automata::SubConfiguration::root ( ) const
inline

Definition at line 283 of file SubConfiguration.hh.

References _root, isMaximal(), and setRoot().

Referenced by main(), and valid().

◆ setRoot()

void Diades::Automata::SubConfiguration::setRoot ( Topology::Node  newRoot)
Parameters
newRootthe new root of the subconfiguration Set the new root of the subconfiguration.
Precondition
newRoot is invalid or belonging to the Topology;
Todo:
TEST

Referenced by root().

◆ topology()

const Topology& Diades::Automata::SubConfiguration::topology ( ) const
inline
Returns
the underlying topology

Definition at line 230 of file SubConfiguration.hh.

References _topology.

Referenced by valid().

◆ typeName()

static string Diades::Automata::SubConfiguration::typeName ( )
inlinestatic

Definition at line 58 of file SubConfiguration.hh.

◆ valid()

bool Diades::Automata::SubConfiguration::valid ( ) const
inline

Member Data Documentation

◆ _components

ComponentSet Diades::Automata::SubConfiguration::_components
private

Definition at line 46 of file SubConfiguration.hh.

Referenced by operator=().

◆ _effective

ConnectionSet Diades::Automata::SubConfiguration::_effective
private

Definition at line 49 of file SubConfiguration.hh.

Referenced by operator=().

◆ _external

ConnectionSet Diades::Automata::SubConfiguration::_external
private

Definition at line 52 of file SubConfiguration.hh.

Referenced by operator=().

◆ _relaxed

ConnectionSet Diades::Automata::SubConfiguration::_relaxed
private

Definition at line 50 of file SubConfiguration.hh.

Referenced by operator=().

◆ _root

Topology::Node Diades::Automata::SubConfiguration::_root
private

Definition at line 45 of file SubConfiguration.hh.

Referenced by operator=(), and root().

◆ _topology

const Topology* Diades::Automata::SubConfiguration::_topology
private

Definition at line 55 of file SubConfiguration.hh.

Referenced by operator=(), and topology().


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