Infrastructure¶
- class infrastructure.Infrastructure¶
Bases:
PowerAware
Infrastructure graph of the simulated scenario.
The infrastructure is a weighted, directed multigraph where every node contains a
Node
and every edge between contains aLink
.- links(type_filter: Optional[Union[Type[_TLink], Tuple[Type[_TLink], ...]]] = None) List[_TLink] ¶
Return all links in the infrastructure, optionally filtered by class.
- measure_power() PowerMeasurement ¶
Returns the power that is currently used by the entity.
- nodes(type_filter: Optional[Union[Type[_TNode], Tuple[Type[_TNode], ...]]] = None) List[_TNode] ¶
Return all nodes in the infrastructure, optionally filtered by class.
- class infrastructure.Link(src: Node, dst: Node, bandwidth: float, power_model: PowerModelLink, latency: float = 0)¶
Bases:
PowerAware
A network link in the infrastructure graph.
This can represent any kind of network link, e.g.
direct cable connections
wireless connections such as WiFi, Bluetooth, LoRaWAN, 4G LTE, 5G, …
entire wide area network connections that incorporate different networking equipment you do not want to model explicitly.
- Parameters:
src – Source node of the network link.
dst – Target node of the network link.
bandwidth – Bandwidth provided by the network link.
power_model – Power model which determines the power usage of the link.
latency – Latency of the network link which can be used to implement routing policies.
- measure_power() PowerMeasurement ¶
Returns the power that is currently used by the entity.
- class infrastructure.Node(name: str, cu: Optional[float] = None, power_model: Optional[PowerModelNode] = None, location: Optional[Location] = None)¶
Bases:
PowerAware
A compute node in the infrastructure graph.
This can represent any kind of node, e.g. - simple sensors without processing capabilities - resource constrained nodes fog computing nodes - mobile nodes like cars or smartphones - entire data centers with virtually unlimited resources
- Parameters:
name – Name of the node. This is used to refer to nodes when defining links.
cu – Maximum processing power the node provides in “compute units”, a imaginary unit for computational power to express differences between hardware platforms. If None, the node has unlimited processing power.
power_model – Power model which determines the power usage of the node.
location – The (x,y) coordinates of the node
- measure_power() PowerMeasurement ¶
Returns the power that is currently used by the entity.
- utilization() float ¶
Return the current utilization of the resource in the range [0, 1].