A node belongs to either a directed or undirected graph.
More...
#include <node_p.h>
|
|
const Attributes & | attrs () const |
| | Gets all the node's Attributes.
|
| |
| const Value & | attr (int id) const |
| | Gets the value of the attribute at id. More...
|
| |
| Value | attr (const QString &name, Value defaultValue=Value()) const |
| | Gets the value corresponding to name. More...
|
| |
| void | setAttr (int id, const Value &value) |
| | Sets the value at id. More...
|
| |
|
int | id () const |
| | Gets the node's id.
|
| |
|
float | x () const |
| | Gets the node's x coordinate.
|
| |
|
float | y () const |
| | Gets the node's y coordinate.
|
| |
|
void | setX (float x) |
| | Sets the node's x coordinate.
|
| |
|
void | setY (float y) |
| | Sets the node's y coordinate.
|
| |
|
void | setCoords (float x, float y) |
| | Sets the node's coordinates.
|
| |
| Node | randNeighbour (PRG *prg) const |
| | Gets a random neighbour. More...
|
| |
|
virtual | ~NodeInterface ()=default |
| | Destructor.
|
| |
|
virtual NodePtr | clone () const =0 |
| | Creates a new std::shared_ptr<BaseNode> with the same data of the current Node.
|
| |
|
virtual const Edges & | inEdges () const =0 |
| | Gets the edges entering the node.
|
| |
|
virtual const Edges & | outEdges () const =0 |
| | Gets the edges leaving the node.
|
| |
|
virtual int | degree () const =0 |
| | Gets the node's degree.
|
| |
|
virtual int | inDegree () const =0 |
| | Gets the node's in-degree, i.e., the number of edges entering the node.
|
| |
|
virtual int | outDegree () const =0 |
| | Gets the node's out-degree, i.e., the number of edges leaving the node.
|
| |
|
|
class | AbstractGraph |
| |
|
class | NodesPrivate |
| |
|
class | TestNode |
| |
|
class | TestEdge |
| |
A node belongs to either a directed or undirected graph.
Directed graphs are composed of DNode objects, while an undirected graph is composed of UNode objects.
- Attention
- A node can only be created by an AbstractGraph derived object or from a Nodes container.
◆ attr() [1/2]
| const Value & evoplex::BaseNode::attr |
( |
int |
id | ) |
const |
|
inline |
Gets the value of the attribute at id.
- Parameters
-
- Exceptions
-
| std::out_of_range | if the id is not present. |
◆ attr() [2/2]
| Value evoplex::BaseNode::attr |
( |
const QString & |
name, |
|
|
Value |
defaultValue = Value() |
|
) |
| const |
|
inline |
Gets the value corresponding to name.
- Parameters
-
| name | The attribute's name. |
| defaultValue | A Value to be returned if name is not present. |
◆ randNeighbour()
| Node evoplex::BaseNode::randNeighbour |
( |
PRG * |
prg | ) |
const |
Gets a random neighbour.
Returns an invalid/empty Node if the node has no neighbours.
◆ setAttr()
| void evoplex::BaseNode::setAttr |
( |
int |
id, |
|
|
const Value & |
value |
|
) |
| |
|
inline |
Sets the value at id.
- Parameters
-
| id | The attribute's id. |
| value | The new attribute's value. |
- Exceptions
-
| std::out_of_range | if the id is not present. |
The documentation for this class was generated from the following file: