Public Member Functions | Private Attributes

AsymmetricScaler Class Reference

A scaler for asymmetric distribution. More...

Inheritance diagram for AsymmetricScaler:
Scaler

Public Member Functions

 AsymmetricScaler ()
 Constructor.
void AddNode (const Node &node)
 Count a node's demand into the sum of demands.
void SetDemandPerNode (uint num_demands)
 Calculate the mean demand per node using the sum of demands.
uint EffectiveSupply (const Node &from, const Node &to)
 Get the effective supply of one node towards another one.
bool HasDemandLeft (const Node &to)
 Check if there is any acceptance left for this node.

Private Attributes

uint demand_sum
 Sum of all demands in the component.

Detailed Description

A scaler for asymmetric distribution.

Definition at line 90 of file demands.cpp.


Member Function Documentation

void AsymmetricScaler::AddNode ( const Node node  )  [inline]

Count a node's demand into the sum of demands.

Parameters:
node The node to be counted.

Definition at line 101 of file demands.cpp.

References LinkGraph::NodeWrapper< Tnode, Tedge >::Demand(), and demand_sum.

uint AsymmetricScaler::EffectiveSupply ( const Node from,
const Node to 
) [inline]

Get the effective supply of one node towards another one.

In asymmetric distribution the demand of the other node is weighed in.

Parameters:
from The supplying node.
to The receiving node.

Definition at line 121 of file demands.cpp.

References LinkGraph::NodeWrapper< Tnode, Tedge >::Demand(), Scaler::demand_per_node, max(), and LinkGraph::NodeWrapper< Tnode, Tedge >::Supply().

bool AsymmetricScaler::HasDemandLeft ( const Node to  )  [inline]

Check if there is any acceptance left for this node.

In asymmetric distribution nodes always accept as long as their demand > 0.

Parameters:
to The node to be checked.
to_anno Unused.

Definition at line 132 of file demands.cpp.

References LinkGraph::NodeWrapper< Tnode, Tedge >::Demand().

void AsymmetricScaler::SetDemandPerNode ( uint  num_demands  )  [inline]

Calculate the mean demand per node using the sum of demands.

Parameters:
num_demands Number of accepting nodes.

Definition at line 110 of file demands.cpp.

References Scaler::demand_per_node, demand_sum, and max().


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