-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WaterTankFI, WaterTankSwap examples #193
Closed
astitva1905
wants to merge
5
commits into
INTO-CPS-Association:feature/distributed-demo
from
astitva1905:feature/distributed-demo
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Water Tank Fault Injection | ||
|
||
## Overview | ||
|
||
The co-simulation is composed of a water-tank, | ||
and a controller, which aims to maintain the level | ||
in the water-tank between ```1``` and ```2```. | ||
More details on this case-study can be found | ||
[here](https://github.com/INTO-CPS-Association/example-single_watertank). | ||
|
||
To run an experiment with fault-injection, | ||
we inject a fault in the input of the tank | ||
(control signal from controller to open or close), | ||
such that between time 12 and 20, this signal is | ||
always closed, irrespective of the actual level | ||
in the tank. | ||
|
||
## Example Diagram | ||
|
||
![Water Tank System](watertank.png) | ||
|
||
## Example Structure | ||
|
||
![Water Tank Structure](dt_structure.png) | ||
|
||
## Configuration of assets | ||
|
||
This example uses two models and one tool. | ||
The specific assets used are: | ||
|
||
| Asset Type | Names of Assets | Visibility | Reuse in Other Examples | | ||
|:---|:---|:---|:---| | ||
| Models | watertankcontroller-c.fmu | Private | Yes | | ||
| | singlewatertank-20sim.fmu | Private | Yes | | ||
| Tool | maestro-2.3.0-jar-with-dependencies.jar | Common | Yes | | ||
|
||
## Lifecycle Phases | ||
|
||
| Lifecycle Phase | Completed Tasks | | ||
| -------- | ------- | | ||
| Create | Installs Java Development Kit for Maestro tool | | ||
| Execute | Produces and stores output in data/water_tank_FI/output directory| | ||
| Clean | Clears run logs and outputs | | ||
|
||
## Run the example | ||
|
||
To run the example, change your present directory. | ||
|
||
```bash | ||
cd workspace/examples/digital_twins/water_tank_FI | ||
``` | ||
|
||
If required, change the permission of files you | ||
need to execute, for example: | ||
|
||
```bash | ||
chmod +x lifecycle/create | ||
``` | ||
|
||
Now, run the following scripts: | ||
|
||
### Create | ||
|
||
```bash | ||
lifecycle/create | ||
``` | ||
|
||
### Execute | ||
|
||
```bash | ||
lifecycle/execute | ||
``` | ||
|
||
## Examine the results | ||
|
||
The results can be found in the | ||
_workspace/examples/data/water_tank_FI/output directory_. | ||
|
||
You can also view run logs in the | ||
_workspace/examples/digital_twins/water_tank_FI_. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Water Tank Swap | ||
|
||
## Overview | ||
|
||
This example is a water-tank model swap experiment for DTaaS. | ||
The experiment uses the Maestro co-orchestration engine for | ||
FMI-based co-simulation with the Model Swap feature including | ||
a FaultInject extension. This demonstrates a Docker-less | ||
version of the experiment at | ||
<http:>https://github.com/lausdahl/fmiSwap</http:> | ||
for use on the DTaaS platform. | ||
|
||
The model swap mechanism demonstrated by | ||
the experiment is detailed in the paper "Dynamic Runtime | ||
Integration of New Models in Digital Twins" | ||
[H. Ejersbo, K. Lausdahl, M. Frasheri, L. Esterle] | ||
presented at the | ||
[SEAMS 2023 conference](https://conf.researchr.org/home/seams-2023). | ||
The water-tank experiment is further detailed here: | ||
[Ejersbo, H., Lausdahl, K., Frasheri, M., & Esterle, L. (2023). fmiSwap: Run-time Swapping of Models for Co-simulation and Digital Twins. arXiv preprint arXiv:2304.07328.](https://arxiv.org/abs/2304.07328). | ||
|
||
## Example Diagram | ||
|
||
![FMI Swap Diagram](fmi_swap.png) | ||
|
||
## Example Structure | ||
|
||
![FMI Swap Structure](dt-structure.png) | ||
|
||
## Configuration of assets | ||
|
||
This example uses four models and one tool. The specific assets used are: | ||
|
||
| Asset Type | Names of Assets | Visibility | Reuse in Other Examples | | ||
|:---|:---|:---|:---| | ||
| Models | watertankcontroller-c.fmu | Private | Yes | | ||
| | singlewatertank-20sim.fmu | Private | Yes | | ||
| | leak_detector.fmu | Private | Yes | | ||
| | leak_controller.fmu | Private | Yes | | ||
| Tool | maestro-2.3.0-jar-with-dependencies.jar | Common | Yes | | ||
|
||
## Lifecycle Phases | ||
|
||
| Lifecycle Phase | Completed Tasks | | ||
| -------- | ------- | | ||
| Create | Installs Java Development Kit for Maestro tool | | ||
| Execute | Produces and stores output in data/water_tank_swap/output directory| | ||
| Clean | Clears run logs and outputs | | ||
|
||
## Run the example | ||
|
||
To run the example, change your present directory. | ||
|
||
```bash | ||
cd workspace/examples/digital_twins/water_tank_swap | ||
``` | ||
|
||
If required, change the permission of files you need to execute, for example: | ||
|
||
```bash | ||
chmod +x lifecycle/create | ||
``` | ||
|
||
Now, run the following scripts: | ||
|
||
### Create | ||
|
||
```bash | ||
lifecycle/create | ||
``` | ||
|
||
### Execute | ||
|
||
```bash | ||
lifecycle/execute | ||
``` | ||
|
||
## Examine the results | ||
|
||
The results can be found in the | ||
_workspace/examples/data/water_tank_swap/output directory_. | ||
|
||
You can also view run logs in the | ||
_workspace/examples/digital_twins/water_tank_swap_. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line length