class_docstr: Very simple model of a power system.
  Real life is more complicated!
  
  Parameters
  ----------
  num_dams: int
      number of dams to be managed
  depth: int
      number of layers in the neural networks
  width: int
      number of neurons per hidden layer
  year_to_day_ratio: float = 2.
      Ratio between std of consumption in the year and std of consumption in the day.
  constant_to_year_ratio: float
      Ratio between constant baseline consumption and std of consumption in the year.
  back_to_normal: float
      Part of the variability which is forgotten at each time step.
  consumption_noise: float
      Instantaneous variability.
  num_thermal_plants: int
      Number of thermal plants.
  num_years: float
      Number of years.
  failure_cost: float
      Cost of not satisfying the demand. Equivalent to an expensive infinite capacity thermal plant.
class_docstr_tok: ["Very","simple","model","of","a","power","system",".","Real","life","is","more","complicated","!","Parameters","--","--","--","--","--","num_dams",":","int","number","of","dams","to","be","managed","depth",":","int","number","of","layers","in","the","neural","networks","width",":","int","number","of","neurons","per","hidden","layer","year_to_day_ratio",":","float","=","2",".","Ratio","between","std","of","consumption","in","the","year","and","std","of","consumption","in","the","day",".","constant_to_year_ratio",":","float","Ratio","between","constant","baseline","consumption","and","std","of","consumption","in","the","year",".","back_to_normal",":","float","Part","of","the","variability","which","is","forgotten","at","each","time","step",".","consumption_noise",":","float","Instantaneous","variability",".","num_thermal_plants",":","int","Number","of","thermal","plants",".","num_years",":","float","Number","of","years",".","failure_cost",":","float","Cost","of","not","satisfying","the","demand",".","Equivalent","to","an","expensive","infinite","capacity","thermal","plant","."]
code: def __init__(
      self,
      num_dams: int = 13,
      depth: int = 3,
      width: int = 3,
      year_to_day_ratio: float = 2.0,
      constant_to_year_ratio: float = 1.0,
      back_to_normal: float = 0.5,
      consumption_noise: float = 0.1,
      num_thermal_plants: int = 7,
      num_years: float = 1.0,
      failure_cost: float = 500.0,
  ) -> None:
      self.num_dams = num_dams
      self.losses: tp.List[float] = []
      self.marginal_costs: tp.List[float] = []
      # Parameters describing the problem.
      self.year_to_day_ratio = year_to_day_ratio
      self.constant_to_year_ratio = constant_to_year_ratio
      self.back_to_normal = back_to_normal
      self.consumption_noise = consumption_noise
      self.num_thermal_plants = num_thermal_plants
      self.number_of_years = num_years
      self.failure_cost = failure_cost
      self.hydro_prod_per_time_step: tp.List[
          tp.Any
      ] = []  # TODO @oteytaud initial values?
      self.consumption_per_time_step: tp.List[tp.Any] = []
  
      self.average_consumption = (
          self.constant_to_year_ratio * self.year_to_day_ratio
      )
      self.thermal_power_capacity = (
          self.average_consumption
          * np.random.rand(self.num_thermal_plants)
      )
      self.thermal_power_prices = np.random.rand(num_thermal_plants)
      self.dam_agents = [
          Agent(
              10 + num_dams + 2 * self.num_thermal_plants, depth, width
          )
          for _ in range(num_dams)
      ]
      parameter = p.Instrumentation(
          *[p.Array(shape=(int(a.dimension),)) for a in self.dam_agents]
      ).set_name("")
      super().__init__(self._simulate_power_system, parameter)
      self.parametrization.function.deterministic = False
  
file_path: nevergrad/nevergrad/functions/powersystems/core.py
imports: import typing
  from math import pi, cos, sin
  import matplotlib.pyplot
  import numpy
  from nevergrad.parametrization import parameter
  from ..base import ExperimentFunction
label_desc: Use image node_id 1 to create a new PowerSystem object from inherited base classes: ExperimentFunction with example: obj = PowerSystem(num_dams, depth, width, year_to_day_ratio, constant_to_year_ratio, back_to_normal, consumption_noise, num_thermal_plants, num_years, failure_cost)