public class Resource extends NetworkElement
.
Modifier and Type | Method and Description |
---|---|
void |
attachToNode(Node node)
Attaches this resource, now dettached of other node, to a new indicated node.
|
void |
dettachFromNode()
Dettaches this resource from its current node, so it will stop using any base resources.
|
SortedSet<Resource> |
getBaseResources()
Returns the set of base resources of this resource
|
double |
getCapacity()
Gets the capacity in resource units of this resource
|
String |
getCapacityMeasurementUnits()
Gets the units in which the capacity of this resource is measured
|
double |
getCapacityOccupiedByUpperResource(Resource upperResource)
Returns the capacity that upperResource occupied in this resource.
|
SortedMap<Resource,Double> |
getCapacityOccupiedByUpperResourcesMap()
Returns the map with the information on the upper resources (the resources for which this resource is a base
resource), and the amount of occupied capacity they are incurring in me
|
double |
getCapacityOccupiedInBaseResource(Resource baseResource)
Returns the capacity that this resource is occupying in the base resource.
|
SortedMap<Resource,Double> |
getCapacityOccupiedInBaseResourcesMap()
Returns the map with an element for each base resource, and the key the amount of capacity occupied in it
|
Optional<Node> |
getHostNode()
Returns the host node of this resource
|
double |
getOccupiedCapacity()
Gets the occupied capacity in resource units of this resource
|
double |
getProcessingTimeToTraversingTrafficInMs()
Gets the processing time added to every traversing traffic
|
SortedSet<Demand> |
getTraversingDemands()
Returns a set with the demands that have at least one route traversing this resource
|
double |
getTraversingRouteOccupiedCapacity(Route route)
Returns the capacity that is occupied in this resource, because of a traversing route.
|
SortedMap<Route,Double> |
getTraversingRouteOccupiedCapacityMap()
Returns a map with one key per each traversing route, and associated to it the amount of capacity occupied in this resource
because of it.
|
SortedSet<Route> |
getTraversingRoutes()
Returns a set with the routes that are traversing this resource
|
String |
getType()
Returns the String describing the type of the node
|
SortedSet<Resource> |
getUpperResources()
Returns the set of resources that are above of this resource, so this resource is a base resource for them
|
URL |
getUrlIcon()
Returns the url of the icon specified by the user to represent this resource, or null if none
|
double |
getUtilization()
Returns resource link utilization, measured as the ratio between the total occupied capacity in the total capacity.
|
boolean |
iAttachedToANode()
Indicates if this resource is attached to a node, or else, is not attached to any
|
boolean |
isHavingMoreThanOneBaseResourceWithTheSameType()
Indicates if the resource has more than one bsae resource with the same type
|
boolean |
isOversubscribed()
Returns true if the occupied capacity of the resource exceeds its capacity
|
void |
remove()
Removes this Resource.
|
void |
setCapacity(double newCapacity,
Map<Resource,Double> newCapacityIOccupyInBaseResourcesMap)
Resets the capacity of a resource, as well as the occupied capacity in the base resources.
|
void |
setCapacityMeasurementUnits(String units)
Sets the units in which the capacity of this resource is measured
|
void |
setProcessingTimeToTraversingTrafficInMs(double time)
Sets the processing time added to every traversing traffic
|
void |
setUrlIcon(URL url)
Sets the url of the icon specified by the user to represent this resource.
|
String |
toString()
Returns a
String representation of the Shared Risk Group. |
addTag, checkAttachedToNetPlanObject, checkAttachedToNetPlanObject, compareTo, equals, getAttribute, getAttribute, getAttributeAsDouble, getAttributeAsDoubleList, getAttributeAsDoubleMatrix, getAttributeAsDoubleMatrix, getAttributeAsStringList, getAttributeAsStringMatrix, getAttributes, getDescription, getId, getIndex, getName, getNetPlan, getNeType, getTags, hasTag, removeAllAttributes, removeAttribute, removeTag, setAttribute, setAttribute, setAttributeAsNumberList, setAttributeAsNumberMatrix, setAttributeAsNumberMatrix, setAttributeAsStringList, setAttributeAsStringMatrix, setAttributeMap, setDescription, setName, wasRemoved
public void attachToNode(Node node)
node
- see abovepublic void dettachFromNode()
public SortedSet<Resource> getBaseResources()
public double getCapacity()
public String getCapacityMeasurementUnits()
public double getCapacityOccupiedByUpperResource(Resource upperResource)
upperResource
- the resource for which this resource is a base resourcepublic SortedMap<Resource,Double> getCapacityOccupiedByUpperResourcesMap()
public double getCapacityOccupiedInBaseResource(Resource baseResource)
baseResource
- The base resourcepublic SortedMap<Resource,Double> getCapacityOccupiedInBaseResourcesMap()
public Optional<Node> getHostNode()
public double getOccupiedCapacity()
public double getProcessingTimeToTraversingTrafficInMs()
public SortedSet<Demand> getTraversingDemands()
public double getTraversingRouteOccupiedCapacity(Route route)
route
- the routepublic SortedMap<Route,Double> getTraversingRouteOccupiedCapacityMap()
public SortedSet<Route> getTraversingRoutes()
public String getType()
public SortedSet<Resource> getUpperResources()
public URL getUrlIcon()
public double getUtilization()
Returns resource link utilization, measured as the ratio between the total occupied capacity in the total capacity.
public boolean iAttachedToANode()
public boolean isHavingMoreThanOneBaseResourceWithTheSameType()
public boolean isOversubscribed()
public void remove()
Removes this Resource. Before that, it removes all the traversing routes (if any), and removes all the resources that are based on this (if any).
public void setCapacity(double newCapacity, Map<Resource,Double> newCapacityIOccupyInBaseResourcesMap)
newCapacity
- the new capacity value to set in this resourcenewCapacityIOccupyInBaseResourcesMap
- a map with the update of the capacities to occupy in the base resources. If null, an empty map is assumed.public void setCapacityMeasurementUnits(String units)
units
- see abovepublic void setProcessingTimeToTraversingTrafficInMs(double time)
time
- the new processing time (cannot be negative)public void setUrlIcon(URL url)
url
- the urlpublic String toString()
Returns a String
representation of the Shared Risk Group.
toString
in class NetworkElement
String
representation of the SRGCopyright © 2018. All rights reserved.