Skip to content

Commit 710b07d

Browse files
author
ljamt
committed
New osp-validator page and renaming MSMI to OSP-IS #62
1 parent b550762 commit 710b07d

11 files changed

+166
-58
lines changed

assets/img/validatorFig1.png

-32.8 KB
Binary file not shown.

assets/img/validatorFig2.png

-27.2 KB
Binary file not shown.

assets/img/validatorFig3.png

-19.4 KB
Binary file not shown.

cosim-cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ nav_order: 2
1414
</div>
1515

1616
# cosim
17-
`cosim` is a command-line interface (CLI) to libcosim for the cases where a graphical user interface is not available or needed. It facilitates for running co-simulations of systems configured with SSP or MSMI.
17+
`cosim` is a command-line interface (CLI) to libcosim for the cases where a graphical user interface is not available or needed. It facilitates for running co-simulations of systems configured with SSP or [OSP system structure configuration](./libcosim/configuration).
1818
It has three primary use cases:
1919

2020
- Running simulations from other programs or scripts

cosim-demo-app/user-guide.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ The code below is an example of a "OspSystemStructure.xml" file:
211211

212212
If your configuration directory contains both (“OspSystemStructure.xml” and a “SystemStructure.ssd”), the .xml file will be prioritized. If you would like to load your simulation with the connections as defined on the “SystemStructure.ssd” file, include it in the path.
213213

214-
Note: The new MSMI connection types are not supported when using the SSP standard.
214+
Note: The new OSP-IS connection types are not supported when using the SSP standard.
215215

