A scaler for asymmetric distribution. More...
#include <demands.h>
Public Member Functions | |
FORCEINLINE void | AddNode (const Node &node) |
count a node's demand into the sum of demands | |
FORCEINLINE void | SetDemandPerNode (uint num_demands) |
calculate the mean demand per node using the sum of demands | |
FORCEINLINE uint | EffectiveSupply (const Node &from, const Node &to) |
get the effective supply of one node towards another one. | |
FORCEINLINE bool | DemandLeft (Node &to) |
Check if there is any acceptance left for this node. | |
Private Attributes | |
uint | demand_sum |
A scaler for asymmetric distribution.
Definition at line 81 of file demands.h.
FORCEINLINE void AsymmetricScaler::AddNode | ( | const Node & | node | ) | [inline] |
count a node's demand into the sum of demands
node | The node to be counted |
Definition at line 89 of file demands.h.
References Node::demand.
FORCEINLINE bool AsymmetricScaler::DemandLeft | ( | 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.
to | The node to be checked |
Definition at line 112 of file demands.h.
References Node::demand.
get the effective supply of one node towards another one.
In asymmetric distribution the demand of the other node is weighed in.
from | The supplying node | |
to | The receiving node |
Definition at line 104 of file demands.h.
References Node::demand, max(), and Node::supply.
FORCEINLINE void AsymmetricScaler::SetDemandPerNode | ( | uint | num_demands | ) | [inline] |
calculate the mean demand per node using the sum of demands
num_demands | the number of accepting nodes |
Definition at line 95 of file demands.h.
References Scaler::demand_per_node, and max().