Commit 1c8ff8d8 authored by Jan Mayer's avatar Jan Mayer
Browse files

Merge branch 'dev-branch' into 'main'

Release final project version

See merge request !3
parents 158d28d6 d875c5e4
Pipeline #33652 failed with stages
in 2 minutes and 18 seconds
image: rvancea/maven-chrome-jdk8:latest
image: maven:3.3.9-jdk-8
build_artefacts:
stage: build
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
cache:
paths:
- ./.m2/repository
stages:
- prebuild
- build
- test
- publish
prebuild:
stage: prebuild
script:
- echo 'maven build'
- echo 'maven build dependencies'
- mvn -f core/ActorFramework/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f projects/memapOpcServer/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f core/cim15/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f core/powerflow/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f core/gridarchitect/pom.xml clean compile install -Dmaven.test.skip=true
build_artifacts:
stage: build
script:
- echo 'maven build artefacts'
- mvn -f projects/memapCore/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f projects/memapGui/pom.xml clean compile install -Dmaven.test.skip=true
- mvn -f projects/memapGui/pom.xml clean compile install -Dmaven.test.skip=true
- cp projects/memapCore/target/*with-dependencies.jar memapServer.jar
- cp projects/memapGui/target/*with-dependencies.jar memapPlanningTool.jar
dependencies:
- prebuild
artifacts:
paths:
- memapServer.jar
- memapPlanningTool.jar
test_server:
stage: test
script:
- echo 'here test configuration is needed for server mode'
test_planningTool:
stage: test
script:
- echo 'here test configuration is needed for planning tool'
publish:
stage: publish
needs:
- job: build_artifacts
artifacts: true
rules:
- if: $CI_COMMIT_TAG
script:
- echo 'Running release_job'
release:
name: 'Release $CI_COMMIT_TAG'
description: 'Release created for tagged merge to main.'
tag_name: '$CI_COMMIT_TAG'
<img align="left" src="MEMAP-Logo.png" alt="MEMAP" width="150"/>
<img align="left" src="MEMAP-Logo.png" alt="MEMAP" width="180"/>
Welcome to the **Multi energy management and aggregation platform (MEMAP)** project!
The platform aims to enable a potential energy exchange and increase the efficiency with sector coupling, by interconnecting several quarters on the local level. The platform creates an optimized schedule, so that connected buildings save costs, if more efficient components for energy production are available. It is also possible to optimize the energy operations to reduce CO2 emissions.
In the MEMAP project, multi-energy optimization of existing districts was realized using a scalable software architecture, which connects exisiting local energy management systems (local EMS) to a district-level optimization platform.
The present software environment serves as a data-aggregation platform using the OPC Unified Architecture (OPC UA) protocoll architecture. It thereby enables Plug&Play onboarding of local EMS, wich have an OPC UA interface aligned with the [MEMAP object- and data-model](https://memap-projekt.de).
A local EMS communicates with the MEMAP system using the OPC Unified Architecture protocols (OPC UA).
The build-in optimization - a model predicteve controller (MPC) - uses the aggregated parameters and demand/production forecasts to calculate the optimal energy dispatch accross the connected EMS. The resutling optimized schedules are then written to the respective OPC UA datapoints of the local EMS, so that connected buildings operate in a costs or CO2 optimized manner.
The software environment also provides a planning tool for exisiting or perspective districts, which is based on the same optimization core.
Two example local EMS Server can be found in projects/OPC-UA-MockupBuildings.
Use the following command to clone this repository...
Use the following command to clone this repository
``
git clone https://git.fortiss.org/ASCI-public/memap.git
``
...or start directly with our online DEMO in GitPod:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/SES-fortiss/SmartGridCoSimulation)
For further information about the project visit:
https://memap-projekt.de/
Subproject commit fe7f66dbbd6cdde1c9d9042e49e2e4c026962892
Subproject commit 63602be2117d3ab8ac29eebee11031ac48016968
# memapCore
In **server mode** multiple local energy management systems (EMS) can be connected to MEMAP to perform a multi-energy optimization for the whole building network (e.g. neighborhoods or districts). Interfacing with the local EMS is done via an OPC UA server-client architecture using a [datamodel](https://memap-projekt.de), that defines the minimum necessary parameters for 5-6 classes of items (Demand, Producer, Volatile Producer, Coupler, Storage, Connection) in two sectors (electricity, heat). Optimized schedules for all participating devices are directly written to the local EMS via OPC UA.
### Rest interfaces
Memap starts a jetty server with a simple REST API for onboarding of local EMS and to start the optimization
| Functionality | Path | Return Codes |
| ------ | ------ | ------ |
| Start Simulationp | ` POST /memap/message/` | 201 - Created |
Once a [JSON configuration file](https://git.fortiss.org/ASCI-public/memap/-/tree/dev-branch/projects/memapCore/src/main/resources/examples) is received in the body of such a request, the information is internally forwarded to the OpcUaBuildingController, who creates a building instance for every endpoint/local EMS in the JSON and creates virtual representations including an OPC UA client for every listed device, respectively. These virtual representations are MEMAP-internal actors, which collect informations from the OPC UA servers of their respective EMS (by subscriptions) and forward these information to the MEMAP-central problem formualtion and optimizer through messages. Optimized power setpoints for the onboarded devices are internally communicated back to the device actors, which then write the setpoints to the respective nodes of the local EMS Servers.
### Starting MEMAP Server
* Download the latest release
* Execute e.g. `java -jar memapCore_v101.jar jetty 24 900`, where
* the first argument gives the **mpc horitzon** in setpoints
* the second argument gives the **stepsize** in seconds
* in the above example: 15 min steps and horizon of 6 hrs. *Note: all forecasts at the local EMS have to provide corresponding forecasts*
* starts emulating 2 Buildings for MEMAP VPN at opc.tcp://localhost:4880 and opc.tcp://localhost:4890
### Onboarding
The onboarding was done using an internal version of [OpenVisu](https://openvisu.org), which is an open-source user interface from MEMAP-partner Holsten Systems for auto-discovery and visualization of OPC UA nodes. Alternatively, one can use (and personalize) our existing JSON-files or create it maually. Any free REST clients (e.g. postman) can then be used to send the file as body as described above:
```
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/octet-stream");
RequestBody body = RequestBody.create(mediaType, "<JSON goes here>");
Request request = new Request.Builder()
.url("http://localhost:8013/memap/message")
.post(null)
.addHeader("cache-control", "no-cache")
.addHeader("postman-token", "dfa5a67a-121f-6d61-01f8-d483f9caf1bd")
.build();
Response response = client.newCall(request).execute();
```
### 2 building example
To test the functionality, two python based mocked buildings are provided in the **OPC-UA-MockupBuildings** submodule. By launching
`python3 2Houses_MinimalMemapDatamodel.py`
two building-Servers are created and are acessible under `opc.tcp://localhost:4880` and `opc.tcp://localhost:4890`.
Onboarding as described above can be done using [this JSON](https://git.fortiss.org/ASCI-public/memap/-/blob/dev-branch/projects/memapCore/src/main/resources/examples/2HOUSES_DM_local.json).
......@@ -6,7 +6,7 @@
<groupId>org.fortiss.memap</groupId>
<artifactId>memapCore</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>Multi Energy Management and Aggregation Platform (MEMAP)</name>
......@@ -21,8 +21,8 @@
</dependency>
<dependency>
<groupId>org.fortiss</groupId>
<artifactId>gridarchitect</artifactId>
<version>0.1</version>
<artifactId>ActorFramework</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
......@@ -90,7 +90,7 @@
<dependency>
<groupId>memapOpcServer</groupId>
<artifactId>memapOpcServer</artifactId>
<version>0.0.1</version>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.github.cliftonlabs</groupId>
......
......@@ -7,7 +7,6 @@ import java.io.IOException;
import java.util.ArrayList;
import com.google.gson.Gson;
import helper.IoHelper;
import memap.helper.DirectoryConfiguration;
import memap.messages.BuildingMessage;
import memap.messages.OptimizationResultMessage;
......@@ -40,7 +39,7 @@ public class OpcServerContextGenerator {
location = location + source;
System.out.println("Try file location: " + location);
IoHelper.createParentFolders(location);
// IoHelper.createParentFolders(location);
File file = new File(location);
BufferedWriter writer;
......
......@@ -89,7 +89,7 @@ public class JettyStart {
}
// ****************************
// TODO: Further distinguish here between MILP/LP optimizer and between EUR/CO2 criteria
// TODO: Further distinguish here between MILP/LP optimizer, between EUR/CO2 criteria and Logging
//
if (project.toJson().contains("connections")){
connections = (JsonArray) project.get("connections");
......@@ -101,7 +101,7 @@ public class JettyStart {
Optimizer.MILPwithConnections,
OptimizationCriteria.EUR,
ToolUsage.SERVER,
MEMAPLogging.RESULTS_ONLY
MEMAPLogging.FILES
);
} else {
......@@ -112,7 +112,7 @@ public class JettyStart {
Optimizer.MILP,
OptimizationCriteria.EUR,
ToolUsage.SERVER,
MEMAPLogging.RESULTS_ONLY
MEMAPLogging.FILES
);
}
......
......@@ -101,13 +101,13 @@
</dependency>
<dependency>
<groupId>org.fortiss</groupId>
<artifactId>gridarchitect</artifactId>
<version>0.1</version>
<artifactId>ActorFramework</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.fortiss.memap</groupId>
<artifactId>memapCore</artifactId>
<version>0.1</version>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>com.miglayout</groupId>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment