Skip to content

Commit 1eb6a59

Browse files
committed
Merge branch 'dev' into ms/#1106-transfer-LoadProfile-parsing-code-from-SIMONA
# Conflicts: # CHANGELOG.md # src/main/java/edu/ie3/datamodel/io/factory/timeseries/RandomLoadProfileFactory.java # src/main/java/edu/ie3/datamodel/models/timeseries/repetitive/RandomLoadProfileTimeSeries.java
2 parents 560cc77 + db68a2c commit 1eb6a59

File tree

6 files changed

+38
-28
lines changed

6 files changed

+38
-28
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Extend ValidationUtils for validating ThermalGrids [#1216](https://github.com/ie3-institute/PowerSystemDataModel/issues/1216)
1515
- Enhance `TimeSeriesSource` with method to retrieve the previous value before a given key [#1182](https://github.com/ie3-institute/PowerSystemDataModel/issues/1182)
1616
- Added `BdewLoadProfileTimeSeries` [#1230](https://github.com/ie3-institute/PowerSystemDataModel/issues/1230)
17+
- Added `RandomLoadProfileTimeSeries` [#1232](https://github.com/ie3-institute/PowerSystemDataModel/issues/1232)
1718
- Added load profiles sources [#1106](https://github.com/ie3-institute/PowerSystemDataModel/issues/1106)
1819

1920
### Fixed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id 'signing'
66
id 'pmd' // code check, working on source code
77
id 'com.diffplug.spotless' version '7.0.2' //code format
8-
id 'com.github.spotbugs' version '6.1.4' // code check, working on byte code
8+
id 'com.github.spotbugs' version '6.1.5' // code check, working on byte code
99
id 'de.undercouch.download' version '5.6.0'
1010
id 'kr.motd.sphinx' version '2.10.1' // documentation generation
1111
id 'jacoco' // java code coverage plugin
@@ -77,7 +77,7 @@ dependencies {
7777
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
7878
testImplementation "org.spockframework:spock-core:2.3-groovy-$groovyVersion"
7979
testImplementation 'org.objenesis:objenesis:3.4' // Mock creation with constructor parameters
80-
testImplementation 'net.bytebuddy:byte-buddy:1.17.0' // Mocks of classes
80+
testImplementation 'net.bytebuddy:byte-buddy:1.17.1' // Mocks of classes
8181

8282
// testcontainers (docker framework for testing)
8383
testImplementation "org.testcontainers:testcontainers:$testcontainersVersion"

docs/readthedocs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ commonmark==0.9.1
22
recommonmark==0.7.1
33
Sphinx==8.1.3
44
sphinx-rtd-theme==3.0.2
5-
myst-parser==4.0.0
5+
myst-parser==4.0.1
66
markdown-it-py==3.0.0

src/main/java/edu/ie3/datamodel/io/factory/timeseries/RandomLoadProfileFactory.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,28 @@ public RandomLoadProfile parseProfile(String profile) {
8888
return RANDOM_LOAD_PROFILE;
8989
}
9090

91+
/**
92+
* This is the 95 % quantile resulting from 10,000 evaluations of the year 2019. It is only
93+
* needed, when the load is meant to be scaled to rated active power.
94+
*
95+
* @return Reference active power to use for later model calculations
96+
*/
9197
@Override
9298
public ComparableQuantity<Power> calculateMaxPower(
9399
RandomLoadProfile loadProfile, Set<LoadProfileEntry<RandomLoadValues>> loadProfileEntries) {
94100
return Quantities.getQuantity(159d, WATT);
95101
}
96102

103+
/**
104+
* Returns the profile energy scaling factor, the random profile is scaled to.
105+
*
106+
* <p>It is said in 'Kays - Agent-based simulation environment for improving the planning of
107+
* distribution grids', that the Generalized Extreme Value distribution's parameters are sampled
108+
* from input data, that is normalized to 1,000 kWh annual energy consumption. However, due to
109+
* inaccuracies in random data reproduction, the sampled values will lead to an average annual
110+
* energy consumption of approx. this value. It has been found by 1,000 evaluations of the year
111+
* 2019.
112+
*/
97113
@Override
98114
public ComparableQuantity<Energy> getLoadProfileEnergyScaling(RandomLoadProfile loadProfile) {
99115
return Quantities.getQuantity(716.5416966513656, PowerSystemUnits.KILOWATTHOUR);

src/main/java/edu/ie3/datamodel/models/timeseries/repetitive/LoadProfileTimeSeries.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public class LoadProfileTimeSeries<V extends LoadValues>
2525
private final Map<Integer, V> valueMapping;
2626

2727
/**
28-
* The maximum average power consumption per quarter-hour for a given calculated over all seasons
29-
* and weekday types of given load profile.
28+
* The maximum average power consumption per quarter-hour calculated over all seasons and weekday
29+
* types of given load profile.
3030
*/
31-
public final ComparableQuantity<Power> maxPower;
31+
private final ComparableQuantity<Power> maxPower;
3232

3333
/** The profile energy scaling in kWh. */
34-
public final ComparableQuantity<Energy> profileEnergyScaling;
34+
private final ComparableQuantity<Energy> profileEnergyScaling;
3535

3636
public LoadProfileTimeSeries(
3737
UUID uuid,
@@ -50,6 +50,19 @@ public LoadProfileTimeSeries(
5050
this.profileEnergyScaling = profileEnergyScaling;
5151
}
5252

53+
/**
54+
* Returns the maximum average power consumption per quarter-hour calculated over all seasons and
55+
* weekday types of given load profile in Watt.
56+
*/
57+
public Optional<ComparableQuantity<Power>> maxPower() {
58+
return Optional.ofNullable(maxPower);
59+
}
60+
61+
/** Returns the profile energy scaling in kWh. */
62+
public Optional<ComparableQuantity<Energy>> loadProfileScaling() {
63+
return Optional.ofNullable(profileEnergyScaling);
64+
}
65+
5366
/** Returns the {@link LoadProfile}. */
5467
public LoadProfile getLoadProfile() {
5568
return loadProfile;

src/main/java/edu/ie3/datamodel/models/timeseries/repetitive/RandomLoadProfileTimeSeries.java

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import de.lmu.ifi.dbs.elki.math.statistics.distribution.GeneralizedExtremeValueDistribution;
99
import edu.ie3.datamodel.models.profile.LoadProfile;
1010
import edu.ie3.datamodel.models.value.load.RandomLoadValues;
11-
import java.util.Objects;
1211
import java.util.Set;
1312
import java.util.UUID;
1413
import javax.measure.quantity.Energy;
@@ -35,27 +34,8 @@ public LoadProfile.RandomLoadProfile getLoadProfile() {
3534
return (LoadProfile.RandomLoadProfile) super.getLoadProfile();
3635
}
3736

38-
@Override
39-
public boolean equals(Object o) {
40-
if (this == o) return true;
41-
if (o == null || getClass() != o.getClass()) return false;
42-
return super.equals(o);
43-
}
44-
45-
@Override
46-
public int hashCode() {
47-
return Objects.hash(super.hashCode());
48-
}
49-
5037
@Override
5138
public String toString() {
52-
return "RandomLoadProfileTimeSeries{"
53-
+ "uuid="
54-
+ getUuid()
55-
+ "loadProfile="
56-
+ getLoadProfile()
57-
+ ", valueMapping="
58-
+ getValueMapping()
59-
+ '}';
39+
return "Random" + super.toString();
6040
}
6141
}

0 commit comments

Comments
 (0)