diff --git a/CHANGELOG.md b/CHANGELOG.md index bf32bf8b17..23938fdf56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) @@ -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) diff --git a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib index 66c3a64e93..e2a605e239 100644 --- a/docs/readthedocs/_static/bibliography/bibAboutSimona.bib +++ b/docs/readthedocs/_static/bibliography/bibAboutSimona.bib @@ -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, @@ -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}} + + diff --git a/docs/readthedocs/conf.py b/docs/readthedocs/conf.py index 6ec36e73ef..30a0c7334c 100644 --- a/docs/readthedocs/conf.py +++ b/docs/readthedocs/conf.py @@ -29,7 +29,7 @@ templates_path = ['_templates'] exclude_trees = ['.build'] -source_suffix = ['.rst', '.md'] +source_suffix = ['.md'] source_encoding = 'utf-8-sig' diff --git a/docs/readthedocs/index.rst b/docs/readthedocs/index.md similarity index 68% rename from docs/readthedocs/index.rst rename to docs/readthedocs/index.md index 5ad7bc0ffd..714d51bcf2 100644 --- a/docs/readthedocs/index.rst +++ b/docs/readthedocs/index.md @@ -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 +``` diff --git a/docs/readthedocs/references.rst b/docs/readthedocs/references.md similarity index 69% rename from docs/readthedocs/references.rst rename to docs/readthedocs/references.md index 678bf1fc59..0aa2febc1e 100644 --- a/docs/readthedocs/references.rst +++ b/docs/readthedocs/references.md @@ -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 @@ -23,5 +23,4 @@ References of publications SIMONA referred on: .. bibliography:: _static/bibliography/bibtexAll.bib :style: custom :all: - - +``` diff --git a/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy b/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy deleted file mode 100644 index 354f3b3248..0000000000 --- a/src/test/groovy/edu/ie3/simona/model/SystemComponentTest.groovy +++ /dev/null @@ -1,68 +0,0 @@ -/* - * © 2020. TU Dortmund University, - * Institute of Energy Systems, Energy Efficiency and Energy Economics, - * Research group Distribution grid planning and operation - */ - -package edu.ie3.simona.model - -import edu.ie3.datamodel.models.OperationTime -import edu.ie3.simona.exceptions.InvalidParameterException -import edu.ie3.util.TimeUtil -import edu.ie3.util.scala.OperationInterval -import scala.Option -import spock.lang.Shared -import spock.lang.Specification - -import java.time.ZonedDateTime - -class SystemComponentTest extends Specification { - @Shared - OperationTime.OperationTimeBuilder operationTimeBuilder - - def setup() { - operationTimeBuilder = OperationTime.builder() - } - - def "Determine the correct operation interval"(Option operationStart, Option operationEnd, OperationInterval expected) { - given: - ZonedDateTime simulationStart = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - ZonedDateTime simulationEnd = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - - if(operationStart.defined) - operationTimeBuilder.withStart(operationStart.get()) - if(operationEnd.defined) - operationTimeBuilder.withEnd(operationEnd.get()) - OperationTime operationTime = operationTimeBuilder.build() - - and: - OperationInterval interval = SystemComponent.determineOperationInterval(simulationStart, simulationEnd, operationTime) - - expect: - interval == expected - - where: - operationStart | operationEnd | expected - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | OperationInterval.apply(0L, 86400L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | OperationInterval.apply(86400L, 86400L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | OperationInterval.apply(0L, 0L) - Option.apply(null) | Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) | OperationInterval.apply(0L, 0L) - Option.apply(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) | Option.apply(null) | OperationInterval.apply(86400L, 86400L) - } - - def "Reject an operation end, that is before the operation start"() { - given: - ZonedDateTime simulationStart = TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z") - ZonedDateTime simulationEnd = TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z") - operationTimeBuilder.withStart(TimeUtil.withDefaults.toZonedDateTime("2019-01-02T00:00:00Z")) - operationTimeBuilder.withEnd(TimeUtil.withDefaults.toZonedDateTime("2019-01-01T00:00:00Z")) - OperationTime operationTime = operationTimeBuilder.build() - - when: - SystemComponent.determineOperationInterval(simulationStart, simulationEnd, operationTime) - - then: - def exception = thrown(InvalidParameterException.class) - exception.message == "The defined operation end is before it's operation start." - } -} diff --git a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala index c9668e16d2..dce98587ad 100644 --- a/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala +++ b/src/test/scala/edu/ie3/simona/model/grid/SystemComponentSpec.scala @@ -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) @@ -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." + ) + } } }