GensetModule.update_status#

GensetModule.update_status(goal_status)[source]#

Update the status of the microgrid.

The status and goal status are updated, taking into account any in-progress status change as well as goal_status. This method updates the internal properties self.current_status, self.goal_status, self.steps_until_up, and self.steps_until_down as follows:

  1. If steps_until_up == 0 or steps_until_down == 0, the status is changed to on and off, respectively. The following steps are then executed.

  2. If goal_status == self.current_status == self.goal_status, the genset is in equilibrium and its status does not change.

    In this case, one of self.steps_until_up/self.steps_until_down should be zero – the former if self.current_status and the latter if not – and the other should be self.start_up_time/self.wind_down_time, respectively.

  3. If goal_status == self.current_status != self.goal_status, we are trying to abort a status change.

    • If self.allow_abortion, the abortion can succeed. self.goal_status changes to goal_status and steps_until_up/steps_until_down are reset (one to zero, one to the corresponding self.start_up_time/self.wind_down_time).

    • Otherwise, we proceed with an in-progress status change, and the corresponding steps_until_up/steps_until_down is incremented. This is identical to the case below.

  4. If goal_status == self.goal_status != self.current_status, a previously requested status change is being continued, and the corresponding steps_until_up/steps_until_down is incremented.

Note

Steps 2, 3, and 4 are mutually exclusive, while step 1 is not and will be executed before the relevant step 2, 3 or 4.

Parameters#

goal_statusfloat in [0, 1].

Goal status as defined by an external action.

Will be rounded to 0 or 1 to define the goal status.