Public Member Functions

LinkGraph::Node Class Reference

Updatable node class. More...

#include <linkgraph.h>

Inheritance diagram for LinkGraph::Node:
LinkGraph::NodeWrapper< BaseNode, BaseEdge >

Public Member Functions

 Node (LinkGraph *lg, NodeID node)
 Constructor.
Edge operator[] (NodeID to)
 Get an Edge.
EdgeIterator Begin ()
 Get an iterator pointing to the start of the edges array.
EdgeIterator End ()
 Get an iterator pointing beyond the end of the edges array.
void UpdateSupply (uint supply)
 Update the node's supply and set last_update to the current date.
void SetDemand (uint demand)
 Set the node's demand.
void AddEdge (NodeID to, uint capacity, uint usage=0)
 Fill an edge with values from a link.
void UpdateEdge (NodeID to, uint capacity, uint usage=0)
void RemoveEdge (NodeID to)
 Remove an outgoing edge from this node.

Detailed Description

Updatable node class.

The node itself as well as its edges can be modified.

Definition at line 356 of file linkgraph.h.


Constructor & Destructor Documentation

LinkGraph::Node::Node ( LinkGraph lg,
NodeID  node 
) [inline]

Constructor.

Parameters:
lg LinkGraph to get the node from.
node ID of the node.

Definition at line 363 of file linkgraph.h.


Member Function Documentation

void LinkGraph::Node::AddEdge ( NodeID  to,
uint  capacity,
uint  usage = 0 
)

Fill an edge with values from a link.

Parameters:
to Destination node of the link.
capacity Capacity of the link.

Definition at line 164 of file linkgraph.cpp.

References _date, LinkGraph::BaseEdge::capacity, LinkGraph::NodeWrapper< BaseNode, BaseEdge >::edges, LinkGraph::NodeWrapper< BaseNode, BaseEdge >::index, LinkGraph::BaseEdge::last_update, LinkGraph::BaseEdge::next_edge, and LinkGraph::BaseEdge::usage.

EdgeIterator LinkGraph::Node::Begin (  )  [inline]

Get an iterator pointing to the start of the edges array.

Returns:
Edge iterator.

Definition at line 379 of file linkgraph.h.

References LinkGraph::NodeWrapper< BaseNode, BaseEdge >::edges, and LinkGraph::NodeWrapper< BaseNode, BaseEdge >::index.

EdgeIterator LinkGraph::Node::End (  )  [inline]

Get an iterator pointing beyond the end of the edges array.

Returns:
Constant edge iterator.

Definition at line 385 of file linkgraph.h.

References LinkGraph::NodeWrapper< BaseNode, BaseEdge >::edges.

Edge LinkGraph::Node::operator[] ( NodeID  to  )  [inline]

Get an Edge.

This is not a reference as the wrapper objects are not actually persistent.

Parameters:
to ID of end node of edge.
Returns:
Edge wrapper.

Definition at line 373 of file linkgraph.h.

References LinkGraph::NodeWrapper< BaseNode, BaseEdge >::edges.

void LinkGraph::Node::RemoveEdge ( NodeID  to  ) 
void LinkGraph::Node::SetDemand ( uint  demand  )  [inline]

Set the node's demand.

Parameters:
demand New demand for the node.

Definition at line 401 of file linkgraph.h.

References LinkGraph::BaseNode::demand, and LinkGraph::NodeWrapper< BaseNode, BaseEdge >::node.

void LinkGraph::Node::UpdateSupply ( uint  supply  )  [inline]

Update the node's supply and set last_update to the current date.

Parameters:
supply Supply to be added.

Definition at line 391 of file linkgraph.h.

References _date, LinkGraph::BaseNode::last_update, LinkGraph::NodeWrapper< BaseNode, BaseEdge >::node, and LinkGraph::BaseNode::supply.


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