Skip to content

Commit

Permalink
Addition of models design directory (#3)
Browse files Browse the repository at this point in the history
* Copy models schemas

Signed-off-by: Sylvain Leclerc <[email protected]>

* Update README with some information about folders

Signed-off-by: Sylvain Leclerc <[email protected]>

* Fix typo

---------

Signed-off-by: Sylvain Leclerc <[email protected]>
Co-authored-by: Thomas Bittar <[email protected]>
  • Loading branch information
sylvlecl and tbittar authored Feb 12, 2024
1 parent 2cead04 commit 0dbceb0
Show file tree
Hide file tree
Showing 14 changed files with 2,087 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
# andromede-modeling-prototype
Prototype to design future modeling capabilities for Antares simulator.

The repository consists in:
- [src/andromede](./src/andromede):
python package that implements the concepts (models, ports)
and allows for basic simulation using them.
- [tests](./tests):
python tests illustrating the use and behaviour of the concepts
- [models-design](./models-design):
mainly schemas to design the models that one could implement
using our concepts.

22 changes: 22 additions & 0 deletions models-design/model_library/co2quota.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mxfile host="65bd71144e">
<diagram id="mcQPTy7yQngtuQIZVdiC" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Co2Quota : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;" parent="1" vertex="1">
<mxGeometry x="40" y="-1040" width="200" height="120" as="geometry"/>
</mxCell>
<mxCell id="3" value="quota : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="Co2_emission : Emission" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="Co2_emission.sum() &amp;lt;= quota" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="200" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
37 changes: 37 additions & 0 deletions models-design/model_library/converter.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<mxfile host="65bd71144e">
<diagram id="EMHrYCOa_Ugeno0KiGmM" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Converter : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;" parent="1" vertex="1">
<mxGeometry x="40" y="-1080" width="200" height="210" as="geometry"/>
</mxCell>
<mxCell id="3" value="p : Variable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="alpha : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="p &amp;gt;= 0" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="endArrow=none;dashed=1;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint y="119" as="sourcePoint"/>
<mxPoint x="200" y="119" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="7" value="flot_in, flot_out : Flow" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="120" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="flot_in.f = -p" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="150" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="11" value="flot_out.f = alpha x p" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="180" width="200" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
22 changes: 22 additions & 0 deletions models-design/model_library/demand.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mxfile host="65bd71144e">
<diagram id="PCVJZBaL2AoontuTLUzg" name="Page-1">
<mxGraphModel dx="381" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Demand : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;fontColor=#000000;" parent="1" vertex="1">
<mxGeometry x="40" y="-1040" width="200" height="120" as="geometry"/>
</mxCell>
<mxCell id="3" value="d : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="flow_d : Flow" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="200" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="flow_d.f = -d" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="200" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
43 changes: 43 additions & 0 deletions models-design/model_library/link.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<mxfile host="65bd71144e">
<diagram id="sCPvG_bbgsmpPIeMDWso" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Link : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;" parent="1" vertex="1">
<mxGeometry x="40" y="-1080" width="210" height="210" as="geometry"/>
</mxCell>
<mxCell id="3" value="f : Variable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="f_max : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="-f_max &amp;lt;= f &amp;lt;= f_max" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="flow_from, flow_to : flow" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="120" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="endArrow=none;dashed=1;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint y="150" as="sourcePoint"/>
<mxPoint x="210" y="150" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="8" value="flow_from.f = -f" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="150" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="9" value="" style="endArrow=none;dashed=1;html=1;rounded=0;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="2" edge="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint y="119" as="sourcePoint"/>
<mxPoint x="210" y="119" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="10" value="flow_to.f = f" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="180" width="210" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
22 changes: 22 additions & 0 deletions models-design/model_library/node.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<mxfile host="65bd71144e">
<diagram id="animbJuZHiB8cWX2SmNu" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Node : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;fontColor=#000000;" parent="1" vertex="1">
<mxGeometry x="80" y="-960" width="210" height="120" as="geometry"/>
</mxCell>
<mxCell id="3" value="spillage, ens : Variable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="flow_n : Flow" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="210" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="flow_n.f..sum() = spillage - ens" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="210" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
37 changes: 37 additions & 0 deletions models-design/model_library/production.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<mxfile host="65bd71144e">
<diagram id="LTyrFU7vs9haD0b-Y-zQ" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Production : Model" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#CCFFCC;fontColor=#000000;" parent="1" vertex="1">
<mxGeometry x="80" y="-1040" width="230" height="270" as="geometry"/>
</mxCell>
<mxCell id="3" value="p : Variable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="4" value="p_min, p_max : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="60" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="5" value="taux_emission : Parameter" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="90" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="6" value="p_min &amp;lt;= p &amp;lt;= p_max" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="120" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="8" value="flow_p : Flow" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="150" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="9" value="my_emission : Emission" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="180" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="11" value="flow_p.f = p" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="210" width="230" height="30" as="geometry"/>
</mxCell>
<mxCell id="12" value="my_emission.q = taux_emission * p" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="240" width="230" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
16 changes: 16 additions & 0 deletions models-design/port_library/emission.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<mxfile host="65bd71144e">
<diagram id="14tds1TFelBv5ANySv4i" name="Page-1">
<mxGraphModel dx="1008" dy="1843" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Emission : PortType" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;fillColor=#FFCC99;" parent="1" vertex="1">
<mxGeometry x="40" y="-1080" width="140" height="60" as="geometry"/>
</mxCell>
<mxCell id="3" value="q : PortVariable" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="2" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Loading

0 comments on commit 0dbceb0

Please sign in to comment.