summaryrefslogtreecommitdiff
path: root/ns3-simulations/nix/simulator/modules/energy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ns3-simulations/nix/simulator/modules/energy.cc')
-rw-r--r--ns3-simulations/nix/simulator/modules/energy.cc22
1 files changed, 11 insertions, 11 deletions
diff --git a/ns3-simulations/nix/simulator/modules/energy.cc b/ns3-simulations/nix/simulator/modules/energy.cc
index c8cca6a..56c38e5 100644
--- a/ns3-simulations/nix/simulator/modules/energy.cc
+++ b/ns3-simulations/nix/simulator/modules/energy.cc
@@ -1,7 +1,7 @@
#include "modules.hpp"
-void setupCellEnergy(Cell cell){
+DeviceEnergyModelContainer setupCellEnergy(Cell cell){
NodeContainer nodes(cell.first.first,cell.first.second);
NetDeviceContainer nodesNetDev(cell.second.first,cell.second.second);
@@ -22,17 +22,17 @@ void setupCellEnergy(Cell cell){
// Trace
- DeviceEnergyModelContainer::Iterator it=edgeDeviceModels.Begin();
- int i=1; // Node 0 will be AP, other node will have negative id (cf following while)
+ // DeviceEnergyModelContainer::Iterator it=edgeDeviceModels.Begin();
+ //int i=1; // Node 0 will be AP, other node will have negative id (cf following while)
// This is usefull in logs, in fact ECOFEN nodes will have positive ID and WIFI energy nodes negative id
// AP will have id 0 in ECOFEN and WIFI (in order to combine their energy value when parsing logs
- while(it!=edgeDeviceModels.End()){
- (*it)->TraceConnect ("TotalEnergyConsumption", std::to_string(0-i),MakeCallback (&EnergyUpdated));
- it++;
- i++;
- }
- // AP will have id 0
- (*edgeApDeviceModels.Begin())->TraceConnect ("TotalEnergyConsumption", std::to_string(0),MakeCallback (&EnergyUpdated));
+ // while(it!=edgeDeviceModels.End()){
+ // (*it)->TraceConnect ("TotalEnergyConsumption", std::to_string(0-i),MakeCallback (&EnergyUpdated));
+ // it++;
+ // i++;
+ // }
+ // // AP will have id 0
+ // (*edgeApDeviceModels.Begin())->TraceConnect ("TotalEnergyConsumption", std::to_string(0),MakeCallback (&EnergyUpdated));
// Ptr<BasicEnergySource> basicSourcePtr0 = DynamicCast<BasicEnergySource> (wifiEdgeNodesSources.Get (0));
// //basicSourcePtr0->TraceConnectWithoutContext ("RemainingEnergy", MakeCallback (&RemainingEnergy));
@@ -41,7 +41,7 @@ void setupCellEnergy(Cell cell){
// basicSourcePtr0->FindDeviceEnergyModels ("ns3::WifiRadioEnergyModel").Get (0);
// NS_ASSERT (basicRadioModelPtr0 != NULL);
// basicRadioModelPtr0->TraceConnectWithoutContext ("TotalEnergyConsumption", MakeCallback (&TotalEnergy));
-
+ return(DeviceEnergyModelContainer(edgeApDeviceModels,edgeDeviceModels));
}
void setupCloudEnergy(CloudInfos cloudInfos){