Skip to content

Commit

Permalink
Merge branch 'sp/#000-em-combined' into sp/#339-em-it
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-peter committed Sep 25, 2022
2 parents a335338 + 52da074 commit 0d31a9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
7 changes: 0 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ String sshCredentialsId = '19f16959-8a0d-4a60-bd1f-5adb4572b702' // id that matc

/* ci configuration */
String sonarqubeProjectKey = 'edu.ie3:simona' // sonarqube project key, case-sensitive
String codeCovTokenId = 'simona-codecov-token' // id that matches the code coverage token set as jenkins property

/* maven central configuration */
String mavenCentralCredentialsId = '87bfb2d4-7613-4816-9fe1-70dfd7e6dec2' // id that matches the maven central credentials set as jenkins property
Expand Down Expand Up @@ -186,12 +185,6 @@ node {
// publish reports
publishReports(projectName)

// call codecov.io
withCredentials([
string(credentialsId: codeCovTokenId, variable: 'codeCovToken')
]) {
sh "curl -s https://codecov.io/bash | bash -s - -t ${env.codeCovToken} -C ${commitHash}"
}
}

} catch (Exception e) {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ dependencies {

/* logging */
implementation "com.typesafe.scala-logging:scala-logging_${scalaVersion}:3.9.5" // akka scala logging
implementation "ch.qos.logback:logback-classic:1.4.0"
implementation "ch.qos.logback:logback-classic:1.4.1"

/* testing */
testImplementation 'org.spockframework:spock-core:2.2-groovy-4.0'
Expand Down Expand Up @@ -151,7 +151,7 @@ dependencies {
implementation "com.sksamuel.avro4s:avro4s-core_${scalaVersion}:4.1.0"

implementation 'org.apache.commons:commons-math3:3.6.1' // apache commons math3
implementation 'org.apache.poi:poi-ooxml:5.2.2' // used for FilenameUtils
implementation 'org.apache.poi:poi-ooxml:5.2.3' // used for FilenameUtils
implementation 'javax.measure:unit-api:2.1.3'
implementation 'tech.units:indriya:2.1.3' // quantities
implementation 'org.apache.commons:commons-csv:1.9.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,13 @@ final case class StorageModel(
) {

private val lowestEnergy = eStorage.multiply(dod).asType(classOf[Energy])
private val marginTolerance = 0.01d.asKiloWattHour

/** In order to avoid faulty flexibility options, we want to avoid offering
* charging/discharging that could last less than one second.
*/
private val toleranceMargin = pMax
.multiply(Quantities.getQuantity(1, Units.SECOND))
.asType(classOf[Energy])

override protected def calculateActivePower(
data: StorageRelevantData
Expand All @@ -69,9 +75,9 @@ final case class StorageModel(
determineCurrentState(lastState, data.currentTick)

val chargingPossible =
currentStoredEnergy.isLessThan(eStorage.subtract(marginTolerance))
currentStoredEnergy.isLessThan(eStorage.subtract(toleranceMargin))
val dischargingPossible =
currentStoredEnergy.isGreaterThan(lowestEnergy.add(marginTolerance))
currentStoredEnergy.isGreaterThan(lowestEnergy.add(toleranceMargin))

ProvideMinMaxFlexOptions(
uuid,
Expand Down

0 comments on commit 0d31a9e

Please sign in to comment.