Sensor#

class relsad.network.components.Sensor(name: str, line: relsad.network.components.Line.Line, ict_node: Optional[relsad.network.components.ICTNode.ICTNode] = None, fail_rate_per_year: float = 0.023, p_fail_repair_new_signal: float = 0.050000000000000044, p_fail_repair_reboot: float = 0.09999999999999998, new_signal_time: relsad.Time.Time = SEC_2, reboot_time: relsad.Time.Time = MIN_5, manual_repair_time: relsad.Time.Time = HOUR_2, state: relsad.network.components.Sensor.SensorState = SensorState.OK)[source]#

Class defining line sensors …

name#

Name of the sensor

Type

string

line#

The line the sensor is connected to

Type

Line

coordinate#

The coordinate of the sensor

Type

list

ict_node#

The ICT node connected to the sensor

Type

ICTNode

fail_rate_per_year#

The failure rate per year for the sensor

Type

float

p_fail_repair_new_signal#

The probability of a new signal can be sent

Type

float

p_fail_repair_reboot#

The probability that a reboot of the sensor works

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 sensor

Type

Time

manual_repair_time#

The time it takes to manually repair the sensor

Type

Time

state#

Which state the sensor is in

Type

SensorState

remaining_repair_time#

The remaining repair time of the intelligent switch

Type

Time

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()[source]#

Sets the sensor state to FAILED

not_fail()[source]#

Sets the sensor state to OK

draw_fail_status(dt)[source]#

Draws the state of the sensor for a given time step

draw_status(prob)[source]#

Sets the state of the sensor based on the probability of the state being FAILED

repair(dt)[source]#

Returns the repair time and fail status of the sensor

get_line_fail_status(dt)[source]#

Returns the repair time and fail status of the line

get_section()[source]#

Returns the line section

update_fail_status(dt)[source]#

Updates the fail status of the sensor If the state of the sensor is REPAIR, the remaining repair time is set If the state of the sensor is OK, the state of the sensor is drawn

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 instance

print_status()[source]#

Prints the status

reset_status(save_flag)[source]#

Resets the status of the sensor

initialize_history()[source]#

Initializes the history variables

Sensor.add_random_instance(random_gen)

Adds global random instance

Sensor.draw_fail_status(dt)

Draws the state of the sensor for a given time step

Sensor.draw_status(prob)

Sets the state of the sensor based on the probability of the state being FAILED

Sensor.fail()

Sets the sensor state to FAILED

Sensor.get_history(attribute)

Returns the history variables of an attribute

Sensor.get_line_fail_status(dt)

Returns the repair time and fail status of the line

Sensor.get_section()

Returns the line section

Sensor.initialize_history()

Initializes the history variables

Sensor.not_fail()

Sets the sensor state to OK

Sensor.print_status()

Prints the status

Sensor.repair(dt)

Returns the repair time and fail status of the sensor

Sensor.reset_status(save_flag)

Resets the status of the sensor

Sensor.update_fail_status(dt)

Updates the fail status of the sensor If the state of the sensor is REPAIR, the remaining repair time is set If the state of the sensor is OK, the state of the sensor is drawn

Sensor.update_history(prev_time, curr_time, ...)

Updates the history variables

Sensor.color

Sensor.handle

Sensor.marker

Sensor.ps_random

Sensor.size