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 propertiesself.current_status,self.goal_status,self.steps_until_up, andself.steps_until_downas follows:If
steps_until_up == 0orsteps_until_down == 0, the status is changed to on and off, respectively. The following steps are then executed.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_downshould be zero – the former ifself.current_statusand the latter if not – and the other should beself.start_up_time/self.wind_down_time, respectively.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_statuschanges togoal_statusandsteps_until_up/steps_until_downare reset (one to zero, one to the correspondingself.start_up_time/self.wind_down_time).Otherwise, we proceed with an in-progress status change, and the corresponding
steps_until_up/steps_until_downis incremented. This is identical to the case below.
If
goal_status == self.goal_status != self.current_status, a previously requested status change is being continued, and the correspondingsteps_until_up/steps_until_downis 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.