#include <Graph.h>
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.
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 > ¶ms) |
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 > ¶ms) |
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 > ¶ms) |
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 > ¶ms) |
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< NodeData > | nodes |
nodes content | |
std::vector< LinkData > | links |
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... |
|
Create a new link.
|
|
Create a new node.
|
|
Export to graph to a Matlab compatible file that describe its structure. Note that all indexes are converted to be one-based. |