- bool host_was_used = (host_list[i]->extension<HostEnergy>()->last_updated != 0);
- double energy = 0.0;
- energy = host_list[i]->extension<HostEnergy>()->getConsumedEnergy();
- total_energy += energy;
- if (host_was_used)
- used_hosts_energy += energy;
+ if (dynamic_cast<simgrid::s4u::VirtualMachine*>(host_list[i]) == nullptr) { // Ignore virtual machines
+
+ bool host_was_used = (host_list[i]->extension<HostEnergy>()->last_updated != 0);
+ double energy = 0.0;
+ energy = host_list[i]->extension<HostEnergy>()->getConsumedEnergy();
+ total_energy += energy;
+ if (host_was_used)
+ used_hosts_energy += energy;
+ }