florasim / flora

This is a set of modules to simulate LoRa networks
Other
53 stars 39 forks source link

How to get energy of nodes #31

Closed danzuha closed 3 years ago

danzuha commented 3 years ago

Hi guys,

Im new to omnett and FLoRa. I need to know how can we get the energy consumed by each nodes after simulated? I stuck with this for quite awhile now, i changed so many thing but still got 0J for energy (as per pic below)

@mariuszslabicki

image

danzuha commented 3 years ago

Perhaps im not checking at the right place?

gpremsan commented 3 years ago

The energy consumed is stored in the variable totalEnergyConsumed for each node. For example, if there's one node in the network, the total energy spent in sending / receiving messages is stored in scalar LoRaNetworkTest.loRaNodes[0].LoRaNic.radio.energyConsumer totalEnergyConsumed in the scalar output file. The unit is Joules.

danzuha commented 3 years ago

The energy consumed is stored in the variable totalEnergyConsumed for each node. For example, if there's one node in the network, the total energy spent in sending / receiving messages is stored in scalar LoRaNetworkTest.loRaNodes[0].LoRaNic.radio.energyConsumer totalEnergyConsumed in the scalar output file. The unit is Joules.

Hi gpremsan

Thanks for the replies, really appreciate it. May I know if where can i get the totalEnergyconsumed scalar? Is there specific file or in GUI? I think i cannot find any match in GUI

fyi, im using the loRaNetworkTest.ini to get to use to this.

mariuszslabicki commented 3 years ago

You need to check scalar output files (usually with .sca name at the end of the filename). They are saved somewhere in the simulation directory, not remember exact path from the top of my head.

danzuha commented 3 years ago

Got it, thanks!