diff --git a/out/clang-debug/src/app/VeinsApp.o b/out/clang-debug/src/app/VeinsApp.o index 09d5672..cd5f248 100644 Binary files a/out/clang-debug/src/app/VeinsApp.o and b/out/clang-debug/src/app/VeinsApp.o differ diff --git a/out/clang-debug/src/app/VeinsApp.o.d b/out/clang-debug/src/app/VeinsApp.o.d index 0862dbe..ebcf8c2 100644 --- a/out/clang-debug/src/app/VeinsApp.o.d +++ b/out/clang-debug/src/app/VeinsApp.o.d @@ -55,6 +55,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/AckMessage_m.h app/messages/AckTimerMessage_m.h \ app/messages/LoadBalanceTimerMessage_m.h \ app/messages/ComputationTimerMessage_m.h \ @@ -178,6 +179,8 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/AckMessage_m.h: app/messages/AckTimerMessage_m.h: diff --git a/out/clang-debug/src/app/loadBalancing/LoadBalancing.o b/out/clang-debug/src/app/loadBalancing/LoadBalancing.o index a16ef3b..69255e7 100644 Binary files a/out/clang-debug/src/app/loadBalancing/LoadBalancing.o and b/out/clang-debug/src/app/loadBalancing/LoadBalancing.o differ diff --git a/out/clang-debug/src/app/loadBalancing/LoadBalancing.o.d b/out/clang-debug/src/app/loadBalancing/LoadBalancing.o.d index f4f85dc..ddcf2c2 100644 --- a/out/clang-debug/src/app/loadBalancing/LoadBalancing.o.d +++ b/out/clang-debug/src/app/loadBalancing/LoadBalancing.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/ComputationTimerMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/ComputationTimerMessage_m.h: diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o new file mode 100644 index 0000000..292c5cb Binary files /dev/null and b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o differ diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o.d b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o.d new file mode 100644 index 0000000..016b4eb --- /dev/null +++ b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o.d @@ -0,0 +1,163 @@ +../out/clang-debug/src/app/loadBalancing/sortingAlgorithm/BaseSorting.o: \ + app/loadBalancing/sortingAlgorithm/BaseSorting.cc \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ + ../../veins-5.2/src/veins/veins.h /opt/omnetpp-6.0.1/include/omnetpp.h \ + app/vehiclesHandling/HelperVehicleInfo.h \ + ../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseLayer.h \ + ../../veins-5.2/src/veins/base/modules/BatteryAccess.h \ + ../../veins-5.2/src/veins/base/modules/BaseModule.h \ + ../../veins-5.2/src/veins/base/utils/HostState.h \ + ../../veins-5.2/src/veins/base/modules/BaseBattery.h \ + ../../veins-5.2/src/veins/base/utils/PassedMessage.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress.h \ + ../../veins-5.2/src/veins/modules/utility/Consts80211p.h \ + ../../veins-5.2/src/veins/modules/utility/ConstsPhy.h \ + ../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h \ + ../../veins-5.2/src/veins/common_m.h \ + ../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord.h \ + ../../veins-5.2/src/veins/base/utils/FWMath.h \ + ../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h \ + ../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h \ + ../../veins-5.2/src/veins/base/utils/AntennaPosition.h \ + ../../veins-5.2/src/veins/base/utils/FindModule.h \ + ../../veins-5.2/src/veins/base/modules/BaseMobility.h \ + ../../veins-5.2/src/veins/base/utils/Move.h \ + ../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h \ + ../../veins-5.2/src/veins/base/utils/Heading.h \ + ../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h \ + ../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/NicEntry.h \ + ../../veins-5.2/src/veins/modules/utility/HasLogProxy.h \ + ../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/Obstacle.h \ + ../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h \ + ../../veins-5.2/src/veins/modules/utility/BBoxLookup.h \ + ../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h \ + ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h + +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + +../../veins-5.2/src/veins/veins.h: + +/opt/omnetpp-6.0.1/include/omnetpp.h: + +app/vehiclesHandling/HelperVehicleInfo.h: + +../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseLayer.h: + +../../veins-5.2/src/veins/base/modules/BatteryAccess.h: + +../../veins-5.2/src/veins/base/modules/BaseModule.h: + +../../veins-5.2/src/veins/base/utils/HostState.h: + +../../veins-5.2/src/veins/base/modules/BaseBattery.h: + +../../veins-5.2/src/veins/base/utils/PassedMessage.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress.h: + +../../veins-5.2/src/veins/modules/utility/Consts80211p.h: + +../../veins-5.2/src/veins/modules/utility/ConstsPhy.h: + +../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h: + +../../veins-5.2/src/veins/common_m.h: + +../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h: + +../../veins-5.2/src/veins/base/utils/Coord_m.h: + +../../veins-5.2/src/veins/base/utils/Coord.h: + +../../veins-5.2/src/veins/base/utils/FWMath.h: + +../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h: + +../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h: + +../../veins-5.2/src/veins/base/utils/AntennaPosition.h: + +../../veins-5.2/src/veins/base/utils/FindModule.h: + +../../veins-5.2/src/veins/base/modules/BaseMobility.h: + +../../veins-5.2/src/veins/base/utils/Move.h: + +../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h: + +../../veins-5.2/src/veins/base/utils/Heading.h: + +../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h: + +../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h: + +../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h: + +../../veins-5.2/src/veins/base/connectionManager/NicEntry.h: + +../../veins-5.2/src/veins/modules/utility/HasLogProxy.h: + +../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/Obstacle.h: + +../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h: + +../../veins-5.2/src/veins/modules/utility/BBoxLookup.h: + +../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h: + +../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h: + +../../veins-5.2/src/veins/base/utils/EnumBitset.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: + +../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o new file mode 100644 index 0000000..60c42bf Binary files /dev/null and b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o differ diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o.d b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o.d new file mode 100644 index 0000000..1e8c4d2 --- /dev/null +++ b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o.d @@ -0,0 +1,166 @@ +../out/clang-debug/src/app/loadBalancing/sortingAlgorithm/ComputationTime.o: \ + app/loadBalancing/sortingAlgorithm/ComputationTime.cc \ + app/loadBalancing/sortingAlgorithm/ComputationTime.h \ + ../../veins-5.2/src/veins/veins.h /opt/omnetpp-6.0.1/include/omnetpp.h \ + app/vehiclesHandling/HelperVehicleInfo.h \ + ../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseLayer.h \ + ../../veins-5.2/src/veins/base/modules/BatteryAccess.h \ + ../../veins-5.2/src/veins/base/modules/BaseModule.h \ + ../../veins-5.2/src/veins/base/utils/HostState.h \ + ../../veins-5.2/src/veins/base/modules/BaseBattery.h \ + ../../veins-5.2/src/veins/base/utils/PassedMessage.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress.h \ + ../../veins-5.2/src/veins/modules/utility/Consts80211p.h \ + ../../veins-5.2/src/veins/modules/utility/ConstsPhy.h \ + ../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h \ + ../../veins-5.2/src/veins/common_m.h \ + ../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord.h \ + ../../veins-5.2/src/veins/base/utils/FWMath.h \ + ../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h \ + ../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h \ + ../../veins-5.2/src/veins/base/utils/AntennaPosition.h \ + ../../veins-5.2/src/veins/base/utils/FindModule.h \ + ../../veins-5.2/src/veins/base/modules/BaseMobility.h \ + ../../veins-5.2/src/veins/base/utils/Move.h \ + ../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h \ + ../../veins-5.2/src/veins/base/utils/Heading.h \ + ../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h \ + ../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/NicEntry.h \ + ../../veins-5.2/src/veins/modules/utility/HasLogProxy.h \ + ../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/Obstacle.h \ + ../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h \ + ../../veins-5.2/src/veins/modules/utility/BBoxLookup.h \ + ../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h \ + ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h + +app/loadBalancing/sortingAlgorithm/ComputationTime.h: + +../../veins-5.2/src/veins/veins.h: + +/opt/omnetpp-6.0.1/include/omnetpp.h: + +app/vehiclesHandling/HelperVehicleInfo.h: + +../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseLayer.h: + +../../veins-5.2/src/veins/base/modules/BatteryAccess.h: + +../../veins-5.2/src/veins/base/modules/BaseModule.h: + +../../veins-5.2/src/veins/base/utils/HostState.h: + +../../veins-5.2/src/veins/base/modules/BaseBattery.h: + +../../veins-5.2/src/veins/base/utils/PassedMessage.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress.h: + +../../veins-5.2/src/veins/modules/utility/Consts80211p.h: + +../../veins-5.2/src/veins/modules/utility/ConstsPhy.h: + +../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h: + +../../veins-5.2/src/veins/common_m.h: + +../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h: + +../../veins-5.2/src/veins/base/utils/Coord_m.h: + +../../veins-5.2/src/veins/base/utils/Coord.h: + +../../veins-5.2/src/veins/base/utils/FWMath.h: + +../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h: + +../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h: + +../../veins-5.2/src/veins/base/utils/AntennaPosition.h: + +../../veins-5.2/src/veins/base/utils/FindModule.h: + +../../veins-5.2/src/veins/base/modules/BaseMobility.h: + +../../veins-5.2/src/veins/base/utils/Move.h: + +../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h: + +../../veins-5.2/src/veins/base/utils/Heading.h: + +../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h: + +../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h: + +../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h: + +../../veins-5.2/src/veins/base/connectionManager/NicEntry.h: + +../../veins-5.2/src/veins/modules/utility/HasLogProxy.h: + +../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/Obstacle.h: + +../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h: + +../../veins-5.2/src/veins/modules/utility/BBoxLookup.h: + +../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h: + +../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h: + +../../veins-5.2/src/veins/base/utils/EnumBitset.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: + +../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: + +app/loadBalancing/sortingAlgorithm/BaseSorting.h: diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o new file mode 100644 index 0000000..068e699 Binary files /dev/null and b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o differ diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o.d b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o.d new file mode 100644 index 0000000..2fd9310 --- /dev/null +++ b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o.d @@ -0,0 +1,166 @@ +../out/clang-debug/src/app/loadBalancing/sortingAlgorithm/FIFO.o: \ + app/loadBalancing/sortingAlgorithm/FIFO.cc \ + app/loadBalancing/sortingAlgorithm/FIFO.h \ + ../../veins-5.2/src/veins/veins.h /opt/omnetpp-6.0.1/include/omnetpp.h \ + app/vehiclesHandling/HelperVehicleInfo.h \ + ../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseLayer.h \ + ../../veins-5.2/src/veins/base/modules/BatteryAccess.h \ + ../../veins-5.2/src/veins/base/modules/BaseModule.h \ + ../../veins-5.2/src/veins/base/utils/HostState.h \ + ../../veins-5.2/src/veins/base/modules/BaseBattery.h \ + ../../veins-5.2/src/veins/base/utils/PassedMessage.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress.h \ + ../../veins-5.2/src/veins/modules/utility/Consts80211p.h \ + ../../veins-5.2/src/veins/modules/utility/ConstsPhy.h \ + ../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h \ + ../../veins-5.2/src/veins/common_m.h \ + ../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord.h \ + ../../veins-5.2/src/veins/base/utils/FWMath.h \ + ../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h \ + ../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h \ + ../../veins-5.2/src/veins/base/utils/AntennaPosition.h \ + ../../veins-5.2/src/veins/base/utils/FindModule.h \ + ../../veins-5.2/src/veins/base/modules/BaseMobility.h \ + ../../veins-5.2/src/veins/base/utils/Move.h \ + ../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h \ + ../../veins-5.2/src/veins/base/utils/Heading.h \ + ../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h \ + ../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/NicEntry.h \ + ../../veins-5.2/src/veins/modules/utility/HasLogProxy.h \ + ../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/Obstacle.h \ + ../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h \ + ../../veins-5.2/src/veins/modules/utility/BBoxLookup.h \ + ../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h \ + ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h + +app/loadBalancing/sortingAlgorithm/FIFO.h: + +../../veins-5.2/src/veins/veins.h: + +/opt/omnetpp-6.0.1/include/omnetpp.h: + +app/vehiclesHandling/HelperVehicleInfo.h: + +../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseLayer.h: + +../../veins-5.2/src/veins/base/modules/BatteryAccess.h: + +../../veins-5.2/src/veins/base/modules/BaseModule.h: + +../../veins-5.2/src/veins/base/utils/HostState.h: + +../../veins-5.2/src/veins/base/modules/BaseBattery.h: + +../../veins-5.2/src/veins/base/utils/PassedMessage.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress.h: + +../../veins-5.2/src/veins/modules/utility/Consts80211p.h: + +../../veins-5.2/src/veins/modules/utility/ConstsPhy.h: + +../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h: + +../../veins-5.2/src/veins/common_m.h: + +../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h: + +../../veins-5.2/src/veins/base/utils/Coord_m.h: + +../../veins-5.2/src/veins/base/utils/Coord.h: + +../../veins-5.2/src/veins/base/utils/FWMath.h: + +../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h: + +../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h: + +../../veins-5.2/src/veins/base/utils/AntennaPosition.h: + +../../veins-5.2/src/veins/base/utils/FindModule.h: + +../../veins-5.2/src/veins/base/modules/BaseMobility.h: + +../../veins-5.2/src/veins/base/utils/Move.h: + +../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h: + +../../veins-5.2/src/veins/base/utils/Heading.h: + +../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h: + +../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h: + +../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h: + +../../veins-5.2/src/veins/base/connectionManager/NicEntry.h: + +../../veins-5.2/src/veins/modules/utility/HasLogProxy.h: + +../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/Obstacle.h: + +../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h: + +../../veins-5.2/src/veins/modules/utility/BBoxLookup.h: + +../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h: + +../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h: + +../../veins-5.2/src/veins/base/utils/EnumBitset.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: + +../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: + +app/loadBalancing/sortingAlgorithm/BaseSorting.h: diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o new file mode 100644 index 0000000..f028942 Binary files /dev/null and b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o differ diff --git a/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o.d b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o.d new file mode 100644 index 0000000..c1e347f --- /dev/null +++ b/out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o.d @@ -0,0 +1,163 @@ +../out/clang-debug/src/app/loadBalancing/sortingAlgorithm/SortingAlgorithm.o: \ + app/loadBalancing/sortingAlgorithm/SortingAlgorithm.cc \ + app/loadBalancing/sortingAlgorithm/SortingAlgorithm.h \ + ../../veins-5.2/src/veins/veins.h /opt/omnetpp-6.0.1/include/omnetpp.h \ + app/vehiclesHandling/HelperVehicleInfo.h \ + ../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseApplLayer.h \ + ../../veins-5.2/src/veins/base/modules/BaseLayer.h \ + ../../veins-5.2/src/veins/base/modules/BatteryAccess.h \ + ../../veins-5.2/src/veins/base/modules/BaseModule.h \ + ../../veins-5.2/src/veins/base/utils/HostState.h \ + ../../veins-5.2/src/veins/base/modules/BaseBattery.h \ + ../../veins-5.2/src/veins/base/utils/PassedMessage.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress.h \ + ../../veins-5.2/src/veins/modules/utility/Consts80211p.h \ + ../../veins-5.2/src/veins/modules/utility/ConstsPhy.h \ + ../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h \ + ../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h \ + ../../veins-5.2/src/veins/common_m.h \ + ../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord_m.h \ + ../../veins-5.2/src/veins/base/utils/Coord.h \ + ../../veins-5.2/src/veins/base/utils/FWMath.h \ + ../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h \ + ../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h \ + ../../veins-5.2/src/veins/base/utils/AntennaPosition.h \ + ../../veins-5.2/src/veins/base/utils/FindModule.h \ + ../../veins-5.2/src/veins/base/modules/BaseMobility.h \ + ../../veins-5.2/src/veins/base/utils/Move.h \ + ../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h \ + ../../veins-5.2/src/veins/base/utils/Heading.h \ + ../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h \ + ../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h \ + ../../veins-5.2/src/veins/base/connectionManager/NicEntry.h \ + ../../veins-5.2/src/veins/modules/utility/HasLogProxy.h \ + ../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/Obstacle.h \ + ../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h \ + ../../veins-5.2/src/veins/modules/utility/BBoxLookup.h \ + ../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h \ + ../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h \ + ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ + ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h + +app/loadBalancing/sortingAlgorithm/SortingAlgorithm.h: + +../../veins-5.2/src/veins/veins.h: + +/opt/omnetpp-6.0.1/include/omnetpp.h: + +app/vehiclesHandling/HelperVehicleInfo.h: + +../../veins-5.2/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseApplLayer.h: + +../../veins-5.2/src/veins/base/modules/BaseLayer.h: + +../../veins-5.2/src/veins/base/modules/BatteryAccess.h: + +../../veins-5.2/src/veins/base/modules/BaseModule.h: + +../../veins-5.2/src/veins/base/utils/HostState.h: + +../../veins-5.2/src/veins/base/modules/BaseBattery.h: + +../../veins-5.2/src/veins/base/utils/PassedMessage.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress.h: + +../../veins-5.2/src/veins/modules/utility/Consts80211p.h: + +../../veins-5.2/src/veins/modules/utility/ConstsPhy.h: + +../../veins-5.2/src/veins/modules/messages/BaseFrame1609_4_m.h: + +../../veins-5.2/src/veins/base/utils/SimpleAddress_m.h: + +../../veins-5.2/src/veins/common_m.h: + +../../veins-5.2/src/veins/modules/messages/DemoServiceAdvertisement_m.h: + +../../veins-5.2/src/veins/base/utils/Coord_m.h: + +../../veins-5.2/src/veins/base/utils/Coord.h: + +../../veins-5.2/src/veins/base/utils/FWMath.h: + +../../veins-5.2/src/veins/modules/messages/DemoSafetyMessage_m.h: + +../../veins-5.2/src/veins/base/connectionManager/ChannelAccess.h: + +../../veins-5.2/src/veins/base/utils/AntennaPosition.h: + +../../veins-5.2/src/veins/base/utils/FindModule.h: + +../../veins-5.2/src/veins/base/modules/BaseMobility.h: + +../../veins-5.2/src/veins/base/utils/Move.h: + +../../veins-5.2/src/veins/base/modules/BaseWorldUtility.h: + +../../veins-5.2/src/veins/base/utils/Heading.h: + +../../veins-5.2/src/veins/modules/mac/ieee80211p/DemoBaseApplLayerToMac1609_4Interface.h: + +../../veins-5.2/src/veins/base/utils/NetwToMacControlInfo.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIMobility.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIScenarioManager.h: + +../../veins-5.2/src/veins/base/connectionManager/BaseConnectionManager.h: + +../../veins-5.2/src/veins/base/connectionManager/NicEntry.h: + +../../veins-5.2/src/veins/modules/utility/HasLogProxy.h: + +../../veins-5.2/src/veins/modules/obstacle/ObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/Obstacle.h: + +../../veins-5.2/src/veins/modules/world/annotations/AnnotationManager.h: + +../../veins-5.2/src/veins/modules/utility/BBoxLookup.h: + +../../veins-5.2/src/veins/modules/obstacle/VehicleObstacleControl.h: + +../../veins-5.2/src/veins/modules/obstacle/MobileHostObstacle.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIBuffer.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConstants.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIColor.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIConnection.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoord.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICoordinateTransformation.h: + +../../veins-5.2/src/veins/modules/mobility/traci/VehicleSignal.h: + +../../veins-5.2/src/veins/base/utils/EnumBitset.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h: + +../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: + +../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: diff --git a/out/clang-debug/src/app/messages/ComputationTimerMessage_m.o b/out/clang-debug/src/app/messages/ComputationTimerMessage_m.o index 866f61a..214575d 100644 Binary files a/out/clang-debug/src/app/messages/ComputationTimerMessage_m.o and b/out/clang-debug/src/app/messages/ComputationTimerMessage_m.o differ diff --git a/out/clang-debug/src/app/messages/OkMessage_m.o b/out/clang-debug/src/app/messages/OkMessage_m.o index 2cde74a..0a0131a 100644 Binary files a/out/clang-debug/src/app/messages/OkMessage_m.o and b/out/clang-debug/src/app/messages/OkMessage_m.o differ diff --git a/out/clang-debug/src/app/messages/ResponseMessage_m.o b/out/clang-debug/src/app/messages/ResponseMessage_m.o index 6bb5d88..9ebe88d 100644 Binary files a/out/clang-debug/src/app/messages/ResponseMessage_m.o and b/out/clang-debug/src/app/messages/ResponseMessage_m.o differ diff --git a/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o b/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o index 198bd92..0132bbb 100644 Binary files a/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o and b/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o differ diff --git a/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o.d b/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o.d index 5098fb2..fe25f84 100644 --- a/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o.d +++ b/out/clang-debug/src/app/messagesHandling/DataMessageHandler.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/AckTimerMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/AckTimerMessage_m.h: diff --git a/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o b/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o index 8e81eab..cf9bf5e 100644 Binary files a/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o and b/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o differ diff --git a/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o.d b/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o.d index 1d82cd3..df855bd 100644 --- a/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o.d +++ b/out/clang-debug/src/app/messagesHandling/HelpMessageHandler.o.d @@ -55,7 +55,8 @@ ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ - ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h app/VeinsApp.h: @@ -174,3 +175,5 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: + +app/loadBalancing/sortingAlgorithm/BaseSorting.h: diff --git a/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o b/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o index 3191056..de73260 100644 Binary files a/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o and b/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o differ diff --git a/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o.d b/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o.d index 5affaf6..a198403 100644 --- a/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o.d +++ b/out/clang-debug/src/app/messagesHandling/OkMessageHandler.o.d @@ -55,7 +55,8 @@ ../../veins-5.2/src/veins/base/utils/EnumBitset.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ - ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h + ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h app/VeinsApp.h: @@ -174,3 +175,5 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: + +app/loadBalancing/sortingAlgorithm/BaseSorting.h: diff --git a/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o b/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o index ccafd4d..ec957c5 100644 Binary files a/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o and b/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o differ diff --git a/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o.d b/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o.d index 45293de..5e15f7f 100644 --- a/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o.d +++ b/out/clang-debug/src/app/messagesHandling/ResponseMessageHandler.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/AckMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/AckMessage_m.h: diff --git a/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o b/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o index 95a4b4c..8275496 100644 Binary files a/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o and b/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o differ diff --git a/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o.d b/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o.d index a54cc35..1f7cc1f 100644 --- a/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o.d +++ b/out/clang-debug/src/app/secureProtocol/SendAgainDataMessage.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/ComputationTimerMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/ComputationTimerMessage_m.h: diff --git a/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o b/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o index 4208ff3..3d870a9 100644 Binary files a/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o and b/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o differ diff --git a/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o.d b/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o.d index daf7022..424d907 100644 --- a/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o.d +++ b/out/clang-debug/src/app/secureProtocol/SendAgainResponseMessage.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/AckTimerMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/AckTimerMessage_m.h: diff --git a/out/clang-debug/src/app/vehiclesHandling/HelperVehicleInfo.o b/out/clang-debug/src/app/vehiclesHandling/HelperVehicleInfo.o index 7faa706..8abb484 100644 Binary files a/out/clang-debug/src/app/vehiclesHandling/HelperVehicleInfo.o and b/out/clang-debug/src/app/vehiclesHandling/HelperVehicleInfo.o differ diff --git a/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o b/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o index e9da1d7..86aa0f2 100644 Binary files a/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o and b/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o differ diff --git a/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o.d b/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o.d index 2e95af9..ba51ad0 100644 --- a/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o.d +++ b/out/clang-debug/src/app/vehiclesHandling/VehicleHandler.o.d @@ -56,6 +56,7 @@ ../../veins-5.2/src/veins/modules/mobility/traci/TraCIRegionOfInterest.h \ ../../veins-5.2/src/veins/modules/mobility/traci/TraCICommandInterface.h \ ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h \ + app/loadBalancing/sortingAlgorithm/BaseSorting.h \ app/messages/LoadBalanceTimerMessage_m.h app/VeinsApp.h: @@ -176,4 +177,6 @@ app/vehiclesHandling/HelperVehicleInfo.h: ../../veins-5.2/src/veins/modules/world/traci/trafficLight/TraCITrafficLightProgram.h: +app/loadBalancing/sortingAlgorithm/BaseSorting.h: + app/messages/LoadBalanceTimerMessage_m.h: diff --git a/out/clang-debug/src/task_offloading_dbg b/out/clang-debug/src/task_offloading_dbg index c9413b2..86ad847 100755 Binary files a/out/clang-debug/src/task_offloading_dbg and b/out/clang-debug/src/task_offloading_dbg differ diff --git a/simulations/task_offloading/omnetpp.ini b/simulations/task_offloading/omnetpp.ini index 888f332..b8cfe78 100644 --- a/simulations/task_offloading/omnetpp.ini +++ b/simulations/task_offloading/omnetpp.ini @@ -89,11 +89,9 @@ print-undisposed = true # Specify if the app have to use auto ACKs between the messages # MAC layer -# *.**.nic.mac1609_4.useAcks = ${useAck = true} -# *.**.useAcks = ${$useAck} -*.**.nic.mac1609_4.useAcks = true +*.**.nic.mac1609_4.useAcks = ${useAcks = false} # Application layer -*.veinsApp.useAcks = false +*.veinsApp.useAcks = ${$useAcks} ########################################################## # App Layer # @@ -152,6 +150,10 @@ print-undisposed = true # CPI for all vehicles *.node[*].appl.vehicleCPI = 3 +# Select sorting algorithm for load balancing +# Types available: FIFO, ComputationTime +*.loadBalancingAlgorithm.typename = "ComputationTime" + [Config Default] # The minimum vehicle load accepted by the bus diff --git a/simulations/task_offloading/task_offloading.ned b/simulations/task_offloading/task_offloading.ned index 8a6eea7..3215c05 100644 --- a/simulations/task_offloading/task_offloading.ned +++ b/simulations/task_offloading/task_offloading.ned @@ -18,15 +18,21 @@ package task_offloading.simulations.task_offloading; import org.car2x.veins.nodes.RSU; import org.car2x.veins.nodes.Scenario; import task_offloading.app.VeinsApp; +import task_offloading.app.loadBalancing.sortingAlgorithm.ISorting; network task_offloading extends Scenario { + @display("bgb=3500,3500"); submodules: rsu[1]: RSU { - @display("p=150,140;i=veins/sign/yellowdiamond;is=vs"); + @display("p=170,140;i=veins/sign/yellowdiamond;is=vs"); } veinsApp: VeinsApp { - @display("p=150,140"); + @display("p=98,140"); + } + + loadBalancingAlgorithm: like ISorting { + @display("i=block/cogwheel;p=248,140"); } } diff --git a/src/Makefile b/src/Makefile index 847a0c9..5a0d8ff 100644 --- a/src/Makefile +++ b/src/Makefile @@ -38,6 +38,9 @@ OBJS = \ $O/app/VeinsApp.o \ $O/app/loadBalancing/LoadBalancing.o \ $O/app/loadBalancing/LoadBalancingState.o \ + $O/app/loadBalancing/sortingAlgorithm/BaseSorting.o \ + $O/app/loadBalancing/sortingAlgorithm/ComputationTime.o \ + $O/app/loadBalancing/sortingAlgorithm/FIFO.o \ $O/app/messagesHandling/DataMessageHandler.o \ $O/app/messagesHandling/HelpMessageHandler.o \ $O/app/messagesHandling/OkMessageHandler.o \ diff --git a/src/app/VeinsApp.cc b/src/app/VeinsApp.cc index eed3478..809eaf9 100644 --- a/src/app/VeinsApp.cc +++ b/src/app/VeinsApp.cc @@ -39,6 +39,7 @@ Define_Module(task_offloading::VeinsApp); void VeinsApp::initialize(int stage) { veins::DemoBaseApplLayer::initialize(stage); + if (stage == 0) { // Initializing members and pointers of your application goes here lastDroveAt = simTime(); @@ -46,18 +47,19 @@ void VeinsApp::initialize(int stage) helpReceived = false; newRandomTime = 0; ackReceived = false; + loadBalancingID = 0; hostCpuFreq = 0; // BUS SECTION - // Calculate BUS load - double busLoad = par("randomVehicleLoadActual").doubleValue() * par("busVehicleLoad").doubleValue(); - double busFreq = par("randomCpuVehicleFreq").doubleValue(); + // Set the BUS index busIndex = 0; - helpers[0] = HelperVehicleInfo(busLoad, busFreq, simTime(), busIndex); - + responsesReceived = 0; + okReceived = 0; // Initialize the BUS state loadBalancingState = LoadBalancingContext(new Disabled); + // Initialize the load balancing algorithm + loadBalancingAlgorithm = check_and_cast(findModuleByPath("task_offloading.loadBalancingAlgorithm")); // Registering all signals startTask = registerSignal("task_started"); @@ -131,21 +133,29 @@ void VeinsApp::handleSelfMsg(cMessage* msg) // This method is for self messages (mostly timers) // Timer for help message if (LoadBalanceTimerMessage* loadBalanceMsg = dynamic_cast(msg)) { - // Set the load balance mode to active - loadBalancingState.setState(new Active); + if (findHost()->getIndex() == busIndex) { + // Set the load balance mode to active + loadBalancingState.setState(new Active); - // Effective balance of the load - balanceLoad(loadBalanceMsg->getSimulationTime()); + // Effective balance of the load + balanceLoad(loadBalanceMsg->getSimulationTime()); + } } // Timer for re-send ACK messages if (AckTimerMessage* ackTimerMsg = dynamic_cast(msg)) { - sendAgainResponse(ackTimerMsg->getHostIndex(), ackTimerMsg->getTaskComputationTime()); + int hostIndex = ackTimerMsg->getHostIndex(); + double completionTime = ackTimerMsg->getTaskComputationTime(); + sendAgainResponse(hostIndex, completionTime); } // Timer for data computation if (ComputationTimerMessage* computationTimerMsg = dynamic_cast(msg)) { - sendAgainData(computationTimerMsg->getIndexHost(), computationTimerMsg->getLoadHost(), computationTimerMsg->getTaskComputationTime()); + int hostIndex = computationTimerMsg->getIndexHost(); + double load = computationTimerMsg->getLoadHost(); + double completionTime = computationTimerMsg->getTaskComputationTime(); + int loadBalancingProgressiveNumber = computationTimerMsg->getLoadBalancingID(); + sendAgainData(hostIndex, load, completionTime, loadBalancingProgressiveNumber); } // Timer for ok message diff --git a/src/app/VeinsApp.h b/src/app/VeinsApp.h index 4810b43..78e7b1b 100644 --- a/src/app/VeinsApp.h +++ b/src/app/VeinsApp.h @@ -30,6 +30,7 @@ #include "app/messages/ResponseMessage_m.h" #include "app/loadBalancing/LoadBalancingState.h" #include "app/vehiclesHandling/HelperVehicleInfo.h" +#include "app/loadBalancing/sortingAlgorithm/BaseSorting.h" #include "veins/modules/application/ieee80211p/DemoBaseApplLayer.h" using namespace omnetpp; @@ -82,11 +83,16 @@ class VEINS_API VeinsApp : public veins::DemoBaseApplLayer { bool sentHelpMessage; bool helpReceived; std::map helpers; + std::list helpersOrderedList; simtime_t newRandomTime; int busIndex; LoadBalancingContext loadBalancingState; bool ackReceived; double hostCpuFreq; + BaseSorting* loadBalancingAlgorithm; + int okReceived; + int responsesReceived; + int loadBalancingID; protected: void onBSM(veins::DemoSafetyMessage* bsm) override; @@ -98,7 +104,7 @@ class VEINS_API VeinsApp : public veins::DemoBaseApplLayer { void handleOkMessage(OkMessage* okMsg); void handleDataMessage(DataMessage* dataMsg); void handleResponseMessage(ResponseMessage* responseMsg); - void sendAgainData(int index, double load, double taskComputationTime); + void sendAgainData(int index, double load, double taskComputationTime, int loadBalancingProgressiveNumber); void sendAgainResponse(int index, double computationTime); void balanceLoad(simtime_t previousRandomTime); void vehicleHandler(); diff --git a/src/app/VeinsApp.ned b/src/app/VeinsApp.ned index 37225c9..3602d83 100644 --- a/src/app/VeinsApp.ned +++ b/src/app/VeinsApp.ned @@ -41,6 +41,7 @@ simple VeinsApp extends DemoBaseApplLayer volatile double dataComputationThreshold @unit(s) = default(uniform(100ms, 200ms)); volatile double ackMessageThreshold @unit(s) = default(uniform(50ms, 100ms)); int vehicleCPI = default(3); + string sortingAlgorithm = default("FIFO"); // General statistic for task time @signal[task_started](type = simtime_t); diff --git a/src/app/loadBalancing/LoadBalancing.cc b/src/app/loadBalancing/LoadBalancing.cc index 85b6385..0bc9722 100644 --- a/src/app/loadBalancing/LoadBalancing.cc +++ b/src/app/loadBalancing/LoadBalancing.cc @@ -26,18 +26,38 @@ void VeinsApp::balanceLoad(simtime_t previousSimulationTime) // Send signal for stopping accepting help requests emit(stopHelp, simTime()); - std::map::iterator vehiclesIterator = helpers.begin(); int vehiclesCounter = helpers.size(); + helpersOrderedList = loadBalancingAlgorithm->sort(helpers); + + // Send signal for stop balance load + emit(stopBalance, simTime()); + + EV << "List ordered: "; + + for (auto const &i: helpersOrderedList) { + EV << i << " "; + } + + EV << std::endl; if (vehiclesCounter > 1) { helpReceived = true; - while (vehiclesIterator != helpers.end()) { - // Check if I'm not the bus - if (vehiclesIterator->first != busIndex) { - // Check if there's data to process - double data = par("computationLoad").doubleValue(); - double vehicleLoad = vehiclesIterator->second.getCurrentLoad(); + // Check if there's data to process + double data = par("computationLoad").doubleValue(); + + for (auto const &i: helpersOrderedList) { + // Debug messages + EV << "Index of vehicle: " << i << std::endl; + EV << "Load remaining: " << data << std::endl; + EV << "Vehicle " << i << " time to complete " << helpers[i].getTotalComputationTime(3) << std::endl; + EV << "Vehicle " << i << " arrival time " << helpers[i].getCreatedAt() << std::endl; + EV << "Index vehicle " << i << " value " << helpers[i].getIndex() << std::endl; + + // Check if the vehicle isn't the bus and if the response received are different from oks + if (i != busIndex) { + // Load of vehicle i + double vehicleLoad = helpers[i].getCurrentLoad(); // If there's data to load then send the messages if (data > 0) { @@ -49,42 +69,39 @@ void VeinsApp::balanceLoad(simtime_t previousSimulationTime) // If auto acks is active then populate wsm with the sender address // otherwise populate it without address if (par("useAcks").boolValue()) { - populateWSM(dataMsg, vehiclesIterator->second.getAddress()); + populateWSM(dataMsg, helpers[i].getAddress()); } else { populateWSM(dataMsg); } dataMsg->setSenderAddress(myId); - dataMsg->setHostIndex(vehiclesIterator->first); + dataMsg->setHostIndex(i); - // If data - vehicleLoad >= 0 then set new data, otherwise send the remaining data + // If data - vehicleLoad >= 0 then set data to maximum vehicle load + // otherwise send the remaining data if ((data - vehicleLoad) >= 0) { + dataMsg->setLoadToProcess(vehicleLoad); data = data - vehicleLoad; - dataMsg->setLoadToProcess(vehiclesIterator->second.getCurrentLoad()); } else { - data = 0; dataMsg->setLoadToProcess(data); + data = 0; } - EV << "Load remaining: " << data << std::endl; - // Schedule the data message scheduleAt(simTime(), dataMsg); - // Update global parameter data - par("computationLoad").setDoubleValue(data); - // Create timer computation message for each host if auto ACKs are disabled if (!(par("useAcks").boolValue())) { ComputationTimerMessage* computationTimerMsg = new ComputationTimerMessage(); populateWSM(computationTimerMsg); computationTimerMsg->setSimulationTime(simTime()); - computationTimerMsg->setIndexHost(vehiclesIterator->first); - computationTimerMsg->setLoadHost(vehiclesIterator->second.getCurrentLoad()); + computationTimerMsg->setIndexHost(i); + computationTimerMsg->setLoadHost(helpers[i].getCurrentLoad()); + computationTimerMsg->setLoadBalancingID(loadBalancingID); // Calculate time for timer double CPI = par("vehicleCPI").intValue(); - double timeToCompute = vehiclesIterator->second.getTotalComputationTime(CPI); + double timeToCompute = helpers[i].getTotalComputationTime(CPI); computationTimerMsg->setTaskComputationTime(timeToCompute); @@ -92,12 +109,6 @@ void VeinsApp::balanceLoad(simtime_t previousSimulationTime) } } } - - // Increment the iterator - vehiclesIterator++; - - // Send signal for stop balance load - emit(stopBalance, simTime()); } } else { sentHelpMessage = false; diff --git a/src/app/loadBalancing/sortingAlgorithm/BaseSorting.cc b/src/app/loadBalancing/sortingAlgorithm/BaseSorting.cc new file mode 100644 index 0000000..4e8f7a8 --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/BaseSorting.cc @@ -0,0 +1,27 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#include "BaseSorting.h" + +using namespace task_offloading; + +BaseSorting::BaseSorting() { + // + +} + +BaseSorting::~BaseSorting() { + // +} diff --git a/src/app/loadBalancing/sortingAlgorithm/BaseSorting.h b/src/app/loadBalancing/sortingAlgorithm/BaseSorting.h new file mode 100644 index 0000000..7f45b6c --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/BaseSorting.h @@ -0,0 +1,32 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#ifndef APP_LOADBALANCING_SORTINGALGORITHM_BASESORTING_H_ +#define APP_LOADBALANCING_SORTINGALGORITHM_BASESORTING_H_ + +#include "veins/veins.h" +#include "app/vehiclesHandling/HelperVehicleInfo.h" +#include "veins/modules/application/ieee80211p/DemoBaseApplLayer.h" + +namespace task_offloading { + class BaseSorting : public cSimpleModule { + public: + BaseSorting(); + virtual ~BaseSorting(); + virtual std::list sort(const std::map &map) = 0; + }; +} + +#endif /* APP_LOADBALANCING_SORTINGALGORITHM_BASESORTING_H_ */ diff --git a/src/app/loadBalancing/sortingAlgorithm/ComputationTime.cc b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.cc new file mode 100644 index 0000000..94c3a5b --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.cc @@ -0,0 +1,54 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#include "ComputationTime.h" + +using namespace task_offloading; + +Define_Module(task_offloading::ComputationTime); + +ComputationTime::ComputationTime() { + // + +} + +ComputationTime::~ComputationTime() { + // +} + +bool cmpComputationTime(std::pair &a, std::pair &b) { + return a.second.getTotalComputationTime(3) < b.second.getTotalComputationTime(3); +} + +std::list ComputationTime::sort(const std::map &map) { + std::list l; + + std::vector> pairVector; + + // Copy the IDs of the map into the vector + for (auto &it : map) { + pairVector.push_back(it); + } + + // Sorting the array with the cmp function defined above + std::sort(pairVector.begin(), pairVector.end(), cmpComputationTime); + + // Fill the list with ordered IDs + for (auto &it : pairVector) { + l.push_back(it.first); + } + + return l; +} diff --git a/src/app/loadBalancing/sortingAlgorithm/ComputationTime.h b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.h new file mode 100644 index 0000000..48cb3b7 --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.h @@ -0,0 +1,33 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#ifndef APP_LOADBALANCING_SORTINGALGORITHM_COMPUTATIONTIME_H_ +#define APP_LOADBALANCING_SORTINGALGORITHM_COMPUTATIONTIME_H_ + +#include "veins/veins.h" +#include "app/vehiclesHandling/HelperVehicleInfo.h" +#include "app/loadBalancing/sortingAlgorithm/BaseSorting.h" +#include "veins/modules/application/ieee80211p/DemoBaseApplLayer.h" + +namespace task_offloading { + class ComputationTime : public BaseSorting { + public: + ComputationTime(); + virtual ~ComputationTime(); + std::list sort(const std::map &map) override; + }; +} + +#endif /* APP_LOADBALANCING_SORTINGALGORITHM_COMPUTATIONTIME_H_ */ diff --git a/src/app/loadBalancing/sortingAlgorithm/ComputationTime.ned b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.ned new file mode 100644 index 0000000..c2397bb --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/ComputationTime.ned @@ -0,0 +1,21 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +package task_offloading.app.loadBalancing.sortingAlgorithm; + +simple ComputationTime like ISorting +{ + @class(task_offloading::ComputationTime); +} \ No newline at end of file diff --git a/src/app/loadBalancing/sortingAlgorithm/FIFO.cc b/src/app/loadBalancing/sortingAlgorithm/FIFO.cc new file mode 100644 index 0000000..9e40f8b --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/FIFO.cc @@ -0,0 +1,53 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#include "FIFO.h" + +using namespace task_offloading; + +Define_Module(task_offloading::FIFO); + +FIFO::FIFO() { + // +} + +FIFO::~FIFO() { + // +} + +bool cmpFIFO(std::pair &a, std::pair &b) { + return a.second.getCreatedAt() < b.second.getCreatedAt(); +} + +std::list FIFO::sort(const std::map &map) { + std::list l; + + std::vector> pairVector; + + // Copy the IDs of the map into the vector + for (auto &it : map) { + pairVector.push_back(it); + } + + // Sorting the array with the cmp function defined above + std::sort(pairVector.begin(), pairVector.end(), cmpFIFO); + + // Fill the list with ordered IDs + for (auto &it : pairVector) { + l.push_back(it.first); + } + + return l; +} diff --git a/src/app/loadBalancing/sortingAlgorithm/FIFO.h b/src/app/loadBalancing/sortingAlgorithm/FIFO.h new file mode 100644 index 0000000..f697d32 --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/FIFO.h @@ -0,0 +1,33 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +#ifndef APP_LOADBALANCING_SORTINGALGORITHM_FIFO_H_ +#define APP_LOADBALANCING_SORTINGALGORITHM_FIFO_H_ + +#include "veins/veins.h" +#include "app/vehiclesHandling/HelperVehicleInfo.h" +#include "app/loadBalancing/sortingAlgorithm/BaseSorting.h" +#include "veins/modules/application/ieee80211p/DemoBaseApplLayer.h" + +namespace task_offloading { + class FIFO : public BaseSorting { + public: + FIFO(); + virtual ~FIFO(); + std::list sort(const std::map &map) override; + }; +} + +#endif /* APP_LOADBALANCING_SORTINGALGORITHM_FIFO_H_ */ diff --git a/src/app/loadBalancing/sortingAlgorithm/FIFO.ned b/src/app/loadBalancing/sortingAlgorithm/FIFO.ned new file mode 100644 index 0000000..7317521 --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/FIFO.ned @@ -0,0 +1,21 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +package task_offloading.app.loadBalancing.sortingAlgorithm; + +simple FIFO like ISorting +{ + @class(task_offloading::FIFO); +} \ No newline at end of file diff --git a/src/app/loadBalancing/sortingAlgorithm/ISorting.ned b/src/app/loadBalancing/sortingAlgorithm/ISorting.ned new file mode 100644 index 0000000..c44dca9 --- /dev/null +++ b/src/app/loadBalancing/sortingAlgorithm/ISorting.ned @@ -0,0 +1,20 @@ +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Lesser General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. +// + +package task_offloading.app.loadBalancing.sortingAlgorithm; + +moduleinterface ISorting +{ +} \ No newline at end of file diff --git a/src/app/messages/ComputationTimerMessage.msg b/src/app/messages/ComputationTimerMessage.msg index 5ec2149..5477fa0 100644 --- a/src/app/messages/ComputationTimerMessage.msg +++ b/src/app/messages/ComputationTimerMessage.msg @@ -24,4 +24,5 @@ packet ComputationTimerMessage extends veins::BaseFrame1609_4 { int indexHost; double loadHost; double taskComputationTime; + int loadBalancingID; } diff --git a/src/app/messages/ComputationTimerMessage_m.cc b/src/app/messages/ComputationTimerMessage_m.cc index 3023549..aa68e3b 100644 --- a/src/app/messages/ComputationTimerMessage_m.cc +++ b/src/app/messages/ComputationTimerMessage_m.cc @@ -181,6 +181,7 @@ void ComputationTimerMessage::copy(const ComputationTimerMessage& other) this->indexHost = other.indexHost; this->loadHost = other.loadHost; this->taskComputationTime = other.taskComputationTime; + this->loadBalancingID = other.loadBalancingID; } void ComputationTimerMessage::parsimPack(omnetpp::cCommBuffer *b) const @@ -190,6 +191,7 @@ void ComputationTimerMessage::parsimPack(omnetpp::cCommBuffer *b) const doParsimPacking(b,this->indexHost); doParsimPacking(b,this->loadHost); doParsimPacking(b,this->taskComputationTime); + doParsimPacking(b,this->loadBalancingID); } void ComputationTimerMessage::parsimUnpack(omnetpp::cCommBuffer *b) @@ -199,6 +201,7 @@ void ComputationTimerMessage::parsimUnpack(omnetpp::cCommBuffer *b) doParsimUnpacking(b,this->indexHost); doParsimUnpacking(b,this->loadHost); doParsimUnpacking(b,this->taskComputationTime); + doParsimUnpacking(b,this->loadBalancingID); } ::omnetpp::simtime_t ComputationTimerMessage::getSimulationTime() const @@ -241,6 +244,16 @@ void ComputationTimerMessage::setTaskComputationTime(double taskComputationTime) this->taskComputationTime = taskComputationTime; } +int ComputationTimerMessage::getLoadBalancingID() const +{ + return this->loadBalancingID; +} + +void ComputationTimerMessage::setLoadBalancingID(int loadBalancingID) +{ + this->loadBalancingID = loadBalancingID; +} + class ComputationTimerMessageDescriptor : public omnetpp::cClassDescriptor { private: @@ -250,6 +263,7 @@ class ComputationTimerMessageDescriptor : public omnetpp::cClassDescriptor FIELD_indexHost, FIELD_loadHost, FIELD_taskComputationTime, + FIELD_loadBalancingID, }; public: ComputationTimerMessageDescriptor(); @@ -316,7 +330,7 @@ const char *ComputationTimerMessageDescriptor::getProperty(const char *propertyN int ComputationTimerMessageDescriptor::getFieldCount() const { omnetpp::cClassDescriptor *base = getBaseClassDescriptor(); - return base ? 4+base->getFieldCount() : 4; + return base ? 5+base->getFieldCount() : 5; } unsigned int ComputationTimerMessageDescriptor::getFieldTypeFlags(int field) const @@ -332,8 +346,9 @@ unsigned int ComputationTimerMessageDescriptor::getFieldTypeFlags(int field) con FD_ISEDITABLE, // FIELD_indexHost FD_ISEDITABLE, // FIELD_loadHost FD_ISEDITABLE, // FIELD_taskComputationTime + FD_ISEDITABLE, // FIELD_loadBalancingID }; - return (field >= 0 && field < 4) ? fieldTypeFlags[field] : 0; + return (field >= 0 && field < 5) ? fieldTypeFlags[field] : 0; } const char *ComputationTimerMessageDescriptor::getFieldName(int field) const @@ -349,8 +364,9 @@ const char *ComputationTimerMessageDescriptor::getFieldName(int field) const "indexHost", "loadHost", "taskComputationTime", + "loadBalancingID", }; - return (field >= 0 && field < 4) ? fieldNames[field] : nullptr; + return (field >= 0 && field < 5) ? fieldNames[field] : nullptr; } int ComputationTimerMessageDescriptor::findField(const char *fieldName) const @@ -361,6 +377,7 @@ int ComputationTimerMessageDescriptor::findField(const char *fieldName) const if (strcmp(fieldName, "indexHost") == 0) return baseIndex + 1; if (strcmp(fieldName, "loadHost") == 0) return baseIndex + 2; if (strcmp(fieldName, "taskComputationTime") == 0) return baseIndex + 3; + if (strcmp(fieldName, "loadBalancingID") == 0) return baseIndex + 4; return base ? base->findField(fieldName) : -1; } @@ -377,8 +394,9 @@ const char *ComputationTimerMessageDescriptor::getFieldTypeString(int field) con "int", // FIELD_indexHost "double", // FIELD_loadHost "double", // FIELD_taskComputationTime + "int", // FIELD_loadBalancingID }; - return (field >= 0 && field < 4) ? fieldTypeStrings[field] : nullptr; + return (field >= 0 && field < 5) ? fieldTypeStrings[field] : nullptr; } const char **ComputationTimerMessageDescriptor::getFieldPropertyNames(int field) const @@ -465,6 +483,7 @@ std::string ComputationTimerMessageDescriptor::getFieldValueAsString(omnetpp::an case FIELD_indexHost: return long2string(pp->getIndexHost()); case FIELD_loadHost: return double2string(pp->getLoadHost()); case FIELD_taskComputationTime: return double2string(pp->getTaskComputationTime()); + case FIELD_loadBalancingID: return long2string(pp->getLoadBalancingID()); default: return ""; } } @@ -485,6 +504,7 @@ void ComputationTimerMessageDescriptor::setFieldValueAsString(omnetpp::any_ptr o case FIELD_indexHost: pp->setIndexHost(string2long(value)); break; case FIELD_loadHost: pp->setLoadHost(string2double(value)); break; case FIELD_taskComputationTime: pp->setTaskComputationTime(string2double(value)); break; + case FIELD_loadBalancingID: pp->setLoadBalancingID(string2long(value)); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'ComputationTimerMessage'", field); } } @@ -503,6 +523,7 @@ omnetpp::cValue ComputationTimerMessageDescriptor::getFieldValue(omnetpp::any_pt case FIELD_indexHost: return pp->getIndexHost(); case FIELD_loadHost: return pp->getLoadHost(); case FIELD_taskComputationTime: return pp->getTaskComputationTime(); + case FIELD_loadBalancingID: return pp->getLoadBalancingID(); default: throw omnetpp::cRuntimeError("Cannot return field %d of class 'ComputationTimerMessage' as cValue -- field index out of range?", field); } } @@ -523,6 +544,7 @@ void ComputationTimerMessageDescriptor::setFieldValue(omnetpp::any_ptr object, i case FIELD_indexHost: pp->setIndexHost(omnetpp::checked_int_cast(value.intValue())); break; case FIELD_loadHost: pp->setLoadHost(value.doubleValue()); break; case FIELD_taskComputationTime: pp->setTaskComputationTime(value.doubleValue()); break; + case FIELD_loadBalancingID: pp->setLoadBalancingID(omnetpp::checked_int_cast(value.intValue())); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'ComputationTimerMessage'", field); } } diff --git a/src/app/messages/ComputationTimerMessage_m.h b/src/app/messages/ComputationTimerMessage_m.h index bfd1c94..918a0fa 100644 --- a/src/app/messages/ComputationTimerMessage_m.h +++ b/src/app/messages/ComputationTimerMessage_m.h @@ -41,6 +41,7 @@ namespace task_offloading { * int indexHost; * double loadHost; * double taskComputationTime; + * int loadBalancingID; * } * */ @@ -51,6 +52,7 @@ class ComputationTimerMessage : public ::veins::BaseFrame1609_4 int indexHost = 0; double loadHost = 0; double taskComputationTime = 0; + int loadBalancingID = 0; private: void copy(const ComputationTimerMessage& other); @@ -78,6 +80,9 @@ class ComputationTimerMessage : public ::veins::BaseFrame1609_4 virtual double getTaskComputationTime() const; virtual void setTaskComputationTime(double taskComputationTime); + + virtual int getLoadBalancingID() const; + virtual void setLoadBalancingID(int loadBalancingID); }; inline void doParsimPacking(omnetpp::cCommBuffer *b, const ComputationTimerMessage& obj) {obj.parsimPack(b);} diff --git a/src/app/messages/OkMessage.msg b/src/app/messages/OkMessage.msg index 7d05cfc..2a39004 100644 --- a/src/app/messages/OkMessage.msg +++ b/src/app/messages/OkMessage.msg @@ -21,6 +21,7 @@ namespace task_offloading; packet OkMessage extends veins::BaseFrame1609_4 { int hostID; + string index; double availableLoad; double cpuFreq; veins::LAddress::L2Type senderAddress = -1; diff --git a/src/app/messages/OkMessage_m.cc b/src/app/messages/OkMessage_m.cc index 1b58845..f09a946 100644 --- a/src/app/messages/OkMessage_m.cc +++ b/src/app/messages/OkMessage_m.cc @@ -178,6 +178,7 @@ OkMessage& OkMessage::operator=(const OkMessage& other) void OkMessage::copy(const OkMessage& other) { this->hostID = other.hostID; + this->index = other.index; this->availableLoad = other.availableLoad; this->cpuFreq = other.cpuFreq; this->senderAddress = other.senderAddress; @@ -187,6 +188,7 @@ void OkMessage::parsimPack(omnetpp::cCommBuffer *b) const { ::veins::BaseFrame1609_4::parsimPack(b); doParsimPacking(b,this->hostID); + doParsimPacking(b,this->index); doParsimPacking(b,this->availableLoad); doParsimPacking(b,this->cpuFreq); doParsimPacking(b,this->senderAddress); @@ -196,6 +198,7 @@ void OkMessage::parsimUnpack(omnetpp::cCommBuffer *b) { ::veins::BaseFrame1609_4::parsimUnpack(b); doParsimUnpacking(b,this->hostID); + doParsimUnpacking(b,this->index); doParsimUnpacking(b,this->availableLoad); doParsimUnpacking(b,this->cpuFreq); doParsimUnpacking(b,this->senderAddress); @@ -211,6 +214,16 @@ void OkMessage::setHostID(int hostID) this->hostID = hostID; } +const char * OkMessage::getIndex() const +{ + return this->index.c_str(); +} + +void OkMessage::setIndex(const char * index) +{ + this->index = index; +} + double OkMessage::getAvailableLoad() const { return this->availableLoad; @@ -247,6 +260,7 @@ class OkMessageDescriptor : public omnetpp::cClassDescriptor mutable const char **propertyNames; enum FieldConstants { FIELD_hostID, + FIELD_index, FIELD_availableLoad, FIELD_cpuFreq, FIELD_senderAddress, @@ -316,7 +330,7 @@ const char *OkMessageDescriptor::getProperty(const char *propertyName) const int OkMessageDescriptor::getFieldCount() const { omnetpp::cClassDescriptor *base = getBaseClassDescriptor(); - return base ? 4+base->getFieldCount() : 4; + return base ? 5+base->getFieldCount() : 5; } unsigned int OkMessageDescriptor::getFieldTypeFlags(int field) const @@ -329,11 +343,12 @@ unsigned int OkMessageDescriptor::getFieldTypeFlags(int field) const } static unsigned int fieldTypeFlags[] = { FD_ISEDITABLE, // FIELD_hostID + FD_ISEDITABLE, // FIELD_index FD_ISEDITABLE, // FIELD_availableLoad FD_ISEDITABLE, // FIELD_cpuFreq 0, // FIELD_senderAddress }; - return (field >= 0 && field < 4) ? fieldTypeFlags[field] : 0; + return (field >= 0 && field < 5) ? fieldTypeFlags[field] : 0; } const char *OkMessageDescriptor::getFieldName(int field) const @@ -346,11 +361,12 @@ const char *OkMessageDescriptor::getFieldName(int field) const } static const char *fieldNames[] = { "hostID", + "index", "availableLoad", "cpuFreq", "senderAddress", }; - return (field >= 0 && field < 4) ? fieldNames[field] : nullptr; + return (field >= 0 && field < 5) ? fieldNames[field] : nullptr; } int OkMessageDescriptor::findField(const char *fieldName) const @@ -358,9 +374,10 @@ int OkMessageDescriptor::findField(const char *fieldName) const omnetpp::cClassDescriptor *base = getBaseClassDescriptor(); int baseIndex = base ? base->getFieldCount() : 0; if (strcmp(fieldName, "hostID") == 0) return baseIndex + 0; - if (strcmp(fieldName, "availableLoad") == 0) return baseIndex + 1; - if (strcmp(fieldName, "cpuFreq") == 0) return baseIndex + 2; - if (strcmp(fieldName, "senderAddress") == 0) return baseIndex + 3; + if (strcmp(fieldName, "index") == 0) return baseIndex + 1; + if (strcmp(fieldName, "availableLoad") == 0) return baseIndex + 2; + if (strcmp(fieldName, "cpuFreq") == 0) return baseIndex + 3; + if (strcmp(fieldName, "senderAddress") == 0) return baseIndex + 4; return base ? base->findField(fieldName) : -1; } @@ -374,11 +391,12 @@ const char *OkMessageDescriptor::getFieldTypeString(int field) const } static const char *fieldTypeStrings[] = { "int", // FIELD_hostID + "string", // FIELD_index "double", // FIELD_availableLoad "double", // FIELD_cpuFreq "veins::LAddress::L2Type", // FIELD_senderAddress }; - return (field >= 0 && field < 4) ? fieldTypeStrings[field] : nullptr; + return (field >= 0 && field < 5) ? fieldTypeStrings[field] : nullptr; } const char **OkMessageDescriptor::getFieldPropertyNames(int field) const @@ -462,6 +480,7 @@ std::string OkMessageDescriptor::getFieldValueAsString(omnetpp::any_ptr object, OkMessage *pp = omnetpp::fromAnyPtr(object); (void)pp; switch (field) { case FIELD_hostID: return long2string(pp->getHostID()); + case FIELD_index: return oppstring2string(pp->getIndex()); case FIELD_availableLoad: return double2string(pp->getAvailableLoad()); case FIELD_cpuFreq: return double2string(pp->getCpuFreq()); case FIELD_senderAddress: return ""; @@ -482,6 +501,7 @@ void OkMessageDescriptor::setFieldValueAsString(omnetpp::any_ptr object, int fie OkMessage *pp = omnetpp::fromAnyPtr(object); (void)pp; switch (field) { case FIELD_hostID: pp->setHostID(string2long(value)); break; + case FIELD_index: pp->setIndex((value)); break; case FIELD_availableLoad: pp->setAvailableLoad(string2double(value)); break; case FIELD_cpuFreq: pp->setCpuFreq(string2double(value)); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'OkMessage'", field); @@ -499,6 +519,7 @@ omnetpp::cValue OkMessageDescriptor::getFieldValue(omnetpp::any_ptr object, int OkMessage *pp = omnetpp::fromAnyPtr(object); (void)pp; switch (field) { case FIELD_hostID: return pp->getHostID(); + case FIELD_index: return pp->getIndex(); case FIELD_availableLoad: return pp->getAvailableLoad(); case FIELD_cpuFreq: return pp->getCpuFreq(); case FIELD_senderAddress: return omnetpp::toAnyPtr(&pp->getSenderAddress()); break; @@ -519,6 +540,7 @@ void OkMessageDescriptor::setFieldValue(omnetpp::any_ptr object, int field, int OkMessage *pp = omnetpp::fromAnyPtr(object); (void)pp; switch (field) { case FIELD_hostID: pp->setHostID(omnetpp::checked_int_cast(value.intValue())); break; + case FIELD_index: pp->setIndex(value.stringValue()); break; case FIELD_availableLoad: pp->setAvailableLoad(value.doubleValue()); break; case FIELD_cpuFreq: pp->setCpuFreq(value.doubleValue()); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'OkMessage'", field); diff --git a/src/app/messages/OkMessage_m.h b/src/app/messages/OkMessage_m.h index 1d1bb5f..2e0c743 100644 --- a/src/app/messages/OkMessage_m.h +++ b/src/app/messages/OkMessage_m.h @@ -38,6 +38,7 @@ namespace task_offloading { * packet OkMessage extends veins::BaseFrame1609_4 * { * int hostID; + * string index; * double availableLoad; * double cpuFreq; * veins::LAddress::L2Type senderAddress = -1; @@ -48,6 +49,7 @@ class OkMessage : public ::veins::BaseFrame1609_4 { protected: int hostID = 0; + ::omnetpp::opp_string index; double availableLoad = 0; double cpuFreq = 0; ::veins::LAddress::L2Type senderAddress = -1; @@ -70,6 +72,9 @@ class OkMessage : public ::veins::BaseFrame1609_4 virtual int getHostID() const; virtual void setHostID(int hostID); + virtual const char * getIndex() const; + virtual void setIndex(const char * index); + virtual double getAvailableLoad() const; virtual void setAvailableLoad(double availableLoad); diff --git a/src/app/messages/ResponseMessage.msg b/src/app/messages/ResponseMessage.msg index 59c7c89..68c4197 100644 --- a/src/app/messages/ResponseMessage.msg +++ b/src/app/messages/ResponseMessage.msg @@ -22,4 +22,5 @@ namespace task_offloading; packet ResponseMessage extends veins::BaseFrame1609_4 { int hostIndex; bool stillAvailable; + double dataComputed; } diff --git a/src/app/messages/ResponseMessage_m.cc b/src/app/messages/ResponseMessage_m.cc index 72b22e3..c64498f 100644 --- a/src/app/messages/ResponseMessage_m.cc +++ b/src/app/messages/ResponseMessage_m.cc @@ -179,6 +179,7 @@ void ResponseMessage::copy(const ResponseMessage& other) { this->hostIndex = other.hostIndex; this->stillAvailable = other.stillAvailable; + this->dataComputed = other.dataComputed; } void ResponseMessage::parsimPack(omnetpp::cCommBuffer *b) const @@ -186,6 +187,7 @@ void ResponseMessage::parsimPack(omnetpp::cCommBuffer *b) const ::veins::BaseFrame1609_4::parsimPack(b); doParsimPacking(b,this->hostIndex); doParsimPacking(b,this->stillAvailable); + doParsimPacking(b,this->dataComputed); } void ResponseMessage::parsimUnpack(omnetpp::cCommBuffer *b) @@ -193,6 +195,7 @@ void ResponseMessage::parsimUnpack(omnetpp::cCommBuffer *b) ::veins::BaseFrame1609_4::parsimUnpack(b); doParsimUnpacking(b,this->hostIndex); doParsimUnpacking(b,this->stillAvailable); + doParsimUnpacking(b,this->dataComputed); } int ResponseMessage::getHostIndex() const @@ -215,6 +218,16 @@ void ResponseMessage::setStillAvailable(bool stillAvailable) this->stillAvailable = stillAvailable; } +double ResponseMessage::getDataComputed() const +{ + return this->dataComputed; +} + +void ResponseMessage::setDataComputed(double dataComputed) +{ + this->dataComputed = dataComputed; +} + class ResponseMessageDescriptor : public omnetpp::cClassDescriptor { private: @@ -222,6 +235,7 @@ class ResponseMessageDescriptor : public omnetpp::cClassDescriptor enum FieldConstants { FIELD_hostIndex, FIELD_stillAvailable, + FIELD_dataComputed, }; public: ResponseMessageDescriptor(); @@ -288,7 +302,7 @@ const char *ResponseMessageDescriptor::getProperty(const char *propertyName) con int ResponseMessageDescriptor::getFieldCount() const { omnetpp::cClassDescriptor *base = getBaseClassDescriptor(); - return base ? 2+base->getFieldCount() : 2; + return base ? 3+base->getFieldCount() : 3; } unsigned int ResponseMessageDescriptor::getFieldTypeFlags(int field) const @@ -302,8 +316,9 @@ unsigned int ResponseMessageDescriptor::getFieldTypeFlags(int field) const static unsigned int fieldTypeFlags[] = { FD_ISEDITABLE, // FIELD_hostIndex FD_ISEDITABLE, // FIELD_stillAvailable + FD_ISEDITABLE, // FIELD_dataComputed }; - return (field >= 0 && field < 2) ? fieldTypeFlags[field] : 0; + return (field >= 0 && field < 3) ? fieldTypeFlags[field] : 0; } const char *ResponseMessageDescriptor::getFieldName(int field) const @@ -317,8 +332,9 @@ const char *ResponseMessageDescriptor::getFieldName(int field) const static const char *fieldNames[] = { "hostIndex", "stillAvailable", + "dataComputed", }; - return (field >= 0 && field < 2) ? fieldNames[field] : nullptr; + return (field >= 0 && field < 3) ? fieldNames[field] : nullptr; } int ResponseMessageDescriptor::findField(const char *fieldName) const @@ -327,6 +343,7 @@ int ResponseMessageDescriptor::findField(const char *fieldName) const int baseIndex = base ? base->getFieldCount() : 0; if (strcmp(fieldName, "hostIndex") == 0) return baseIndex + 0; if (strcmp(fieldName, "stillAvailable") == 0) return baseIndex + 1; + if (strcmp(fieldName, "dataComputed") == 0) return baseIndex + 2; return base ? base->findField(fieldName) : -1; } @@ -341,8 +358,9 @@ const char *ResponseMessageDescriptor::getFieldTypeString(int field) const static const char *fieldTypeStrings[] = { "int", // FIELD_hostIndex "bool", // FIELD_stillAvailable + "double", // FIELD_dataComputed }; - return (field >= 0 && field < 2) ? fieldTypeStrings[field] : nullptr; + return (field >= 0 && field < 3) ? fieldTypeStrings[field] : nullptr; } const char **ResponseMessageDescriptor::getFieldPropertyNames(int field) const @@ -427,6 +445,7 @@ std::string ResponseMessageDescriptor::getFieldValueAsString(omnetpp::any_ptr ob switch (field) { case FIELD_hostIndex: return long2string(pp->getHostIndex()); case FIELD_stillAvailable: return bool2string(pp->getStillAvailable()); + case FIELD_dataComputed: return double2string(pp->getDataComputed()); default: return ""; } } @@ -445,6 +464,7 @@ void ResponseMessageDescriptor::setFieldValueAsString(omnetpp::any_ptr object, i switch (field) { case FIELD_hostIndex: pp->setHostIndex(string2long(value)); break; case FIELD_stillAvailable: pp->setStillAvailable(string2bool(value)); break; + case FIELD_dataComputed: pp->setDataComputed(string2double(value)); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'ResponseMessage'", field); } } @@ -461,6 +481,7 @@ omnetpp::cValue ResponseMessageDescriptor::getFieldValue(omnetpp::any_ptr object switch (field) { case FIELD_hostIndex: return pp->getHostIndex(); case FIELD_stillAvailable: return pp->getStillAvailable(); + case FIELD_dataComputed: return pp->getDataComputed(); default: throw omnetpp::cRuntimeError("Cannot return field %d of class 'ResponseMessage' as cValue -- field index out of range?", field); } } @@ -479,6 +500,7 @@ void ResponseMessageDescriptor::setFieldValue(omnetpp::any_ptr object, int field switch (field) { case FIELD_hostIndex: pp->setHostIndex(omnetpp::checked_int_cast(value.intValue())); break; case FIELD_stillAvailable: pp->setStillAvailable(value.boolValue()); break; + case FIELD_dataComputed: pp->setDataComputed(value.doubleValue()); break; default: throw omnetpp::cRuntimeError("Cannot set field %d of class 'ResponseMessage'", field); } } diff --git a/src/app/messages/ResponseMessage_m.h b/src/app/messages/ResponseMessage_m.h index 3f59bc3..feed5e5 100644 --- a/src/app/messages/ResponseMessage_m.h +++ b/src/app/messages/ResponseMessage_m.h @@ -39,6 +39,7 @@ namespace task_offloading { * { * int hostIndex; * bool stillAvailable; + * double dataComputed; * } * */ @@ -47,6 +48,7 @@ class ResponseMessage : public ::veins::BaseFrame1609_4 protected: int hostIndex = 0; bool stillAvailable = false; + double dataComputed = 0; private: void copy(const ResponseMessage& other); @@ -68,6 +70,9 @@ class ResponseMessage : public ::veins::BaseFrame1609_4 virtual bool getStillAvailable() const; virtual void setStillAvailable(bool stillAvailable); + + virtual double getDataComputed() const; + virtual void setDataComputed(double dataComputed); }; inline void doParsimPacking(omnetpp::cCommBuffer *b, const ResponseMessage& obj) {obj.parsimPack(b);} diff --git a/src/app/messagesHandling/DataMessageHandler.cc b/src/app/messagesHandling/DataMessageHandler.cc index 2545908..29124e8 100644 --- a/src/app/messagesHandling/DataMessageHandler.cc +++ b/src/app/messagesHandling/DataMessageHandler.cc @@ -52,6 +52,7 @@ void VeinsApp::handleDataMessage(DataMessage* dataMsg) bool stillAvailable = par("stillAvailableProbability").doubleValue() > par("stillAvailableThreshold").doubleValue(); responseMsg->setStillAvailable(stillAvailable); + responseMsg->setDataComputed(dataMsg->getLoadToProcess()); scheduleAt(simTime() + timeToCompute, responseMsg); // Generate ACK timer if parameter useAcks is false diff --git a/src/app/messagesHandling/HelpMessageHandler.cc b/src/app/messagesHandling/HelpMessageHandler.cc index 95b6cbb..a51834c 100644 --- a/src/app/messagesHandling/HelpMessageHandler.cc +++ b/src/app/messagesHandling/HelpMessageHandler.cc @@ -47,6 +47,7 @@ void VeinsApp::handleHelpMessage(HelpMessage* helpMsg) okMsg->setHostID(findHost()->getIndex()); okMsg->setAvailableLoad(actualLoad); okMsg->setCpuFreq(cpuFreq); + okMsg->setIndex(findHost()->getName()); // Emit the signal of the ok message load emit(okMessageLoad, actualLoad); diff --git a/src/app/messagesHandling/OkMessageHandler.cc b/src/app/messagesHandling/OkMessageHandler.cc index 07b57f8..f4373df 100644 --- a/src/app/messagesHandling/OkMessageHandler.cc +++ b/src/app/messagesHandling/OkMessageHandler.cc @@ -24,11 +24,14 @@ void VeinsApp::handleOkMessage(OkMessage* okMsg) if (okMsg->getAvailableLoad() >= par("minimumVehicleLoadActual").doubleValue()) { // Color the bus that received help findHost()->getDisplayString().setTagArg("i", 1, "green"); + std::string currentHostIndex = okMsg->getIndex() + std::to_string(okMsg->getHostID()); + double currentLoad = okMsg->getAvailableLoad(); + double CPUFreq = okMsg->getCpuFreq(); + veins::LAddress::L2Type address = okMsg->getSenderAddress(); - helpers[okMsg->getHostID()] = HelperVehicleInfo(); - helpers[okMsg->getHostID()].setCurrentLoad(okMsg->getAvailableLoad()); - helpers[okMsg->getHostID()].setCPUFreq(okMsg->getCpuFreq()); - helpers[okMsg->getHostID()].setAddress(okMsg->getSenderAddress()); + helpers[okMsg->getHostID()] = HelperVehicleInfo(currentHostIndex, currentLoad, CPUFreq, address); + + okReceived++; } } } diff --git a/src/app/messagesHandling/ResponseMessageHandler.cc b/src/app/messagesHandling/ResponseMessageHandler.cc index dd18e60..b32eb89 100644 --- a/src/app/messagesHandling/ResponseMessageHandler.cc +++ b/src/app/messagesHandling/ResponseMessageHandler.cc @@ -20,35 +20,77 @@ using namespace task_offloading; void VeinsApp::handleResponseMessage(ResponseMessage* responseMsg) { - if (findHost()->getIndex() == busIndex && (!(par("useAcks").boolValue()))) { - // Send ACK message to the host - AckMessage* ackMsg = new AckMessage(); - populateWSM(ackMsg); - ackMsg->setHostIndex(responseMsg->getHostIndex()); - scheduleAt(simTime(), ackMsg); - } + if (findHost()->getIndex() == busIndex) { + responsesReceived++; + EV << "Received data from host: " << responseMsg->getHostIndex() << std::endl; + + // Update global parameter data + double data = par("computationLoad").doubleValue() - responseMsg->getDataComputed(); - if (findHost()->getIndex() == busIndex && !(responseMsg->getStillAvailable())) { - helpers.erase(responseMsg->getHostIndex()); - EV << "Deleted host: " << responseMsg->getHostIndex() << std::endl <<"Host remaining: " << helpers.size() - 1 << std::endl; + EV << "Computed: " << responseMsg->getDataComputed() << std::endl << "Remaining: " << data << std::endl; - // Check if there is more data to load at the end of the last response - // message, to send signal of task terminated - if(!(par("computationLoad").doubleValue() > 0)) { - emit(stopTask, simTime()); + if (!(par("useAcks").boolValue())) { + // Send ACK message to the host + AckMessage* ackMsg = new AckMessage(); + populateWSM(ackMsg); + ackMsg->setHostIndex(responseMsg->getHostIndex()); + scheduleAt(simTime(), ackMsg); } - // Send signal for having received response message statistic - emit(stopResponseMessages, responseMsg->getHostIndex()); + if (!(responseMsg->getStillAvailable())) { + helpers.erase(responseMsg->getHostIndex()); + helpersOrderedList.remove(responseMsg->getHostIndex()); + EV << "Deleted host: " << responseMsg->getHostIndex() << std::endl <<"Host remaining: " << helpers.size() - 1 << std::endl; + + // Check if there is more data to load at the end of the last response + // message, to send signal of task terminated + if(!(par("computationLoad").doubleValue() > 0)) { + emit(stopTask, simTime()); + } + + // Send signal for having received response message statistic + emit(stopResponseMessages, responseMsg->getHostIndex()); + + if (helpers.size() == 1) { + findHost()->getDisplayString().setTagArg("i", 1, "white"); + helpReceived = false; + sentHelpMessage = false; + newRandomTime = simTime(); + + // Disable the load balancing mode + loadBalancingState.setState(new Disabled); + } + } + + if (data > 0) { + par("computationLoad").setDoubleValue(data); + } else { + par("computationLoad").setDoubleValue(0); + + // Reset ok and responses + responsesReceived = 0; + okReceived = 0; + } + + // If the responses are equal to the total of vehicles update map and restart load balancing + if (responsesReceived == okReceived) { + EV << "Responses received: " << responsesReceived << std::endl; + EV << "Ok received: " << okReceived << std::endl; + responsesReceived = 0; + + if (helpers.size() > 1 && data > 0) { + okReceived = helpers.size() - 1; + + // Increment the ID of load balancing + loadBalancingID++; - if (helpers.size() == 1) { - findHost()->getDisplayString().setTagArg("i", 1, "white"); - helpReceived = false; - sentHelpMessage = false; - newRandomTime = simTime(); + // Restart load balancing + balanceLoad(simTime()); + } else { + okReceived = 0; + } - // Disable the load balancing mode - loadBalancingState.setState(new Disabled); + EV << "Total data remaining: " << par("computationLoad").doubleValue() << std::endl; } } } diff --git a/src/app/secureProtocol/SendAgainDataMessage.cc b/src/app/secureProtocol/SendAgainDataMessage.cc index cb40726..0ccef0f 100644 --- a/src/app/secureProtocol/SendAgainDataMessage.cc +++ b/src/app/secureProtocol/SendAgainDataMessage.cc @@ -18,10 +18,10 @@ using namespace task_offloading; -void VeinsApp::sendAgainData(int index, double load, double taskComputationTime) +void VeinsApp::sendAgainData(int index, double load, double taskComputationTime, int loadBalanceProgressiveNumber) { auto found = helpers.find(index); - if (found != helpers.end()) { + if (found != helpers.end() && (loadBalancingID == loadBalanceProgressiveNumber)) { // Prepare the new data message DataMessage* dataMsg = new DataMessage(); populateWSM(dataMsg); diff --git a/src/app/vehiclesHandling/HelperVehicleInfo.cc b/src/app/vehiclesHandling/HelperVehicleInfo.cc index 48afcc6..73db7d4 100644 --- a/src/app/vehiclesHandling/HelperVehicleInfo.cc +++ b/src/app/vehiclesHandling/HelperVehicleInfo.cc @@ -18,16 +18,18 @@ using namespace task_offloading; HelperVehicleInfo::HelperVehicleInfo() { + this->index = "auto0"; this->hostCurrentLoad = 0; this->hostCPUFreq = 0; this->createdAt = simTime(); this->address = 0; } -HelperVehicleInfo::HelperVehicleInfo(double load, double freq, simtime_t time, veins::LAddress::L2Type address) { +HelperVehicleInfo::HelperVehicleInfo(std::string index, double load, double freq, veins::LAddress::L2Type address) { + this->index = index; this->hostCurrentLoad = load; this->hostCPUFreq = freq; - this->createdAt = time; + this->createdAt = simTime(); this->address = address; } @@ -35,6 +37,13 @@ HelperVehicleInfo::~HelperVehicleInfo() { // } +/** + * @returns Current index of a vehicle + */ +std::string HelperVehicleInfo::getIndex() { + return this->index; +} + /** * @returns Current load of a vehicle in MB */ @@ -63,6 +72,15 @@ veins::LAddress::L2Type HelperVehicleInfo::getAddress() { return this->address; } +/** + * Set the current index of a vehicle + * + * @param newIndex The new index of a vehicle + */ +void HelperVehicleInfo::setIndex(std::string index) { + this->index = index; +} + /** * Set the current load of a vehicle * diff --git a/src/app/vehiclesHandling/HelperVehicleInfo.h b/src/app/vehiclesHandling/HelperVehicleInfo.h index d68f62f..d6e32d9 100644 --- a/src/app/vehiclesHandling/HelperVehicleInfo.h +++ b/src/app/vehiclesHandling/HelperVehicleInfo.h @@ -22,19 +22,23 @@ namespace task_offloading { class HelperVehicleInfo { private: + std::string index; double hostCurrentLoad; double hostCPUFreq; simtime_t createdAt; veins::LAddress::L2Type address; + // TO-DO add traCI vector infos about speed and direction public: HelperVehicleInfo(); - HelperVehicleInfo(double load, double freq, simtime_t time, veins::LAddress::L2Type address); + HelperVehicleInfo(std::string index, double load, double freq, veins::LAddress::L2Type address); virtual ~HelperVehicleInfo(); + std::string getIndex(); double getCurrentLoad(); double getCPUFreq(); simtime_t getCreatedAt(); veins::LAddress::L2Type getAddress(); + void setIndex(std::string index); void setCurrentLoad(double newLoad); void setCPUFreq(double newFreq); void setCreatedAt(simtime_t newTime); diff --git a/src/app/vehiclesHandling/VehicleHandler.cc b/src/app/vehiclesHandling/VehicleHandler.cc index 83f2b91..186b9be 100644 --- a/src/app/vehiclesHandling/VehicleHandler.cc +++ b/src/app/vehiclesHandling/VehicleHandler.cc @@ -29,6 +29,12 @@ void VeinsApp::vehicleHandler() HelpMessage* helpRequest = new HelpMessage(); populateWSM(helpRequest); + // Fill the map with BUS vehicle info + double busLoad = par("randomVehicleLoadActual").doubleValue() * par("busVehicleLoad").doubleValue(); + double busFreq = par("randomCpuVehicleFreq").doubleValue(); + std::string hostBUSIndex = "node0"; + helpers[0] = HelperVehicleInfo(hostBUSIndex, busLoad, busFreq, busIndex); + // Color the bus findHost()->getDisplayString().setTagArg("i", 1, "red"); diff --git a/src/task_offloading_dbg b/src/task_offloading_dbg index c9413b2..86ad847 100755 Binary files a/src/task_offloading_dbg and b/src/task_offloading_dbg differ