+/* 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 <simgrid/Exception.hpp>
#include <simgrid/plugins/photovoltaic.hpp>
#include <simgrid/s4u/Actor.hpp>
This plugin allows evaluation of photovoltaic panels power generation during simulation depending on size, solar
irradiance and conversion factor.
+The power model is taken from the paper `"Reinforcement Learning Based Load Balancing for
+Geographically Distributed Data Centres" <https://dro.dur.ac.uk/33395/1/33395.pdf?DDD280+kkgc95+vbdv77>`_ by Max Mackie et. al.
+
+The cost model is taken from the chapter 4 of the thesis `Sizing and Operation of Multi-Energy Hydrogen-Based
+Microgrids <https://tel.archives-ouvertes.fr/tel-02077668/document>`_ by Bei Li.
+
Photovoltaic Panel properties
....................
@endrst
*/
-/*These equations are taken from the paper "Reinforcement Learning Based Load Balancing for
-Geographically Distributed Data Centres" of Max Mackie et. al
-https://dro.dur.ac.uk/33395/1/33395.pdf?DDD280+kkgc95+vbdv77
-*/
-
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(photovoltaic, kernel, "Logging specific to the photovoltaic plugin");
namespace simgrid::plugin {
double power_w_ = 0;
double last_updated_ = 0;
- // Calculation of costs from Bei Li thesis (link :https://tel.archives-ouvertes.fr/tel-02077668/document) (chapter 4)
bool eval_cost_ = false;
double cumulative_cost_ = 0;
int lifespan_years_ = 0;
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_) {
{
ensure_plugin_inited();
return host->extension<Photovoltaic>()->get_power();
-}
\ No newline at end of file
+}