Skip to content

fixed

Fixed(feature_name, value)

Bases: Discrete

A domain with a single value.

This domain contains a single fixed value for a feature.

Initialize the fixed domain.

Parameters:

Name Type Description Default
feature_name str

The name of the feature the domain belongs to.

required
value float

The fixed value to return.

required
Source code in src/flowcean/core/tool/testing/domain/fixed.py
10
11
12
13
14
15
16
17
def __init__(self, feature_name: str, value: float) -> None:
    """Initialize the fixed domain.

    Args:
        feature_name: The name of the feature the domain belongs to.
        value: The fixed value to return.
    """
    super().__init__(feature_name, [value])

get_value()

Get the fixed value.

Source code in src/flowcean/core/tool/testing/domain/fixed.py
19
20
21
def get_value(self) -> float:
    """Get the fixed value."""
    return self.values[0]