FNSS C++ library
C++ API for the Fast Network Simulation Setup (FNSS) toolchain
 All Classes Functions Typedefs Pages
Public Member Functions | List of all members
fnss::TrafficMatrix Class Reference

#include <traffic-matrix.h>

Public Member Functions

unsigned int size () const
 
Quantity getFlow (const std::string &source, const std::string &destination) const
 
Quantity getFlow (const std::pair< std::string, std::string > &nodes) const
 
void setFlow (const std::string &source, const std::string &destination, const Quantity &volume)
 
void setFlow (const std::pair< std::string, std::string > &nodes, const Quantity &volume)
 
std::set< std::pair
< std::string, std::string > > 
getPairs () const
 

Detailed Description

Represent a traffic matrix (referring to a single time interval.

Author
Lorenzo Saino

Member Function Documentation

Quantity fnss::TrafficMatrix::getFlow ( const std::string &  source,
const std::string &  destination 
) const

Get the traffic volume between the specified nodes.

Returns Quantity(0,Units::Data) if the flow is not defined.

Parameters
sourcethe source node of the flow.
destinationthe destination node of the flow.
Returns
the traffic volume.
Quantity fnss::TrafficMatrix::getFlow ( const std::pair< std::string, std::string > &  nodes) const

Get the traffic volume between the specified node pair.

Returns Quantity(0,Units::Data) if the flow is not defined.

Parameters
nodesthe pair of <source, destination> nodes.
Returns
the traffic volume.
std::set< std::pair< std::string, std::string > > fnss::TrafficMatrix::getPairs ( ) const

Get all the existing flows as <source, destination> pairs.

Will only return flows of non-zero volume,

Returns
all the <source, destination> pairs.
void fnss::TrafficMatrix::setFlow ( const std::string &  source,
const std::string &  destination,
const Quantity volume 
)

Set the traffic volume between the specified nodes.

Parameters
sourcethe source node of the flow.
destinationthe destination node of the flow.
volumethe traffic volume.
void fnss::TrafficMatrix::setFlow ( const std::pair< std::string, std::string > &  nodes,
const Quantity volume 
)

Set the traffic volume between the specified node pair.

Parameters
nodesthe pair of <source, destination> nodes.
volumethe traffic volume.
unsigned int fnss::TrafficMatrix::size ( ) const

Get the number of flows in the matrix.

Returns
the number of flows in the matrix.

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