double depth_of_discharge_;
double energy_budget_j_;
- // std::map<const s4u::Host*, double> host_loads_ = {};
std::map<const s4u::Host*, bool> host_loads_ = {};
std::map<const std::string, double> named_loads_ = {};
std::vector<std::shared_ptr<Event>> events_;
- double capacity_wh_ = 0;
- double energy_stored_j_ = 0;
+ double capacity_wh_;
+ double energy_stored_j_;
double energy_provided_j_ = 0;
double energy_consumed_j_ = 0;
double last_updated_ = 0;
Battery::Battery(const std::string& name, double state_of_charge, double charge_efficiency, double discharge_efficiency,
double initial_capacity_wh, int cycles, double depth_of_discharge)
: name_(name)
- , energy_stored_j_(state_of_charge * 3600 * initial_capacity_wh)
, charge_efficiency_(charge_efficiency)
, discharge_efficiency_(discharge_efficiency)
, initial_capacity_wh_(initial_capacity_wh)
- , capacity_wh_(initial_capacity_wh)
, cycles_(cycles)
, depth_of_discharge_(depth_of_discharge)
, energy_budget_j_(initial_capacity_wh * depth_of_discharge * 3600 * cycles * 2)
+ , capacity_wh_(initial_capacity_wh)
+ , energy_stored_j_(state_of_charge * 3600 * initial_capacity_wh)
{
xbt_assert(state_of_charge >= 0 and state_of_charge <= 1, " : state of charge should be in [0, 1] (provided: %f)",
state_of_charge);