Constructor and Description |
---|
TrafficMatrix(String volumeUnit)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addFlow(String origin,
String destination,
float volume)
Add a flow to the matrix
|
Set<String> |
getDestinations()
Return a set containing all traffic destinations of the matrix
|
float |
getFlow(String origin,
String destination)
Return the traffic volume of a specific flow
|
Set<Pair<String,String>> |
getODPairs()
Return a pair of all origin-destination (OD) pairs of the matrix
|
Set<String> |
getOrigins()
Return a set containing all traffic origins of the matrix
|
String |
getVolumeUnit()
Return the unit of traffic volumes
|
Iterator<Pair<String,String>> |
iterator()
Return an iterator over the OD pairs of matrix
|
void |
removeFlow(String origin,
String destination)
Remove a flow from the matrix
|
void |
setVolumeUnit(String volumeUnit)
Set the unit of traffic volumes
|
int |
size()
Return the number of flows in the matrix
|
public TrafficMatrix(String volumeUnit)
volumeUnit
- the unit of traffic volumespublic int size()
public String getVolumeUnit()
public void setVolumeUnit(String volumeUnit)
volumeUnit
- the volume unit to setpublic float getFlow(String origin, String destination)
origin
- The origin of the flowdestination
- The destination of the flowpublic void addFlow(String origin, String destination, float volume)
volume
- The volume of trafficorigin
- The origin of the flowdestination
- The destination of the flowpublic void removeFlow(String origin, String destination)
origin
- The origin of the flowdestination
- The destination of the flowpublic Set<Pair<String,String>> getODPairs()
public Set<String> getOrigins()
public Set<String> getDestinations()