@@ -26,9 +26,9 @@ def main():
2626
2727 Log Output:
2828 INFO Placing Application(tasks=3):
29- INFO - SourceTask(id=0, mips =100) on Node('sensor', mips =0/1000).
30- INFO - ProcessingTask(id=1, mips =5000) on Node('fog', mips =0/400000).
31- INFO - SinkTask(id=2, mips =100) on Node('cloud', mips =0/inf).
29+ INFO - SourceTask(id=0, cu =100) on Node('sensor', cu =0/1000).
30+ INFO - ProcessingTask(id=1, cu =5000) on Node('fog', cu =0/400000).
31+ INFO - SinkTask(id=2, cu =100) on Node('cloud', cu =0/inf).
3232 INFO - DataFlow(bit_rate=1000) on [Link('sensor' -> 'fog', bandwidth=0/30000000.0, latency=10)].
3333 INFO - DataFlow(bit_rate=200) on [Link('fog' -> 'cloud', bandwidth=0/1000000000.0, latency=5)].
3434 DEBUG 0: cloud_and_fog_meter: PowerMeasurement(dynamic=70002.125W, static=30W)
@@ -68,19 +68,19 @@ def create_infrastructure():
6868 """Create the scenario's infrastructure graph.
6969
7070 It consists of three nodes:
71- - A sensor that can compute up to 1000 million instructions per second (MIPS ).
71+ - A sensor with a computational capacity of one compute unit (CU ).
7272 It has a maximum power usage of 1.8 Watt and a power usage of 0.2 Watt when being idle.
73- - A fog node which can compute up to 400000 MIPS ; 200 Watt max and 30 Watt static power usage
74- - A node representing a cloud data center with unlimited processing power that consumes 700 W/MIPS
73+ - A fog node which can compute up to 400 CU ; 200 Watt max and 30 Watt static power usage
74+ - A node representing a cloud data center with unlimited processing power that consumes 0.5 W/CU
7575
7676 And two network links that connect the nodes:
7777 - A WiFi connection between the sensor and fog node that consumes 300 J/bit
7878 - A wide are network (WAN) connection between the fog node and cloud that consumes 6000 J/bit
7979 """
8080 infrastructure = Infrastructure ()
81- sensor = Node ("sensor" , mips = 1000 , power_model = PowerModelNode (max_power = 1.8 , static_power = 0.2 ))
82- fog_node = Node ("fog" , mips = 400000 , power_model = PowerModelNode (max_power = 200 , static_power = 30 ))
83- cloud = Node ("cloud" , power_model = PowerModelNode (power_per_mips = 700 ))
81+ sensor = Node ("sensor" , cu = 1 , power_model = PowerModelNode (max_power = 1.8 , static_power = 0.2 ))
82+ fog_node = Node ("fog" , cu = 400 , power_model = PowerModelNode (max_power = 200 , static_power = 30 ))
83+ cloud = Node ("cloud" , power_model = PowerModelNode (power_per_cu = 0.5 ))
8484 wifi_link_up = Link (sensor , fog_node , latency = 10 , bandwidth = 30e6 , power_model = PowerModelLink (300 ))
8585 wan_link_up = Link (fog_node , cloud , latency = 5 , bandwidth = 1e9 , power_model = PowerModelLink (6000 ))
8686
@@ -93,16 +93,16 @@ def create_application(source_node: Node, sink_node: Node):
9393 """Create the application running in the scenario.
9494
9595 It consists of three tasks and two data flows between these tasks:
96- - A source task that is bound to the sensor node and requires 100 MIPS (for measuring data)
97- - A processing task that receives 1000 bit/s from the source task, requires 5000 MIPS (for aggregating the data)
96+ - A source task that is bound to the sensor node and requires 0.1 CU (for measuring data)
97+ - A processing task that receives 1000 bit/s from the source task, requires 5 CU (for aggregating the data)
9898 and returns 200 bit/s to the sink task
99- - A sink task that is bound to the cloud node and requires 500 MIPS (for storing the data)
99+ - A sink task that is bound to the cloud node and requires 0.5 CU (for storing the data)
100100 """
101101 application = Application ()
102102
103- source_task = SourceTask (mips = 100 , bound_node = source_node )
104- processing_task = ProcessingTask (mips = 5000 )
105- sink_task = SinkTask (mips = 100 , bound_node = sink_node )
103+ source_task = SourceTask (cu = 0.1 , bound_node = source_node )
104+ processing_task = ProcessingTask (cu = 5 )
105+ sink_task = SinkTask (cu = 0.5 , bound_node = sink_node )
106106
107107 application .add_task (source_task )
108108 application .add_task (processing_task , incoming_data_flows = [(source_task , 1000 )])
0 commit comments