Sensor
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
- coordinate#
The coordinate of the sensor
- Type
list
- 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
- state#
Which state the sensor is in
- Type
- 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
- draw_status(prob)[source]#
Sets the state of the sensor based on the probability of the state being FAILED
- 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
- 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.colorSensor.handleSensor.markerSensor.ps_randomSensor.size