+/** @ingroup plugin_chiller
+ * @return Time of the next event, i.e.,
+ when the chiller will reach the goal temp if possible, -1 otherwise.
+ */
+double Chiller::get_next_event()
+{
+ if (not is_active() or goal_temp_c_ <= temp_out_c_)
+ return -1;
+ else {
+ double heat_power_w = 0;
+ for (auto const& host : hosts_)
+ heat_power_w += sg_host_get_current_consumption(host);
+ heat_power_w = heat_power_w * (1 + alpha_);
+ return air_mass_kg_ * (goal_temp_c_ - temp_out_c_) * specific_heat_j_per_kg_per_c_ / heat_power_w;
+ }
+}