From f5738467146ee9ff284f018a0c73e8d33961c988 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sun, 4 Aug 2024 16:00:00 +0200 Subject: [PATCH 1/2] Harmonised both methods that check the inner temperature of thermal house against the boundaries --- CHANGELOG.md | 1 + .../scala/edu/ie3/simona/model/thermal/ThermalHouse.scala | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 468de1d410..cd88edffc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote SystemComponentTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Converting remaining rst files to markdown [#838](https://github.com/ie3-institute/simona/issues/838) - Merging both `FixedFeedInModelSpec` tests [#870](https://github.com/ie3-institute/simona/issues/870) +- Harmonised both methods that check the inner temperature of thermal house against the boundaries [#880](https://github.com/ie3-institute/simona/issues/880) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala index c08a6a3114..074b119178 100644 --- a/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala +++ b/src/main/scala/edu/ie3/simona/model/thermal/ThermalHouse.scala @@ -160,10 +160,11 @@ final case class ThermalHouse( * true, if inner temperature is too high */ def isInnerTemperatureTooHigh( - innerTemperature: Temperature + innerTemperature: Temperature, + boundaryTemperature: Temperature = upperBoundaryTemperature, ): Boolean = innerTemperature > Kelvin( - upperBoundaryTemperature.toKelvinScale - temperatureTolerance.toKelvinScale + boundaryTemperature.toKelvinScale - temperatureTolerance.toKelvinScale ) /** Check if inner temperature is lower than preferred minimum temperature From 51054ccddf768292e3cdec3024969c0cd47c01d5 Mon Sep 17 00:00:00 2001 From: danielfeismann Date: Sun, 4 Aug 2024 16:11:02 +0200 Subject: [PATCH 2/2] fix test --- CHANGELOG.md | 2 +- .../groovy/edu/ie3/simona/model/thermal/ThermalHouseTest.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd88edffc9..df753b06b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,7 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rewrote SystemComponentTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646) - Converting remaining rst files to markdown [#838](https://github.com/ie3-institute/simona/issues/838) - Merging both `FixedFeedInModelSpec` tests [#870](https://github.com/ie3-institute/simona/issues/870) -- Harmonised both methods that check the inner temperature of thermal house against the boundaries [#880](https://github.com/ie3-institute/simona/issues/880) +- Harmonised both methods that check the inner temperature of thermal house against the boundaries [#880](https://github.com/ie3-institute/simona/issues/880) ### Fixed - Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658) diff --git a/src/test/groovy/edu/ie3/simona/model/thermal/ThermalHouseTest.groovy b/src/test/groovy/edu/ie3/simona/model/thermal/ThermalHouseTest.groovy index f23d532b03..82893f3fbc 100644 --- a/src/test/groovy/edu/ie3/simona/model/thermal/ThermalHouseTest.groovy +++ b/src/test/groovy/edu/ie3/simona/model/thermal/ThermalHouseTest.groovy @@ -47,7 +47,7 @@ class ThermalHouseTest extends Specification { when: Temperature innerTemp = Sq.create(innerTemperature, Celsius$.MODULE$) - def isHigher = thermalHouse.isInnerTemperatureTooHigh(innerTemp) + def isHigher = thermalHouse.isInnerTemperatureTooHigh(innerTemp, thermalHouse.upperBoundaryTemperature()) def isLower = thermalHouse.isInnerTemperatureTooLow(innerTemp, thermalHouse.lowerBoundaryTemperature()) then: