|
1 | | -**************** |
2 | | -Validation Utils |
3 | | -**************** |
| 1 | +# Validation Utils |
4 | 2 | This page gives an overview about the ValidationUtils in the *PowerSystemDataModel*. |
5 | 3 |
|
6 | | -What are the ValidationUtils? |
7 | | -============================= |
| 4 | +## What are the ValidationUtils? |
8 | 5 | The methods in ValidationUtils and subclasses can be used to check that objects are valid, meaning their parameters have valid values and they are correctly connected. |
9 | 6 |
|
10 | | -What is checked? |
11 | | -================ |
| 7 | +## What is checked? |
12 | 8 | - The check methods include checks that assigned values are valid, e.g. lines are not allowed to have negative lengths or the rated power factor of any unit must be between 0 and 1. |
13 | 9 | - Furthermore, several connections are checked, e.g. that lines only connect nodes of the same voltage level or that the voltage levels indicated for the transformer sides match the voltage levels of the nodes they are connected to. |
14 | 10 |
|
15 | | -How does it work? |
16 | | -================= |
17 | | -- The method :code:`ValidationUtils.check(Object)` is the only method that should be called by the user. |
| 11 | +## How does it work? |
| 12 | +- The method `ValidationUtils.check(Object)` is the only method that should be called by the user. |
18 | 13 | - This check method identifies the object class and forwards it to a specific check method for the given object |
19 | 14 | - The overall structure of the ValidationUtils methods follows a cascading scheme, orientated along the class tree |
20 | | -- Example: A :code:`LineInput lineInput` should be checked |
21 | | - 1. :code:`ValidationUtils.check(lineInput)` is called |
22 | | - 2. :code:`ValidationUtils.check(lineInput)` identifies the class of the object as :code:`AssetInput` and calls :code:`ValidationUtils.checkAsset(lineInput)` |
23 | | - 3. :code:`ValidationUtils.checkAsset(lineInput)`, if applicable, checks those parameters that all :code:`AssetInput` have in common (e.g. operation time) and further identifies the object, more specifically, as a :code:`ConnectorInput` and calls :code:`ConnectorValidationUtils.check(lineInput)` |
24 | | - 4. :code:`ConnectorValidationUtils.check(lineInput)`, if applicable, checks those parameters that all :code:`ConnectorInput` have in common and further identifies the object, more specifically, as a :code:`LineInput` and calls :code:`ConnectorValidationUtils.checkLine(lineInput)` |
25 | | - 5. :code:`ConnectorValidationUtils.checkLine(lineInput)` checks all specific parameters of a :code:`LineInput` |
| 15 | +- Example: A `LineInput lineInput` should be checked |
| 16 | + 1. `ValidationUtils.check(lineInput)` is called |
| 17 | + 2. `ValidationUtils.check(lineInput)` identifies the class of the object as `AssetInput` and calls `ValidationUtils.checkAsset(lineInput)` |
| 18 | + 3. `ValidationUtils.checkAsset(lineInput)`, if applicable, checks those parameters that all `AssetInput` have in common (e.g. operation time) and further identifies the object, more specifically, as a `ConnectorInput` and calls `ConnectorValidationUtils.check(lineInput)` |
| 19 | + 4. `ConnectorValidationUtils.check(lineInput)`, if applicable, checks those parameters that all `ConnectorInput` have in common and further identifies the object, more specifically, as a `LineInput` and calls `ConnectorValidationUtils.checkLine(lineInput)` |
| 20 | + 5. `ConnectorValidationUtils.checkLine(lineInput)` checks all specific parameters of a `LineInput` |
26 | 21 | - ValidationUtils furthermore contains several utils methods used in the subclasses |
27 | 22 |
|
28 | | -Which objects are checked? |
29 | | -========================== |
| 23 | +## Which objects are checked? |
30 | 24 | The ValidationUtils include validation checks for... |
31 | 25 |
|
32 | 26 | - NodeValidationUtils |
@@ -80,8 +74,7 @@ The ValidationUtils include validation checks for... |
80 | 74 | - RawGridElements |
81 | 75 | - SystemParticipants |
82 | 76 |
|
83 | | -What should be considered? |
84 | | -========================== |
| 77 | +## What should be considered? |
85 | 78 | - Due to many checks with if-conditions, the usage of the ValidationUtils for many objects might be runtime relevant. |
86 | 79 | - The check for a GridContainer includes the interplay of the contained entities as well as the checks of all contained entities. |
87 | 80 | - If new classes are introduced to the *PowerSystemDataModel*, make sure to follow the forwarding structure of the ValidationUtils methods when writing the check methods! |
0 commit comments