Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Teem::Graph Class Reference
[Utilities]

#include <Graph.h>

List of all members.


Detailed Description

Class to build and describe a generalized graph connecting nodes with links.

Each node and link has a list of (key; value) property. Nodes and links also have a type parameter that describe the type of object it is. This typically corespond to some registery ID to create a structure based on a graph.

See also:
GraphNeuralNetwork


Public Types

typedef size_t Node
 A Node is an id in nodes.
typedef size_t Link
 A Link is an id in links.

Public Member Functions

 Graph ()
 Constructor.
virtual ~Graph ()
 Destructor. All datas are ereased because they are all values not pointers.
void addDefaultNodeParam (const std::string &id, double value)
 Add a param that will be added to newly create node.
void addDefaultNodeParam (const std::map< std::string, double > &params)
 Add params that will be added to newly create node.
void addDefaultLinkParam (const std::string &id, double value)
 Add a param that will be added to newly created links.
void addDefaultLinkParam (const std::map< std::string, double > &params)
 Add params that will be added to newly created links.
Node createNode (const std::string &type, const std::set< std::string > &tags=TagSet())
 Create a new node.
Link createLink (Node from, Node to, const std::string &type, const std::set< std::string > &tags=TagSet())
 Create a new link.
void addNodeParam (Node node, const std::string &id, double value)
 Add a new parameter to the node.
void addNodeParam (Node node, const std::map< std::string, double > &params)
 Add new parameters to the node.
void addLinkParam (Link link, const std::string &id, double value)
 Add a new parameter to the link.
void addLinkParam (Link link, const std::map< std::string, double > &params)
 Add new parameters to the link.
Node getNode (const std::string &tag, size_t index)
 Get a node using an index list.
size_t getNodeCount (const std::string &tag)
 Get the number of node in a tagged list.
Link getLink (const std::string &tag, size_t index)
 Get a link using an index list.
size_t getLinkCount (const std::string &tag)
 Get the number of link in a tagged list.
void exportToDot (const std::string &filename) const
 Export the graph to dot format.
void exportToMatlab (const std::string &filename) const
 Export to graph to a Matlab compatible file that describe its structure.

Protected Attributes

std::vector< NodeDatanodes
 nodes content
std::vector< LinkDatalinks
 links content
std::map< std::string, double > defaultNodeParams
 Default node parameters.
std::map< std::string, double > defaultLinkParams
 Default link parameters.
std::map< std::string, std::vector<
Node > > 
nodeLists
 Index lists for nodes.
std::map< std::string, std::vector<
Link > > 
linkLists
 Index lists for links.

Friends

class GraphNeuralNetwork

Classes

class  Filter
 Interface class for object that want to hook into a Graph before conversion to some controller. More...
struct  LinkData
 Data structure that describe a link. More...
struct  NodeData
 Data structure that describe a node. More...


Member Function Documentation

Graph::Link Teem::Graph::createLink Node  from,
Node  to,
const std::string &  type,
const std::set< std::string > &  tags = TagSet()
 

Create a new link.

Parameters:
from start node for the link
to destination node for the link
type type of the link (as registered)
tags set of tag for the link

Graph::Node Teem::Graph::createNode const std::string &  type,
const std::set< std::string > &  tags = TagSet()
 

Create a new node.

Parameters:
type type of the node (as registered)
tags set of tag for the node

void Teem::Graph::exportToMatlab const std::string &  filename  )  const
 

Export to graph to a Matlab compatible file that describe its structure.

Note that all indexes are converted to be one-based.


The documentation for this class was generated from the following files:
Generated on Mon Oct 24 17:38:29 2005 for Teem by  doxygen 1.4.2