MainController#

class relsad.network.components.MainController(name: str, ict_node: typing.Optional[relsad.network.components.ICTNode.ICTNode] = None, hardware_fail_rate_per_year: float = 0.2, software_fail_rate_per_year: float = 12, p_fail_repair_new_signal: float = 0.050000000000000044, p_fail_repair_reboot: float = 0.9, new_signal_time: relsad.Time.Time = SEC_2, reboot_time: relsad.Time.Time = MIN_5, manual_software_repair_time: relsad.Time.Time = HOUR_0.3, manual_hardware_repair_time: relsad.Time.Time = HOUR_2.5, manual_sectioning_time: relsad.Time.Time = HOUR_1, state: relsad.network.components.Controller.ControllerState = ControllerState.OK)[source]#

Common class for main controller

name#

Name of the main controller

Type

string

ict_node#

The ICT node connected to the controller

Type

ICTNode

harware_fail_rate_per_year#

The failure rate per year for hardware failuers of the controller

Type

float

software_fail_rate_per_year#

The failure rate per year for software failures of the controller

Type

float

p_fail_repair_new_signal#

The probability tuat a new signal cannot be sent

Type

float

p_fail_reboot#

The probability that a reboot of the controller will fail to fix the failure

Type

float

new_signal_time#

The time it takes to send a new signal

Type

Time

reboot_time#

The time it takes to reboot the controller

Type

Time

remaining_repair_time#

The remaining time of the repair

Type

Time

manual_software_repair_time#

The time it takes to manually repair a software failure

Type

Time

manual_hardware_repair_time#

The time it takes to manually repair a hardware failure

Type

Time

state#

The state of the controller

Type

enum

sectioning_time#

The sectioning time of the system (can differ based on if the controller is OK or not)

Type

Time

manual_sectioning_time#

The sectioning time of a passive system without controller (controller is failed)

Type

Time

distribution_controllers#

List of controllers from the distribution systems in the power system

Type

list

microgrid_controllers#

List of controllers from the microgrids in the power system

Type

list

history#

Dictonary attribute that stores the historic variables

Type

dict

monte_carlo_history#

Dictonary attribute that stores the historic variables from the Monte Carlo simulation

Type

dict

fail_software()[source]#

Sets the controller state to software fail

fail_hardware()[source]#

Sets the controller state to hardware fail

not_fail()[source]#

Sets the controller state to ok (not fail)

draw_fail_status(dt)[source]#

Draws the failure status of the controller

draw_hardware_status(prob)[source]#

Draws if a hardware failure has occured and sets the fail status of the controller

draw_software_status(prob)[source]#

Draws if a software failure has occured and sets the fail status of the controller

repair_software_fail(dt)[source]#

Goes through the repair sequence of a software failure, draws the repair mechanism, returns the repair time and updates the state of the controller

update_fail_status(dt)[source]#

Updates the failure status of the controller based on the remaining outage time

add_distribution_controller(controller)[source]#

Adds distribution controllers from connected distribution systems to a list and sets the sectioning time for the controller. Assignes the ICT node to the distribution system controller.

add_microgrid_controller(controller)[source]#

Adds microgird controllers from connected microgrids to a list and sets the sectioning time for the controller. Assignes the ICT node to the microgrid controller.

run_control_loop(curr_time, dt)[source]#

Runs the control loop for the distribution system controllers and the microgird controllers

spread_sectioning_time_to_sub_controllers()[source]#

Sets the sectioning time for the controllers in the connected distribution systems and microgrids

update_history(prev_time, curr_time, save_flag)[source]#

Updates the history variables

get_history(attribute)[source]#

Returns the history variables of an attribute

add_random_instance(random_gen)[source]#

Adds global random seed

print_status()[source]#

Prints the status

reset_status(save_flag)[source]#

Resets and sets the status of the class parameters

initialize_history()[source]#

Initializes the history variables

MainController.add_distribution_controller(...)

Adds distribution controllers from connected distribution systems to a list and sets the sectioning time for the controller.

MainController.add_microgrid_controller(...)

Adds microgird controllers from connected microgrids to a list and sets the sectioning time for the controller.

MainController.add_random_instance(random_gen)

Adds global random seed

MainController.draw_fail_status(dt)

Draws the failure status of the controller

MainController.draw_hardware_status(prob)

Draws if a hardware failure has occured and sets the fail status of the controller

MainController.draw_software_status(prob)

Draws if a software failure has occured and sets the fail status of the controller

MainController.fail_hardware()

Sets the controller state to hardware fail

MainController.fail_software()

Sets the controller state to software fail

MainController.get_history(attribute)

Returns the history variables of an attribute

MainController.initialize_history()

Initializes the history variables

MainController.not_fail()

Sets the controller state to ok (not fail)

MainController.print_status()

Prints the status

MainController.repair_software_fail(dt)

Goes through the repair sequence of a software failure, draws the repair mechanism, returns the repair time and updates the state of the controller

MainController.reset_status(save_flag)

Resets and sets the status of the class parameters

MainController.run_control_loop(curr_time, dt)

Runs the control loop for the distribution system controllers and the microgird controllers

MainController.spread_sectioning_time_to_sub_controllers()

Sets the sectioning time for the controllers in the connected distribution systems and microgrids

MainController.update_fail_status(dt)

Updates the failure status of the controller based on the remaining outage time

MainController.update_history(prev_time, ...)

Updates the history variables

MainController.ps_random