XBT_INFO("Set load to %fW", load_w);
battery->schedule_handler(
- 0.2, simgrid::plugins::Battery::DISCHARGE, simgrid::plugins::Battery::Handler::PERSISTANT, [battery, &load_w]() {
+ 0.2, simgrid::plugins::Battery::DISCHARGE, simgrid::plugins::Battery::Handler::PERSISTANT, [&battery, &load_w]() {
XBT_INFO("Discharged state: SoC: %f SoH: %f Energy stored: %fJ Energy provided: %fJ Energy consumed %fJ",
battery->get_state_of_charge(), battery->get_state_of_health(), battery->get_energy_stored(),
battery->get_energy_provided(), battery->get_energy_consumed());
});
battery->schedule_handler(
- 0.8, simgrid::plugins::Battery::CHARGE, simgrid::plugins::Battery::Handler::PERSISTANT, [battery]() {
+ 0.8, simgrid::plugins::Battery::CHARGE, simgrid::plugins::Battery::Handler::PERSISTANT, [&battery]() {
XBT_INFO("Charged state: SoC: %f SoH: %f Energy stored: %fJ Energy provided: %fJ Energy consumed %fJ",
battery->get_state_of_charge(), battery->get_state_of_health(), battery->get_energy_stored(),
battery->get_energy_provided(), battery->get_energy_consumed());
});
e.run();
+
return 0;
}
\ No newline at end of file