216216
[back to top](./user-guide#user-guide)
217217

downloads.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ You can use this page to download:
1515
- [cosim demo app](https://github.com/open-simulation-platform/cosim-demo-app/releases)
1616
- [cosim4j (java wrapper)](https://github.com/open-simulation-platform/cosim4j/releases)
1717
- [demo simulation models](https://github.com/open-simulation-platform/cse-demos/releases)
18-
- [OSP validator](https://github.com/open-simulation-platform/msmi-validator/releases)
18+
- [OSP validator](https://github.com/open-simulation-platform/osp-validator/releases)
1919
- [kopl - windows](https://mooropt2.marintek.sintef.no/nexus/content/repositories/thirdparty/no/sintef/ocean/kopl/kopl/1.0.0/kopl-1.0.0-win32.x86_64.zip)
2020
- [kopl - linux (experimental)](https://mooropt2.marintek.sintef.no/nexus/content/repositories/thirdparty/no/sintef/ocean/kopl/kopl/1.0.0/kopl-1.0.0-linux.gtk.x86_64.zip)

index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The software produced in the OSP JIP consists of the following elements:
2828
- [cosim](./cosim) - command line interface
2929
- [cosim demo app](./cosim-demo-app/cosim-demo-app) - demo application with a graphical user interface
3030
- [cosim4j](./cosim4j) - libcosim java wrapper
31-
- [osp-validator](./model-interface-validator) validation tools for configuration and model interfaces
31+
- [osp-validator](./osp-validator) validation tools for configuration and model interfaces
3232
- [kopl](./kopl) - co-simulation configuration tool
3333

3434

kopl.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ nav_order: 7
77
---
88

99
# Kopl configurator
10-
Kopl is a configurator to help set up and run a simulation. It can also be used to validate the model using the [MSMI validator](./model-interface-validator).
10+
Kopl is a configurator to help set up and run a simulation. It can also be used to validate the model using the [OSP validator](./osp-validator).
1111
Kopl is not an open source software but can be freely used without any restrictions.
1212

1313
<figure>
@@ -42,8 +42,8 @@ Here you have two options,either to create an empty configuration or point to an
4242
* Once two or more FMUs are added to the diagram it is possible to add connections between the blocks.
4343
Just start dragging from an output or input slot and drop when hovering over the correct terminal.
4444

45-
# Variable groups (MSMI)
46-
* If you want to follow the MSMI standard, you can start creating variable groups in the definitions tab within the variable groups tab.
45+
# Variable groups (OSP-IS)
46+
* If you want to follow the OSP-IS, you can start creating variable groups in the definitions tab within the variable groups tab.
4747
* Click the green button or right click an empty space in the local navigator/tree widget
4848
* Created variable groups may then be choosen as input or output to the FMU
4949

@@ -52,9 +52,9 @@ Just start dragging from an output or input slot and drop when hovering over the
5252
<figcaption>Definition of nested variable groups </figcaption>
5353
</figure>
5454

55-
# MSMI validation
55+
# OSP-IS validation
5656

57-
Right click the configuration and choose validate in the context menu to let the [MSMI validator](./model-interface-validator) validate the current setup
57+
Right click the configuration and choose validate in the context menu to let the [OSP validator](./osp-validator) validate the current setup
5858

5959
# Export
6060

libcosim/configuration.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ nav_order: 1
88
---
99
# Simulation configuration
1010

11-
The configuration format is based on the [MSMI specification]() and is used to configure the simulation system structure, including
11+
The OSP system structure configuration format is based on the OSP Inteface Specification [OSP-IS]() and is used to configure the simulation system structure, including
1212
connections between FMUs and setting of initial values for input and parameter variables. The configuration format is XML according to schema
13-
[OspSystemStructure.xsd](https://github.com/open-simulation-platform/cse-core/blob/master/test/data/msmi/schema/OspModelDescription.xsd).
13+
[OspSystemStructure.xsd](https://open-simulation-platform.com/xsd/OspSystemStructure-0.1.xsd).
1414
Description of the OspSystemStructure elements and their attributes are shown below. Code implementation examples follow.
1515

1616
## \<OspSystemStructure>
@@ -28,8 +28,6 @@ Description of the OspSystemStructure elements and their attributes are shown be
2828
```xml
2929
<?xml version="1.0" encoding="utf-8" ?>
3030
<OspSystemStructure
31-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32-
xsi:schemaLocation="http://opensimulationplatform.com/MSMI/OSPSystemStructure"
3331
xmlns="http://opensimulationplatform.com/MSMI/OSPSystemStructure"
3432
version="0.1">
3533
<StartTime>0.0</StartTime>
@@ -96,7 +94,7 @@ This is especially important when different models are provided by different ven
9694
```
9795

9896
## \<Connection>
99-
As defined in the MSMI specification, `connections` are configured through variables and variableGroups. It is highly recommended to follow the specification for its interfaces when exporting a model for connections.
97+
As defined in OSP-IS, `connections` are configured through variables and variableGroups. It is highly recommended to follow the specification for its interfaces when exporting a model for connections.
10098

10199
| sub-element | attribute |Description |
102100
| :--------------- | :----------------------------------| :----------------------------------------------------------------------------------------------------- |

model-interface-validator.md

-44
This file was deleted.

osp-validator.md

+154
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
---
2+
layout: default
3+
title: "OSP validator"
4+
permalink: /osp-validator
5+
has_toc: false
6+
nav_order: 6
7+
---
8+
<div style="text-align: right">
9+
<b>
10+
<a href="https://github.com/open-simulation-platform/osp-validator">osp-validator</a>
11+
on GitHub
12+
</b>
13+
</div>
14+
15+
# OSP validator
16+
17+
The [osp-validator](https://github.com/open-simulation-platform/osp-validator) repository implements a java library and
18+
command line interface which validates an FMU with accompanying `OspModelDescription.xml` file, according to the
19+
[OSP-IS](/url/to/osp-is/document) standard. It also validates a simulation configuration as specified by a
20+
`OspSystemStructure.xml` file.
21+
22+
## Java library
23+
The java library is accessed through the jar file `osp-validator-api-<version>.jar`, which is found in specific releases
24+
of the `osp-validator` repository, or produced when building the project.
25+
26+
The java library can be used by simulation configuration tools which needs to validate that the models and configuration
27+
is according to OSP-IS. The [kopl](/url/to/kopl/documentation) configuration tool uses this library for validation.
28+
29+
Examples showing how it can be used in a java application can be found [here](/url/to/examples/in/osp-validator/repo)
30+
31+
## Command line interface
32+
A command line tool to interface the validator called `osp-cli.jar` is produced when building the `osp-validator`
33+
project, and it is available in every release. The command line inteface tool can be used to verify that a given
34+
`OspModelDescription.xml` and FMU is according to the OSP-IS, and it can also validate simulation configurations
35+
defined by a `OspSystemStructure.xml` file. If there are no validation errors the output is empty. In case there are
36+
validation errors, it will print error messages for all the violated rules.
37+
38+
Calling the `osp-cli.jar` without any input arguments prints out usage help:
39+
```
40+
$ java -jar osp-cli.jar
41+
Usage: msmi-cli.jar [options] [command] [command options]
42+
Options:
43+
--help, -h
44+
Print help
45+
--version, -v
46+
Print version
47+
Commands:
48+
osp-system-structure Validate OspSystemStructure.xml
49+
Usage: osp-system-structure [options]
50+
Options:
51+
-file
52+
Path to OspSystemStructure.xml
53+
54+
osp-model-description Validate OspModelDescription.xml
55+
Usage: osp-model-description [options]
56+
Options:
57+
-file
58+
Path to OspModelDescription.xml
59+
-fmu
60+
Path to fmu
61+
```
62+
63+
### Usage example
64+
The .xml files shown below, which represents a valid configuration, can be validated with `osp-cli.jar` as follows:
65+
66+
```
67+
$ java -jar osp-cli.jar osp-system-structure -file OspSystemStructure.xml
68+
```
69+
70+
This produces no output, meaning all models, and the configuration itself is valid according to
71+
OSP-IS. If we change the line `<VariableGroup simulator="crane_controller" name="linear_mechanical_port"/>` in
72+
`OspSystemStructure.xml` to `<VariableGroup simulator="crane_controller" name="force"/>` and run the validation again,
73+
we see that the validator prints out an error message associated with the violated rules, and accompanying line
74+
number for where the error is:
75+
76+
```
77+
$ java -jar osp-cli.jar osp-system-structure -file OspSystemStructure.xml
78+
Validation error in OspSystemStructure.xml on line 11:
79+
VariableGroupConnection [crane_controller.force, knuckle_boom_crane.linear_mechanical_port] is invalid
80+
because they have different types [Force, LinearMechanicalPort]
81+
```
82+
83+
### Example XML files
84+
`CraneController_OspModelDescription.xml`
85+
```xml
86+
<?xml version="1.0" encoding="utf-8" ?>
87+
<OspModelDescription xmlns="http://opensimulationplatform.com/osp-is/OSPModelDescription" version="1.0">
88+
<VariableGroups>
89+
<Generic name="actuator_limits">
90+
<Variable ref="Act_Limits[1]"/>
91+
<Variable ref="Act_Limits[2]"/>
92+
<Variable ref="Act_Limits[3]"/>
93+
</Generic>
94+
<LinearMechanicalPort name="linear_mechanical_port">
95+
<Force name="force">
96+
<Variable ref="p_Crane.e[1]"/>
97+
<Variable ref="p_Crane.e[2]"/>
98+
<Variable ref="p_Crane.e[3]"/>
99+
</Force>
100+
<LinearVelocity name="linear_velocity">
101+
<Variable ref="p_Crane.f[1]"/>
102+
<Variable ref="p_Crane.f[2]"/>
103+
<Variable ref="p_Crane.f[3]"/>
104+
</LinearVelocity>
105+
</LinearMechanicalPort>
106+
</VariableGroups>
107+
</OspModelDescription>
108+
```
109+
110+
`KnuckleBoomCrane_OspModelDescription.xml`
111+
```xml
112+
<?xml version="1.0" encoding="utf-8" ?>
113+
<OspModelDescription xmlns="http://opensimulationplatform.com/osp-is/OSPModelDescription" version="1.0">
114+
<VariableGroups>
115+
<Generic name="actuator_limits">
116+
<Variable ref="Act_Limits[1]"/>
117+
<Variable ref="Act_Limits[2]"/>
118+
<Variable ref="Act_Limits[3]"/>
119+
</Generic>
120+
<LinearMechanicalPort name="linear_mechanical_port">
121+
<Force name="force">
122+
<Variable ref="p_Crane.e[1]"/>
123+
<Variable ref="p_Crane.e[2]"/>
124+
<Variable ref="p_Crane.e[3]"/>
125+
</Force>
126+
<LinearVelocity name="linear_velocity">
127+
<Variable ref="p_Crane.f[1]"/>
128+
<Variable ref="p_Crane.f[2]"/>
129+
<Variable ref="p_Crane.f[3]"/>
130+
</LinearVelocity>
131+
</LinearMechanicalPort>
132+
</VariableGroups>
133+
</OspModelDescription>
134+
```
135+
136+
`OspSystemStructure.xml`
137+
```xml
138+
<OspSystemStructure version="0.1" xmlns="http://opensimulationplatform.com/MSMI/OSPSystemStructure">
139+
<Simulators>
140+
<Simulator name="crane_controller" source="CraneController.fmu" stepSize="1.051732E7"/>
141+
<Simulator name="knuckle_boom_crane" source="KnuckleBoomCrane.fmu" stepSize="1.051732E7"/>
142+
</Simulators>
143+
<Connections>
144+
<VariableConnection>
145+
<Variable simulator="crane_controller" name="Act_Limits[1]"/>
146+
<Variable simulator="knuckle_boom_crane" name="Act_Limits[1]"/>
147+
</VariableConnection>
148+
<VariableGroupConnection>
149+
<VariableGroup simulator="crane_controller" name="linear_mechanical_port"/>
150+
<VariableGroup simulator="knuckle_boom_crane" name="linear_mechanical_port"/>
151+
</VariableGroupConnection>
152+
</Connections>
153+
</OspSystemStructure>
154+
```

0 commit comments

Comments
 (0)