public class TrafficMatrixGenerationModels extends Object
Set of methods implementing different traffic generation models based on traffic matrices.
Important: In Net2Plan
self-demands are not allowed, thus the diagonal of the traffic matrices must be always zero.
Modifier and Type | Method and Description |
---|---|
static double |
activityFactor(double UTC,
double timezoneOffset,
double minValueFactor,
double maxValueFactor)
Returns the activity factor of a node, given the current UTC hour and its timezone (see [1]).
|
static DoubleMatrix2D |
bimodalUniformRandom(int N,
double percentageThreshold,
double minValueClass1,
double maxValueClass1,
double minValueClass2,
double maxValueClass2)
Generates a traffic matrix using a bimodal uniform random distribution,
that is, a distribution in which a value is taken for a uniform random
distribution with probability p, and from the other one with
probability 1-p.
|
static void |
checkTrafficMatrix(DoubleMatrix2D trafficMatrix)
Checks whether the input traffic matrix is valid: non-negative square matrix with zero diagonal.
|
static List<DoubleMatrix2D> |
computeMatricesCAGR(DoubleMatrix2D trafficMatrix,
double cagr,
int numMatrices)
Computes a set of matrices from a seminal one, using a traffic forecast
based on the compound annual growth rate (CAGR) concept.
|
static List<DoubleMatrix2D> |
computeMatricesRandomGaussianVariation(DoubleMatrix2D trafficMatrix,
double cv,
double maxRelativeVariation,
int numMatrices)
Computes a set of matrices from a seminal one, using a random Gaussian distribution.
|
static List<DoubleMatrix2D> |
computeMatricesRandomUniformVariation(DoubleMatrix2D trafficMatrix,
double maxRelativeVariation,
int numMatrices)
Computes a set of matrices from a seminal one, using a random uniform distribution.
|
static DoubleMatrix2D |
constantTrafficMatrix(int N,
double value)
Generates a constant traffic matrix.
|
static DoubleMatrix2D |
gravityModel(double[] ingressTrafficPerNode,
double[] egressTrafficPerNode)
Generates a traffic matrix using a 'gravity model' (see [1]).
|
static DoubleMatrix2D |
normalizationPattern_incomingTraffic(DoubleMatrix2D trafficMatrix,
double[] incomingTraffic)
Normalizes the input traffic matrix with respect to a given incoming traffic vector.
|
static DoubleMatrix2D |
normalizationPattern_outgoingTraffic(DoubleMatrix2D trafficMatrix,
double[] outgoingTraffic)
Normalizes the input traffic matrix with respect to a given outgoing traffic vector.
|
static DoubleMatrix2D |
normalizationPattern_totalTraffic(DoubleMatrix2D trafficMatrix,
double totalTraffic)
Normalizes the input traffic matrix so that the sum of all entries is equal to a given value.
|
static DoubleMatrix2D |
normalizeToLinkLoad(DoubleMatrix2D trafficMatrix,
double linkCapacity,
double load)
Normalizes the load of a traffic matrix in an effort to assess the merits
of the algorithms for different traffic load conditions.
|
static DoubleMatrix1D |
normalizeTraffic_linkCapacity_xde(NetPlan netPlan,
String solverName,
String solverLibraryName,
NetworkLayer... optionalLayerParameter)
Returns the maximum scaled version of the offered traffic vector that
can be carried by the network, provided that no link is oversubscribed.
|
static DoubleMatrix1D |
normalizeTraffic_networkCapacity(NetPlan netPlan,
NetworkLayer... optionalLayerParameter)
Returns the maximum scaled version of the offered traffic vector so
that the network capacity (summation of capacity of all links) is exhausted.
|
static DoubleMatrix2D |
populationDistanceModel(DoubleMatrix2D distanceMatrix,
double[] populationVector,
int[] levelVector,
DoubleMatrix2D levelMatrix,
double randomFactor,
double populationOffset,
double populationPower,
double distanceOffset,
double distancePower,
boolean normalizePopulationFactor,
boolean normalizeDistanceFactor)
Generates a traffic matrix using the population-distance model.
|
static void |
symmetrizeTrafficMatrix(DoubleMatrix2D trafficMatrix)
Symmetrizes the input traffic matrix setting each node-pair traffic value
equal to the average between the traffic in both directions.
|
static DoubleMatrix2D |
uniformRandom(int N,
double minValue,
double maxValue)
Generates a traffic matrix using a uniform random distribution.
|
public static double activityFactor(double UTC, double timezoneOffset, double minValueFactor, double maxValueFactor)
UTC
- Universal Time Coordinated hour in decimal format (e.g. 10:30h is represented as 10.5)timezoneOffset
- Timezone offset from UTC in range [-12, 12]minValueFactor
- Minimum value at low-traffic hour in range [0,1] (in ref. [1] is equal to 0.1)maxValueFactor
- Maximum value at peak hour in range [0,1] (in ref. [1] is equal to 1)public static DoubleMatrix2D bimodalUniformRandom(int N, double percentageThreshold, double minValueClass1, double maxValueClass1, double minValueClass2, double maxValueClass2)
N
- Number of nodespercentageThreshold
- Mixture coefficientminValueClass1
- Minimum traffic value for class 1maxValueClass1
- Maximum traffic value for class 1minValueClass2
- Minimum traffic value for class 2maxValueClass2
- Maximum traffic value for class 2public static void checkTrafficMatrix(DoubleMatrix2D trafficMatrix)
trafficMatrix
- Traffic matrixpublic static List<DoubleMatrix2D> computeMatricesCAGR(DoubleMatrix2D trafficMatrix, double cagr, int numMatrices)
Computes a set of matrices from a seminal one, using a traffic forecast based on the compound annual growth rate (CAGR) concept.
Traffic forecast for node pair (i,j) on year k from the reference one is given by:
TM(i,j,k) = TM(i,j,0) * (1+CAGRk)
trafficMatrix
- Seminal traffic matrixcagr
- Compound Annual Growth Rate (0.2 means an increase of 20% with respect to the previous year)numMatrices
- Number of matrices to generatepublic static List<DoubleMatrix2D> computeMatricesRandomGaussianVariation(DoubleMatrix2D trafficMatrix, double cv, double maxRelativeVariation, int numMatrices)
trafficMatrix
- Seminal traffic matrixcv
- Coefficient of variationmaxRelativeVariation
- Maximum relative variation from the mean value (0.2 means a maximum variation of +-20%)numMatrices
- Number of matrices to generatepublic static List<DoubleMatrix2D> computeMatricesRandomUniformVariation(DoubleMatrix2D trafficMatrix, double maxRelativeVariation, int numMatrices)
trafficMatrix
- Seminal traffic matrixmaxRelativeVariation
- Maximum relative variation from the mean value (0.2 means a maximum variation of +-20%)numMatrices
- Number of matrices to generatepublic static DoubleMatrix2D constantTrafficMatrix(int N, double value)
N
- Number of nodesvalue
- Traffic valuepublic static DoubleMatrix2D gravityModel(double[] ingressTrafficPerNode, double[] egressTrafficPerNode)
Generates a traffic matrix using a 'gravity model' (see [1]). This basic model predicts the demand between node i and j as:
sij=Cte(i)tx(j)
where C is a normalization constant that makes the sum of estimated demands equal to the total traffic entering/leaving the network.
ingressTrafficPerNode
- Ingress traffic per nodeegressTrafficPerNode
- Egress traffic per nodepublic static DoubleMatrix2D normalizationPattern_incomingTraffic(DoubleMatrix2D trafficMatrix, double[] incomingTraffic)
trafficMatrix
- Input traffic matrixincomingTraffic
- Vector of incoming traffic to each nodepublic static DoubleMatrix2D normalizationPattern_outgoingTraffic(DoubleMatrix2D trafficMatrix, double[] outgoingTraffic)
trafficMatrix
- Input traffic matrixoutgoingTraffic
- Vector of outgoing traffic to each nodepublic static DoubleMatrix2D normalizationPattern_totalTraffic(DoubleMatrix2D trafficMatrix, double totalTraffic)
trafficMatrix
- Input traffic matrixtotalTraffic
- Total traffic expectedpublic static DoubleMatrix2D normalizeToLinkLoad(DoubleMatrix2D trafficMatrix, double linkCapacity, double load)
Normalizes the load of a traffic matrix in an effort to assess the merits
of the algorithms for different traffic load conditions. The value
load
represents the average amount of traffic between two nodes,
among all the entries, during the highest loaded time, measured in number of links.
Consequently, a value of load
=0.5 corresponds to the case
when the (maximum) average traffic between two nodes equals 50% of a single link capacity.
In constrast, a value of load
=10 captures cases in which the
(maximum) average traffic between two nodes fills on average 10 links.
trafficMatrix
- Input traffic matrixlinkCapacity
- Link capacity (in same units as trafficMatrix
)load
- Load factor (measured in number of links). The highest value of the resulting traffic matrix will be equal to load
*linkCapacity
public static DoubleMatrix1D normalizeTraffic_linkCapacity_xde(NetPlan netPlan, String solverName, String solverLibraryName, NetworkLayer... optionalLayerParameter)
Returns the maximum scaled version of the offered traffic vector that can be carried by the network, provided that no link is oversubscribed. It is assumed no protection capacity is reserved.
Important: JOM
library is required here.
netPlan
- Network design with physical topology (nodes and links) and a set of demandssolverName
- The solver name to be used by JOMsolverLibraryName
- The solver library full or relative path, to be used by JOM. Leave blank to use JOM defaultoptionalLayerParameter
- Network layer (optional)public static DoubleMatrix1D normalizeTraffic_networkCapacity(NetPlan netPlan, NetworkLayer... optionalLayerParameter)
Returns the maximum scaled version of the offered traffic vector so that the network capacity (summation of capacity of all links) is exhausted.
netPlan
- Network design with physical topology (nodes and links) and a set of demandsoptionalLayerParameter
- Network layer (optional)public static DoubleMatrix2D populationDistanceModel(DoubleMatrix2D distanceMatrix, double[] populationVector, int[] levelVector, DoubleMatrix2D levelMatrix, double randomFactor, double populationOffset, double populationPower, double distanceOffset, double distancePower, boolean normalizePopulationFactor, boolean normalizeDistanceFactor)
Generates a traffic matrix using the population-distance model.
Reference: R. S. Cahn, <i>Wide area network design: concepts and tools for optimization</i>, Morgan Kaufmann Publishers Inc., 1998
distanceMatrix
- Distance matrix, where cell (i, j) represents the distance from node i to node jpopulationVector
- Vector with N elements in which each element is the population of the corresponding nodelevelVector
- Vector with N elements in which each element is the level (i.e. type) of the corresponding nodelevelMatrix
- Level matrixrandomFactor
- Random factorpopulationOffset
- Population offsetpopulationPower
- Population powerdistanceOffset
- Distance offsetdistancePower
- Distance powernormalizePopulationFactor
- Indicates whether population products must be normalized by the maximum population among all nodesnormalizeDistanceFactor
- Indicates whether node-pair distances must be normalized by the maximum distance among all node-pairspublic static void symmetrizeTrafficMatrix(DoubleMatrix2D trafficMatrix)
trafficMatrix
- Traffic matrixpublic static DoubleMatrix2D uniformRandom(int N, double minValue, double maxValue)
N
- Number of nodesminValue
- Minimum traffic valuemaxValue
- Maximum traffic valueCopyright © 2018. All rights reserved.