agregator.py
def calculate(self, time, delta_time):
        """
        Calculation step. We compute the schedule for the day during the day-ahead time. This is the optimization
        process / decision operation.
        """

        # Update the cost vector regarding to the time
        # We reduce this vector if we need to recompute during real time. We consider only the remaining slots period
        self._cost = {k: v for k, v in self._cost.items() if k >= time}

        # Compute decision for each delta_time
        # If decision time or if cost has changed
        # We can't update the actual state. So we take decision for the next step.
        if self._cost_has_changed:
            self._recompute_decision_operation_due_to_new_costs(time)

        # Recompute in real time ?
        # Check if we need to recompute the optimization due to a difference of forecast
        # Compare forecast temperature with real temperature and recompute if the difference is to high.
        # Recompute if sufficient of historic
        if time - self.delta_time in self.temperature_optimal.keys():
            self._detect_if_error_and_recompute_if_necessary(time)

        # Historic & Stats
        self.old_temperature = units.value(units.convert(units(self.thermal_process.temperature, units.kelvin), units.celsius))
        self._history_temperature.append(self.old_temperature)
        self._instant_cost = self._cost[time]
        self._total_cost += self._cost[time] * self._power_on[time]
        self._total_power += self._power_on[time] * self.subject.power

        # Decision for the next step
        self._output_value = self.on_value if int(self._power_on[time + delta_time]) == 1 else self.off_value

        Calculation step. We compute the schedule for the day during the day-ahead time. This is the optimization
        process / decision operation.
        
Calculation step. We compute the schedule for the day during the day-ahead time. This is the optimization
process / decision operation.
Calculation step . We compute the schedule for the day during the day - ahead time . This is the optimization process / decision operation .
def calculate(self, time, delta_time):
        self._cost = {k: v for k, v in self._cost.items() if k >= time}
        if self._cost_has_changed:
            self._recompute_decision_operation_due_to_new_costs(time)
        if time - self.delta_time in self.temperature_optimal.keys():
            self._detect_if_error_and_recompute_if_necessary(time)
        self.old_temperature = units.value(units.convert(units(self.thermal_process.temperature, units.kelvin), units.celsius))
        self._history_temperature.append(self.old_temperature)
        self._instant_cost = self._cost[time]
        self._total_cost += self._cost[time] * self._power_on[time]
        self._total_power += self._power_on[time] * self.subject.power
        self._output_value = self.on_value if int(self._power_on[time + delta_time]) == 1 else self.off_value
def calculate ( self , time , delta_time ) : self . _cost = { k : v for k , v in self . _cost . items ( ) if k >= time } if self . _cost_has_changed : self . _recompute_decision_operation_due_to_new_costs ( time ) if time - self . delta_time in self . temperature_optimal . keys ( ) : self . _detect_if_error_and_recompute_if_necessary ( time ) self . old_temperature = units . value ( units . convert ( units ( self . thermal_process . temperature , units . kelvin ) , units . celsius ) ) self . _history_temperature . append ( self . old_temperature ) self . _instant_cost = self . _cost [ time ] self . _total_cost += self . _cost [ time ] * self . _power_on [ time ] self . _total_power += self . _power_on [ time ] * self . subject . power self . _output_value = self . on_value if int ( self . _power_on [ time + delta_time ] ) == 1 else self . off_value
Calculation step.
Calculation step .
"""
        Calculation step. We compute the schedule for the day during the day-ahead time. This is the optimization
        process / decision operation.
        """ # Update the cost vector regarding to the time # We reduce this vector if we need to recompute during real time. We consider only the remaining slots period # Compute decision for each delta_time # If decision time or if cost has changed # We can't update the actual state. So we take decision for the next step. # Recompute in real time ? # Check if we need to recompute the optimization due to a difference of forecast # Compare forecast temperature with real temperature and recompute if the difference is to high. # Recompute if sufficient of historic # Historic & Stats # Decision for the next step
self
time
delta_time