interval
Interval(feature, left_endpoint, right_endpoint, min_value, max_value)
Represents an interval for a specific feature.
The interval belongs to one equivalence class.
Attributes:
feature: int Index of the feature to which the interval belongs.
IntervalEndpoint
Indicates whether the interval is left-open or left-closed.
IntervalEndpoint
Indicates whether the interval is right-open or right-closed.
int | float
Lower bound of the interval.
int | float
Upper bound of the interval.
Initializes an Interval object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
feature
|
int
|
Index of the feature to which the interval belongs. |
required |
left_endpoint
|
IntervalEndpoint
|
Left endpoint type ('(' for open, '[' for closed). |
required |
right_endpoint
|
IntervalEndpoint
|
Right endpoint type (')' for open, ']' for closed). |
required |
min_value
|
float
|
Lower bound of the interval. |
required |
max_value
|
float
|
Upper bound of the interval. |
required |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
__str__()
Returns a string representation of the interval.
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
53 54 55 56 57 58 59 60 61 | |
is_closed()
Checks if the interval is fully closed [a, b].
Returns:
| Type | Description |
|---|---|
bool
|
True if both endpoints are closed. |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
63 64 65 66 67 68 69 70 71 72 | |
is_open()
Checks if the interval is fully open (a, b).
Returns:
| Type | Description |
|---|---|
bool
|
True if both endpoints are open. |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
74 75 76 77 78 79 80 81 82 83 | |
is_right_open()
Checks if the interval is right-open [a, b).
Returns:
| Type | Description |
|---|---|
bool
|
True if left is closed and right is open. |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
85 86 87 88 89 90 91 92 93 94 | |
is_left_open()
Checks if the interval is left-open (a, b].
Returns:
| Type | Description |
|---|---|
bool
|
True if left is open and right is closed. |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
96 97 98 99 100 101 102 103 104 105 | |
is_subset(interval_a, interval_b)
staticmethod
Determines which interval is a subset of the other.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interval_a
|
Interval
|
First interval to compare. |
required |
interval_b
|
Interval
|
Second interval to compare. |
required |
Returns:
| Type | Description |
|---|---|
Interval | None
|
The superset interval if one contains the other, |
Interval | None
|
otherwise None. |
Source code in src/flowcean/testing/generator/ddtig/domain/model_analyser/surrogate/interval.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
IntervalEndpoint
Bases: Enum
Enum representing the types of interval endpoints.