|
2 | 2 | This page gives an overview about the ValidationUtils in the *PowerSystemDataModel*. |
3 | 3 |
|
4 | 4 | ## What are the ValidationUtils? |
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. |
| 5 | +The methods in ValidationUtils and subclasses can be used to check that objects are valid. The checks can be separated into two types: |
| 6 | +1. General validation |
| 7 | +2. Uniqueness validation |
| 8 | + |
6 | 9 |
|
7 | 10 | ## What is checked? |
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. |
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. |
| 11 | +The general validation checks: |
| 12 | +- if 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 | +- 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 | + |
| 15 | +The uniqueness validation checks if a collection of given objects are unique in either: |
| 16 | +- a specific field |
| 17 | +- or in a combination of multiple fields |
| 18 | + |
| 19 | +For example `AssetInputs` needs to be unique in their `uuid` and in their `id` while |
| 20 | +`weather values` needs to be unique in the combination of their `time` and their `coordinate`. |
| 21 | + |
| 22 | + |
| 23 | +## How to use? |
| 24 | +- To use the general validation the user should call the method `ValidationUtils.check(Object)`. |
| 25 | +- To use the uniqueness validation the user should call a method of `UniquenessValidationUtils` to check the uniqueness. |
| 26 | + |
| 27 | +## How does the general validation work? |
10 | 28 |
|
11 | | -## How does it work? |
12 | | -- The method `ValidationUtils.check(Object)` is the only method that should be called by the user. |
13 | | -- This check method identifies the object class and forwards it to a specific check method for the given object |
| 29 | +- The method `ValidationUtils.check(Object)` identifies the object class and forwards it to a specific check method for the given object |
14 | 30 | - The overall structure of the ValidationUtils methods follows a cascading scheme, orientated along the class tree |
15 | 31 | - Example: A `LineInput lineInput` should be checked |
16 | 32 | 1. `ValidationUtils.check(lineInput)` is called |
@@ -49,15 +65,14 @@ The ValidationUtils include validation checks for... |
49 | 65 | - PvInput |
50 | 66 | - StorageInput |
51 | 67 | - WecInput |
52 | | - - (missing: EvcsInput) |
| 68 | + - EvcsInput (also checks ChargingPointType) |
53 | 69 | - SystemParticipantTypeInput |
54 | 70 | - BmTypeInput |
55 | 71 | - ChpTypeInput |
56 | 72 | - EvTypeInput |
57 | 73 | - HpTypeInput |
58 | 74 | - StorageTypeInput |
59 | 75 | - WecTypeInput |
60 | | - - (missing: EvcsTypeInput/ChargingPointType) |
61 | 76 | - ThermalUnitValidationUtils |
62 | 77 | - ThermalUnitInput |
63 | 78 | - ThermalSinkInput |
|
0 commit comments