src.blocks.DecisionMaking module
This module is responsible for decision making.
It includes one class for the decision making. See details in its own documentation.
Contact person: Stefan Riedmaier Creation date: 20.04.2020 Python version: 3.8
- class src.blocks.DecisionMaking.DecisionMaking(config, domain)
Bases:
objectThis class is responsible for decision making.
It includes one main method called “check_tolerances” for the decision making in the validation domain and one main method called “check_regulation” for the decision making in the application domain. See more details in the documentation of the check_tolerances and check_regulation method.
- static calculate_iso19364_boundaries(x, y, axis=-1, y_offset=5.0, y_gain=0.03, x_offset=0.1, x_gain=0.06)
This function calculates the ISO 19364 time series boundaries.
Example: - x: lateral acceleration with x_offset = 0.1 and x_gain = 0.06 - y: steering wheel angle with y_offset = 5.0 and y_gain = 0.03
- Parameters:
x (np.ndarray) – input signal
y (np.ndarray) – output signal
axis – along this axis the operations shall be applied
y_offset (float) – aditive tolerance for the output quantity
y_gain (float) – multiplicative tolerance for the output quantity
x_offset (float) – aditive tolerance for the input quantity
x_gain (float) – multiplicative tolerance for the input quantity
- Returns:
x and y values of bottom and top boundaries
- Return type:
(np.ndarray, np.ndarray, np.ndarray, np.ndarray)
- check_regulation(qois_kpi_da)
This function compares assessment results with regulation thresholds.
It returns a boolean data array with the same shape as the input array, as well as one global boolean value.
- Parameters:
qois_kpi_da (xr.DataArray) – result data array
- Returns:
boolean decision data array and overall boolean value
- Return type:
tuple(xr.DataArray, bool)
- check_tolerances(metric_da, qois_model_da, qois_system_da)
This function compares model validation results with defined thresholds.
It offers absolute and relative tolerances as well as tolerances based on ISO 19364 with interleaves (calculate_iso19364_boundaries).
It returns a boolean data array with the same shape as the input array, as well as one global boolean value.
- Parameters:
metric_da (xr.DataArray) – data array from validation metric
qois_model_da (xr.DataArray) – data array of the model from the qoi assessment
qois_system_da (xr.DataArray) – data array of the system from the qoi assessment
- Returns:
boolean decision data array and overall boolean value
- Return type:
tuple(xr.DataArray, bool)