DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <Topology.hh>
Classes | |
struct | CliqueIterator |
Public Types | |
typedef Diades::Graph::Node | Connection |
typedef Diades::Graph::Node | Node |
typedef unordered_set< Connection >::const_iterator | ConnectionIterator |
typedef unordered_set< Node >::const_iterator | NodeIterator |
typedef Diades::Utils::Exception< Topology > | Exception |
typedef CliqueIterator | NodeConnectionIterator |
Public Member Functions | |
Node | getNodeOfName (const Identifier &name) const |
void | setNodeName (Node node, const Identifier &name) |
const Identifier & | getNodeName (Node node) const |
const Identifier & | getConnectionLabel (Connection connection) const |
void | setConnectionLabel (Connection connection, const Identifier &label) |
unsigned | numberOfNodes () const |
unsigned | numberOfConnections () const |
bool | isSimple (const Connection &connection) const |
Connection | addConnection (Node n1, Node n2) |
Connection | addConnection (Node n1, Node n2, const Identifier &label) |
unsigned | cliqueSize (Connection connection) const |
CliqueIterator | cliqueBegin (Connection connection) const |
CliqueIterator | cliqueEnd (Connection connection) const |
ConnectionIterator | connectionBegin () const |
ConnectionIterator | connectionEnd () const |
Topology () | |
virtual | ~Topology () |
unsigned | nbConnections (const Node &n1, const Node &n2) const |
unsigned | connectivity (const Node &n) const |
unsigned | structuralConnectivity (const Node &n) const |
bool | isConnected (const Node &n1, const Node &n2) const |
void | getConnections (const Node &n1, const Node &n2, list< Connection > &connections) const |
Connection | addClique (const set< Node > &clique) |
Node | addNode () |
Node | addNode (const Identifier &name) |
NodeIterator | nodeBegin () const |
NodeIterator | nodeEnd () const |
NodeConnectionIterator | nodeConnectionBegin (Node n) const |
NodeConnectionIterator | nodeConnectionEnd (Node n) const |
void | removeConnection (Connection connection) |
void | removeNode (Node n) |
void | topology2dot (const string &fileName) |
void | clear () |
void | import (const string &fileName) |
void | save (const string &fileName) |
bool | valid () const |
bool | operator== (const Topology &topology) const |
bool | contains (Node node) const |
const Graph & | graph () const |
Static Public Member Functions | |
static string | typeName () |
Private Types | |
typedef Diades::Graph::Graph | Graph |
typedef Diades::Graph::Edge | Edge |
Private Attributes | |
Graph | _graph |
unordered_set< Connection > | _connections |
unordered_set< Node > | _nodes |
Diades::Graph::NodeMap< Identifier > | _labels |
This class implements toplogies. A Topology is composed of a set of nodes and a set of connections Here, a node corresponds to a component and a connection corresponds to a synchronisation. Basically, a Topology is represented by a Graph (see Grph::Graph). A node is represented by a Node (Grph::Node) and a Connection is represented by a Node and a set of Edge linking the Connection node to the nodes representing the components. By doing so, a Connection may involve more than two component Node. A set of iterators are also defined (namely ConnectionIterator, NodeIterator, CliqueIterator and NodeConnectionIterator). A ConnectionIterator iterates over the set of Connections of the Topology. A NodeIterator iterates over the component nodes. A CliqueIterator iterates over the clique of component nodes involved in the same Connection. And finally, a NodeConnectionIterator iterates over the Connections linked to a given component Node.
Definition at line 35 of file Topology.hh.
Definition at line 38 of file Topology.hh.
typedef unordered_set<Connection>::const_iterator Diades::Automata::Topology::ConnectionIterator |
Definition at line 40 of file Topology.hh.
|
private |
Definition at line 45 of file Topology.hh.
Definition at line 53 of file Topology.hh.
|
private |
Definition at line 44 of file Topology.hh.
Definition at line 39 of file Topology.hh.
Definition at line 166 of file Topology.hh.
typedef unordered_set<Node>::const_iterator Diades::Automata::Topology::NodeIterator |
Definition at line 41 of file Topology.hh.
|
inline |
Default contructor, make an empty Topology
Definition at line 323 of file Topology.hh.
References Diades::Graph::NodeMap< T >::init().
|
inlinevirtual |
Definition at line 331 of file Topology.hh.
References addClique(), connectivity(), getConnections(), isConnected(), nbConnections(), and structuralConnectivity().
Connection Diades::Automata::Topology::addClique | ( | const set< Node > & | clique | ) |
Create a new connection involving the nodes of 'clique'
clique |
Referenced by ~Topology().
Connection Diades::Automata::Topology::addConnection | ( | Node | n1, |
Node | n2 | ||
) |
Add a new Connection between the Node n1 and the Node n2
n1 | |
n2 |
Referenced by isSimple().
Connection Diades::Automata::Topology::addConnection | ( | Node | n1, |
Node | n2, | ||
const Identifier & | label | ||
) |
Add a new Connection between the Node n1 and the Node n2 with a label
n1 | |
n2 | |
label |
|
inline |
|
inline |
Add a new component node to the Topology
Definition at line 424 of file Topology.hh.
void Diades::Automata::Topology::clear | ( | ) |
Clear the Topology
Referenced by removeConnection().
|
inline |
Start iterator on the clique of the Connection connection. The clique is the set of nodes involved in the Connection
connection |
Definition at line 258 of file Topology.hh.
References Diades::Automata::Topology::CliqueIterator::CliqueIterator(), graph(), and require.
Referenced by Diades::Automata::ConnectionMap::ConnectionMap(), getOutputProjection(), getSynchronisedInteraction(), and main().
|
inline |
End iterator on the clique of the Connection connection. The clique is the set of nodes involved in the Connection
connection |
Definition at line 279 of file Topology.hh.
References Diades::Automata::Topology::CliqueIterator::CliqueIterator(), graph(), and require.
Referenced by Diades::Automata::ConnectionMap::ConnectionMap(), getOutputProjection(), getSynchronisedInteraction(), and main().
|
inline |
connection | a connection |
Definition at line 243 of file Topology.hh.
|
inline |
Start iterator on the connections
Definition at line 304 of file Topology.hh.
Referenced by main().
|
inline |
End iterator on the connections
Definition at line 314 of file Topology.hh.
Referenced by main().
unsigned Diades::Automata::Topology::connectivity | ( | const Node & | n | ) | const |
Connectivity of a Node n
n | a Node |
Referenced by checkEventConsistency(), main(), and ~Topology().
|
inline |
Definition at line 581 of file Topology.hh.
References graph(), and require.
Referenced by Diades::Automata::SubConfiguration::SubConfiguration(), and Diades::Automata::SubConfiguration::valid().
|
inline |
void Diades::Automata::Topology::getConnections | ( | const Node & | n1, |
const Node & | n2, | ||
list< Connection > & | connections | ||
) | const |
n1 | a Node |
n2 | a Node |
connections | the returned list of connections involving n1 and n2 |
Referenced by ~Topology().
|
inline |
Definition at line 98 of file Topology.hh.
References graph(), and require.
Referenced by generateSharedEvents(), getOutputProjection(), getSynchronisedInteraction(), and main().
|
inline |
Definition at line 55 of file Topology.hh.
References nodeBegin(), and nodeEnd().
|
inline |
Definition at line 602 of file Topology.hh.
References _graph, and Diades::Automata::getConnection().
Referenced by addNode(), cliqueBegin(), cliqueEnd(), contains(), generateBehaviour(), Diades::Automata::TopologyMap::getComponent(), getConnectionLabel(), getNodeName(), isSimple(), main(), nodeConnectionBegin(), nodeConnectionEnd(), removeConnection(), setConnectionLabel(), and setNodeName().
void Diades::Automata::Topology::import | ( | const string & | fileName | ) |
Referenced by ~Topology().
|
inline |
Is the Connection simple or not
connection | a Connection |
Definition at line 202 of file Topology.hh.
References addConnection(), graph(), and require.
Number of connections involving Node n1 and Node n2
n1 | |
n2 |
Referenced by ~Topology().
|
inline |
Start iterator on the component nodes
Definition at line 447 of file Topology.hh.
Referenced by checkEventConsistency(), generateBehaviour(), generateSharedEvents(), getNodeOfName(), and main().
|
inline |
Start iterator on the connection in which the node n is involved
n |
Definition at line 469 of file Topology.hh.
References graph(), and require.
Referenced by generateSharedEvents(), getOutputProjection(), getSynchronisedInteraction(), main(), and Diades::Automata::SubConfiguration::SubConfiguration().
|
inline |
End iterator on the connection in which the node n is involved
n |
Definition at line 489 of file Topology.hh.
References graph(), and require.
Referenced by generateSharedEvents(), getOutputProjection(), getSynchronisedInteraction(), main(), and Diades::Automata::SubConfiguration::SubConfiguration().
|
inline |
End iterator on the component nodes
Definition at line 457 of file Topology.hh.
Referenced by checkEventConsistency(), generateBehaviour(), generateSharedEvents(), getNodeOfName(), and main().
|
inline |
Definition at line 188 of file Topology.hh.
Referenced by main().
|
inline |
Definition at line 177 of file Topology.hh.
|
inline |
Definition at line 575 of file Topology.hh.
|
inline |
Remove the Connection 'connection'
connection |
Definition at line 507 of file Topology.hh.
References clear(), graph(), removeNode(), require, save(), and topology2dot().
void Diades::Automata::Topology::removeNode | ( | Node | n | ) |
Remove the component Node 'n'. Any associated Connection is also totally removed
n |
Referenced by removeConnection().
void Diades::Automata::Topology::save | ( | const string & | fileName | ) |
Save the Topology into a file with the following format
p top nbComponent nbConnection label1: node1, node2; label2: node1, node3, node4; ...
fileName |
Referenced by main(), and removeConnection().
|
inline |
Definition at line 129 of file Topology.hh.
|
inline |
Definition at line 84 of file Topology.hh.
unsigned Diades::Automata::Topology::structuralConnectivity | ( | const Node & | n | ) | const |
Structural connectivity of a Node n
n | a Node |
Referenced by ~Topology().
void Diades::Automata::Topology::topology2dot | ( | const string & | fileName | ) |
Export the Topology to Dot file (use of neato is preferable for this type of generated file)
fileName |
Referenced by main(), and removeConnection().
|
inlinestatic |
Definition at line 52 of file Topology.hh.
|
inline |
Definition at line 567 of file Topology.hh.
References numberOfNodes().
Referenced by Diades::Automata::SubConfiguration::SubConfiguration(), Diades::Automata::TopologyMap::valid(), and Diades::Automata::SubConfiguration::valid().
|
private |
Definition at line 47 of file Topology.hh.
|
private |
Definition at line 46 of file Topology.hh.
Referenced by graph().
|
private |
Definition at line 49 of file Topology.hh.
|
private |
Definition at line 48 of file Topology.hh.