X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/119e971bde4b7caa76543759215f0f0f6839d046..d9c1e4df4ecfc39d84e55527fa05e9bd19f70c6c:/src/plugins/photovoltaic.cpp diff --git a/src/plugins/photovoltaic.cpp b/src/plugins/photovoltaic.cpp index 5a4cd33286..9d8a717baa 100644 --- a/src/plugins/photovoltaic.cpp +++ b/src/plugins/photovoltaic.cpp @@ -1,3 +1,7 @@ +/* Copyright (c) 2023. The SimGrid Team. All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ #include #include #include @@ -214,9 +218,9 @@ void Photovoltaic::update() if (now <= last_updated_) return; double power_w = conversion_efficiency_ * area_m2_ * solar_irradiance_w_per_m2_; - if (min_power_w_ > 0 and power_w_ < min_power_w_) + if (min_power_w_ > 0 && power_w_ < min_power_w_) power_w = 0; - if (max_power_w_ > 0 and power_w_ > max_power_w_) + if (max_power_w_ > 0 && power_w_ > max_power_w_) power_w = max_power_w_; power_w_ = power_w; if (eval_cost_) { @@ -284,4 +288,4 @@ double sg_photovoltaic_get_power(const_sg_host_t host) { ensure_plugin_inited(); return host->extension()->get_power(); -} \ No newline at end of file +}