Skip to content

Commit

Permalink
OA: RL PID Controller (SISO) #1050
Browse files Browse the repository at this point in the history
  • Loading branch information
amesin13 committed Sep 19, 2024
1 parent ded4676 commit 04e7995
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 124 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.8 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.8">
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Page-1">
<mxGraphModel dx="2505" dy="1504" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2336" pageHeight="1654" math="0" shadow="0">
<mxGraphModel dx="4445" dy="1266" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="2336" pageHeight="1654" math="0" shadow="0">
<root>
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
<mxCell id="BeWae3hQQ1d45eF7kmdL-41" value="RLPIDPolicy&#xa;(rl.Policy)" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#f8cecc;strokeColor=#b85450;swimlaneFillColor=#ffffff;gradientColor=#FFFFFF;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1201" y="1054" width="300.21" height="347" as="geometry">
<mxGeometry x="860" y="1055" width="300.21" height="350" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
</mxGeometry>
</mxCell>
Expand All @@ -24,11 +24,11 @@
<mxCell id="plzq9qEc0_SEy0y6B51N-43" value="__init__(&#xa;                rl_controller:PIDController,&#xa;                p_observation_space : MSpace,&#xa;                p_action_space : MSpace,&#xa;                p_id = None,&#xa;                p_buffer_size : int ,&#xa;                p_ada : bool,...  )&#xa;&#xa;" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=default;" vertex="1" parent="BeWae3hQQ1d45eF7kmdL-41">
<mxGeometry y="126" width="300.21" height="118" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-48" value="_adapt(p_sars_elem: SARSElement)  -&gt; bool" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=#0000ff;" vertex="1" parent="BeWae3hQQ1d45eF7kmdL-41">
<mxGeometry y="244" width="300.21" height="30" as="geometry" />
<mxCell id="plzq9qEc0_SEy0y6B51N-48" value="_adapt(&#xa;            p_sars_elem: SARSElement,&#xa;            reward:float)  -&gt; bool)&#xa;        &#xa;" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=#0000ff;" vertex="1" parent="BeWae3hQQ1d45eF7kmdL-41">
<mxGeometry y="244" width="300.21" height="56" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-49" value="compute_action(p_obs: State)  -&gt; Action" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=#0000ff;" vertex="1" parent="BeWae3hQQ1d45eF7kmdL-41">
<mxGeometry y="274" width="300.21" height="30" as="geometry" />
<mxGeometry y="300" width="300.21" height="30" as="geometry" />
</mxCell>
<mxCell id="fcJVb3HREh7NScvAmxeq-1" value="&lt;font color=&quot;#000000&quot; size=&quot;1&quot;&gt;&lt;b style=&quot;font-size: 14px&quot;&gt;Legend:&lt;br&gt;&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;font color=&quot;#0000ff&quot; style=&quot;font-size: 6px&quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;span style=&quot;color: rgb(0 , 0 , 0)&quot;&gt;&lt;font style=&quot;font-size: 4px&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/font&gt;&amp;nbsp;In progress&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; In validation&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Ready to use&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;nbsp;&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;attribute / method()&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; New public attribute/method to be implemented&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;attribute / method()&lt;span&gt; &lt;/span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;New/inherited public attribute/method that is implemented here&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot;&gt;&amp;nbsp;_attribute /&amp;nbsp;&lt;/font&gt;&lt;font color=&quot;#0000ff&quot;&gt;_method()&amp;nbsp; &amp;nbsp; New protected method/attribute to be implemented&lt;/font&gt;&lt;br&gt;&lt;font color=&quot;#000000&quot;&gt;&amp;nbsp;_attribute / _method()&amp;nbsp; &amp;nbsp; New/inherited protected attribute/method that is implemented here&lt;br&gt;&lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/font&gt;" style="text;html=1;align=left;verticalAlign=top;whiteSpace=wrap;rounded=0;fontColor=#006600;strokeColor=#000000;shadow=1;fillColor=#ffffff;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="40.000000000000014" y="40" width="489.99999999999994" height="220" as="geometry" />
Expand Down Expand Up @@ -75,14 +75,11 @@
<mxGeometry y="26" width="40.83333333333333" height="8" as="geometry" />
</mxCell>
<mxCell id="ileNQNyZ_AMet26Fjr1Y-8" value="&lt;b style=&quot;border-color: var(--border-color);&quot;&gt;...&lt;br&gt;&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;align=left;spacingLeft=2;verticalAlign=top;fillColor=#fff2cc;strokeColor=#d6b656;gradientColor=none;shadow=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1500" y="963" width="139.79" height="63" as="geometry" />
<mxGeometry x="1159" y="964" width="139.79" height="63" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;endArrow=block;endFill=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="hLljpAVa1X0r8kKFUywM-0" target="plzq9qEc0_SEy0y6B51N-0">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-46" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="hLljpAVa1X0r8kKFUywM-0" target="hLljpAVa1X0r8kKFUywM-19">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="hLljpAVa1X0r8kKFUywM-0" value="RLController &#xa;(oa.control.OAController)" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#f8cecc;strokeColor=#b85450;swimlaneFillColor=#ffffff;gradientColor=#FFFFFF;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="260" y="972" width="320" height="482" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
Expand All @@ -97,7 +94,7 @@
<mxCell id="plzq9qEc0_SEy0y6B51N-50" value="_rl_policy : rl.Policy" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=default;" vertex="1" parent="hLljpAVa1X0r8kKFUywM-0">
<mxGeometry y="92" width="320" height="26" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-52" value="_reward : float" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=default;" vertex="1" parent="hLljpAVa1X0r8kKFUywM-0">
<mxCell id="plzq9qEc0_SEy0y6B51N-52" value="_fc_reward : r..FcReward" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=default;" vertex="1" parent="hLljpAVa1X0r8kKFUywM-0">
<mxGeometry y="118" width="320" height="26" as="geometry" />
</mxCell>
<mxCell id="hLljpAVa1X0r8kKFUywM-3" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="hLljpAVa1X0r8kKFUywM-0" vertex="1">
Expand All @@ -119,7 +116,7 @@
<mxGeometry y="372" width="320" height="110" as="geometry" />
</mxCell>
<mxCell id="hLljpAVa1X0r8kKFUywM-5" value="bf.control.PIDController &#xa;(bf.control.Controller)" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#f8cecc;strokeColor=#b85450;swimlaneFillColor=#ffffff;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1780" y="1065" width="300" height="370" as="geometry">
<mxGeometry x="1439" y="1066" width="300" height="370" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
</mxGeometry>
</mxCell>
Expand All @@ -142,7 +139,7 @@
<mxGeometry y="160" width="300" height="100" as="geometry" />
</mxCell>
<mxCell id="hLljpAVa1X0r8kKFUywM-10" value="rl.Policy&#xa;(bf.ml.Model)" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#dae8fc;strokeColor=#6c8ebf;swimlaneFillColor=#ffffff;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="1210" y="410" width="300" height="380" as="geometry">
<mxGeometry x="869" y="411" width="300" height="380" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
</mxGeometry>
</mxCell>
Expand Down Expand Up @@ -177,7 +174,7 @@
<mxGeometry y="350" width="300" height="30" as="geometry" />
</mxCell>
<mxCell id="hLljpAVa1X0r8kKFUywM-19" value="rl.FctReward" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#dae8fc;strokeColor=#6c8ebf;swimlaneFillColor=#ffffff;dashed=1;" parent="WIyWlLk6GJQsqaUBKTNV-1" vertex="1">
<mxGeometry x="271" y="1610" width="300" height="120" as="geometry">
<mxGeometry x="-130" y="1092" width="300" height="220" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
</mxGeometry>
</mxCell>
Expand All @@ -190,6 +187,12 @@
<mxCell id="hLljpAVa1X0r8kKFUywM-22" value="" style="line;html=1;strokeWidth=1;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=3;rotatable=0;labelPosition=right;points=[];portConstraint=eastwest;" parent="hLljpAVa1X0r8kKFUywM-19" vertex="1">
<mxGeometry y="92" width="300" height="8" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-55" value="compute_reward(&#xa;                            p_state_old:State,&#xa;                            p_state_new:State) -&gt; Reward" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=default;" vertex="1" parent="hLljpAVa1X0r8kKFUywM-19">
<mxGeometry y="100" width="300" height="50" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-56" value="_compute_reward(&#xa;                            p_state_old:State,&#xa;                            p_state_new:State) -&gt; Reward" style="text;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontColor=#0000ff;" vertex="1" parent="hLljpAVa1X0r8kKFUywM-19">
<mxGeometry y="150" width="300" height="50" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-0" value="OAController &#xa;(bf.control.Controller,bf.ml.Model)" style="swimlane;fontStyle=3;align=center;verticalAlign=top;childLayout=stackLayout;horizontal=1;startSize=40;horizontalStack=0;resizeParent=1;resizeLast=0;collapsible=1;marginBottom=0;rounded=0;shadow=1;strokeWidth=3;fillColor=#fff2cc;strokeColor=#d6b656;swimlaneFillColor=#ffffff;" vertex="1" parent="WIyWlLk6GJQsqaUBKTNV-1">
<mxGeometry x="270" y="327" width="300" height="500" as="geometry">
<mxRectangle x="230" y="140" width="160" height="26" as="alternateBounds" />
Expand Down Expand Up @@ -224,12 +227,15 @@
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" target="plzq9qEc0_SEy0y6B51N-21">
<mxGeometry relative="1" as="geometry">
<mxPoint x="1501.21" y="1298" as="sourcePoint" />
<mxPoint x="1160.21" y="1299" as="sourcePoint" />
</mxGeometry>
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-51" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="plzq9qEc0_SEy0y6B51N-44" target="plzq9qEc0_SEy0y6B51N-43">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<mxCell id="plzq9qEc0_SEy0y6B51N-54" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1.005;entryY=0.048;entryDx=0;entryDy=0;entryPerimeter=0;" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="hLljpAVa1X0r8kKFUywM-37" target="hLljpAVa1X0r8kKFUywM-21">
<mxGeometry relative="1" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
Expand Down
Loading

0 comments on commit 04e7995

Please sign in to comment.