Skip to content

Commit

Permalink
Merge branch 'refs/heads/dev' into df/#856-tap-water
Browse files Browse the repository at this point in the history
  • Loading branch information
danielfeismann committed Jul 30, 2024
2 parents 86bb6b6 + f9d9b76 commit 544ab48
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 91 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Printing the directory of log to terminal upon simulation failure [#626](https://github.com/ie3-institute/simona/issues/626)
- Implementation of StorageAgent [#309](https://github.com/ie3-institute/simona/issues/309)
- Enhanced Newton-Raphson-PowerFlow failures with more information [#815](https://github.com/ie3-institute/simona/issues/815)
- Update RTD references and bibliography [#868](https://github.com/ie3-institute/simona/issues/868)

### Changed
- Adapted to changed data source in PSDM [#435](https://github.com/ie3-institute/simona/issues/435)
Expand Down Expand Up @@ -61,6 +62,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Rewrote FixedFeedModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- Rewrote WecModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- Rewrote FixedLoadModelTest from groovy to scala [#646](https://github.com/ie3-institute/simona/issues/646)
- 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)

### Fixed
- Removed a repeated line in the documentation of vn_simona config [#658](https://github.com/ie3-institute/simona/issues/658)
Expand Down
28 changes: 27 additions & 1 deletion docs/readthedocs/_static/bibliography/bibAboutSimona.bib
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ @book{Hiry.2022
volume = {24},
publisher = {Shaker},
isbn = {9783844084627},
series = {Dortmunder Beitr{\"a}ge zu Energiesystemen, Energieeffizienz und Energiewirtschaft}
series = {Dortmunder Beitr{\"a}ge zu Energiesystemen, Energieeffizienz und Energiewirtschaft},
doi = {10.17877/DE290R-22549}
}

@Book{Kittl.2022,
Expand Down Expand Up @@ -311,3 +312,28 @@ @InProceedings{Kays.2011b
address = {Bologna}
}

@article{HIRY2022108365,
title = {Multi-voltage level distributed backward–forward sweep power flow algorithm in an agent-based discrete-event simulation framework},
journal = {Electric Power Systems Research},
volume = {213},
pages = {108365},
year = {2022},
issn = {0378-7796},
doi = {https://doi.org/10.1016/j.epsr.2022.108365},
url = {https://www.sciencedirect.com/science/article/pii/S0378779622005326},
author = {Johannes Hiry and Chris Kittl and Debopama Sen Sarma and Thomas Oberließen and Christian Rehtanz},
keywords = {Agent-based modeling, Discrete-event systems, Distributed power generation, Load flow, Power system simulation},
}

@INPROCEEDINGS{10407568,
author={Sarma, Debopama Sen and Peter, Sebastian and Rehtanz, Christian},
booktitle={2023 IEEE PES Innovative Smart Grid Technologies Europe (ISGT EUROPE)},
title={A Distributed Framework for Agent-based Optimal Energy Management of Distribution Systems},
year={2023},
volume={},
number={},
pages={1-5},
keywords={Data privacy;Europe;Systems simulation;Smart grids;Security;Energy management;Optimization;agent-based;distributed optimization;energy management;flexible prosumers;modern distribution networks},
doi={10.1109/ISGTEUROPE56780.2023.10407568}}


2 changes: 1 addition & 1 deletion docs/readthedocs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

templates_path = ['_templates']
exclude_trees = ['.build']
source_suffix = ['.rst', '.md']
source_suffix = ['.md']
source_encoding = 'utf-8-sig'


Expand Down
25 changes: 14 additions & 11 deletions docs/readthedocs/index.rst → docs/readthedocs/index.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
Welcome to simona docs
======================
# Welcome to simona docs

```{eval-rst}
.. figure:: ../logo/logo_tightcrop_transparent.png
:figwidth: 25%
:align: right
:alt: logo of simona
```

Welcome to the documentation of simona - an agent-based discrete-event power system simulation model developed at the
Institute of Energy Systems, Energy Efficiency and Energy Economics at TU Dortmund University, Germany.

.. toctree::
:maxdepth: 2

about
usersguide
config
models
developersguide
references
```{toctree}
---
maxdepth: 2
---
about
usersguide
config
models
developersguide
references
```
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
****************************
Publications and References
****************************
# Publications and References

Publications
===============
## Publications

The following publications discuss SIMONA and implementation details as well as outcomes where SIMONA have been used:

```{eval-rst}
The following publications discuss SIMONA and implementation details as well as outcomes where SIMONA have been used:
.. rubric:: SIMONA Publications
Expand All @@ -23,5 +23,4 @@ References of publications SIMONA referred on:
.. bibliography:: _static/bibliography/bibtexAll.bib
:style: custom
:all:


```
68 changes: 0 additions & 68 deletions src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy

This file was deleted.

89 changes: 86 additions & 3 deletions src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@

package edu.ie3.simona.model.grid

import java.util.UUID
import edu.ie3.datamodel.models.OperationTime
import edu.ie3.simona.exceptions.InvalidParameterException

import java.util.UUID
import edu.ie3.simona.model.SystemComponent
import edu.ie3.simona.model.grid.SystemComponentSpec.SystemComponentMock
import edu.ie3.simona.test.common.UnitSpec
import edu.ie3.simona.test.common.{DefaultTestData, UnitSpec}
import edu.ie3.util.TimeUtil
import edu.ie3.util.scala.OperationInterval

import java.time.ZonedDateTime
import scala.util.Try

/** Test for abstract class [[SystemComponent]]
*/
class SystemComponentSpec extends UnitSpec {
class SystemComponentSpec extends UnitSpec with DefaultTestData {
sealed trait ValidSystemComponent {
val systemComponent: SystemComponentMock = SystemComponentMock(
operationInterval = OperationInterval(0L, 7200L)
Expand Down Expand Up @@ -62,6 +66,85 @@ class SystemComponentSpec extends UnitSpec {

}

def setup(): OperationTime.OperationTimeBuilder = {
OperationTime.builder()
}

"determine the correct operation interval" in {

val simulationEnd: ZonedDateTime =
TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")

val testCases = Seq(
(
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")),
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")),
OperationInterval(0L, 86400L),
),
(
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")),
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")),
OperationInterval(86400L, 86400L),
),
(
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")),
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")),
OperationInterval(0L, 0L),
),
(
None,
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")),
OperationInterval(0L, 0L),
),
(
Some(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")),
None,
OperationInterval(86400L, 86400L),
),
)

for ((operationStart, operationEnd, expected) <- testCases) {
val operationTimeBuilder = setup()

operationStart.foreach(operationTimeBuilder.withStart)
operationEnd.foreach(operationTimeBuilder.withEnd)

val operationTime: OperationTime = operationTimeBuilder.build()

val interval: OperationInterval =
SystemComponent.determineOperationInterval(
defaultSimulationStart,
simulationEnd,
operationTime,
)

interval should be(expected)
}
}

"reject an operation end that is before the operation start" in {

val simulationEnd: ZonedDateTime =
TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")

val operationTimeBuilder = setup()

operationTimeBuilder.withStart(defaultSimulationEnd)
operationTimeBuilder.withEnd(defaultSimulationStart)
val operationTime: OperationTime = operationTimeBuilder.build()

val exception = intercept[InvalidParameterException] {
SystemComponent.determineOperationInterval(
defaultSimulationStart,
simulationEnd,
operationTime,
)
}

exception.getMessage should be(
"The defined operation end is before it's operation start."
)
}
}

}
Expand Down

0 comments on commit 544ab48

Please sign in to comment.