discrete
Discrete(feature_name, values)
Bases: Domain, Iterable[tuple[str, float]]
A domain of discrete values.
This domain describes a discrete set of values for a feature.
Initialize the discrete domain.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature_name
|
str
|
The name of the feature the domain belongs to. |
required |
values
|
list[float]
|
The list of values of the domain. |
required |
Source code in src/flowcean/core/tool/testing/domain/discrete.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
__len__()
Get the number of discrete values in the domain.
Returns:
| Type | Description |
|---|---|
int
|
The number of discrete values in the domain. |
Source code in src/flowcean/core/tool/testing/domain/discrete.py
31 32 33 34 35 36 37 | |
get_value()
Get a random value from the domain.
Source code in src/flowcean/core/tool/testing/domain/discrete.py
39 40 41 | |
__iter__()
Iterate over the values of the range.
Source code in src/flowcean/core/tool/testing/domain/discrete.py
46 47 48 49 | |