<?xml version="1.0" standalone="no"?>
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
    "http://ptolemy.eecs.berkeley.edu/xml/dtd/MoML_1.dtd">
<entity name="power_window_raw" class="ptolemy.actor.TypedCompositeActor">
    <property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.1_20101021">
    </property>
    <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector">
        <property name="stopTime" class="ptolemy.data.expr.Parameter" value="17.0">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[35.0, 25.0]">
        </property>
    </property>
    <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={0, 358, 2111, 692}, maximized=false}">
    </property>
    <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[1898, 582]">
    </property>
    <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.4861943644688">
    </property>
    <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{614.6999174288612, 109.8021150914653}">
    </property>
    <property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
        <property name="textSize" class="ptolemy.data.expr.Parameter" value="12">
        </property>
        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Model of the power window without adaptation &#10;from DE (global model) to SDF (window model)&#10;">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[625.0, 165.0]">
        </property>
    </property>
    <property name="signalName" class="ptolemy.data.expr.Parameter" value="&quot;position&quot;">
    </property>
    <property name="offset" class="ptolemy.data.expr.Parameter" value="0">
        <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
        </property>
    </property>
    <property name="Annotation2" class="ptolemy.vergil.kernel.attributes.TextAttribute">
        <property name="textSize" class="ptolemy.data.expr.Parameter" value="10">
        </property>
        <property name="textColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.2,0.6,0.0,1.0}">
        </property>
        <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Signals:&#10;* position = position of the window (0 = open, 5 = fully closed)&#10;* command = command from the use (0 = stop, -1 = open, 1 = close)&#10;* endStop = event produced when the window is either completely open or completely closed">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[145.0, -85.0]">
        </property>
    </property>
    <entity name="Input scenario" class="ptolemy.actor.lib.DiscreteClock">
        <property name="period" class="ptolemy.actor.parameters.PortParameter" value="17.0">
        </property>
        <property name="offsets" class="ptolemy.data.expr.Parameter" value="{2.0, 2.8, 3.0, 5.0, 7.0, 7.4, 10.0, 10.1}">
        </property>
        <property name="values" class="ptolemy.data.expr.Parameter" value="{1,    0,    1,    0,    1,    0,    -1,     0   }">
        </property>
        <doc>Create periodic timed events.</doc>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, 90.0]">
        </property>
    </entity>
    <entity name="TimedPlotter" class="ptolemy.actor.lib.gui.TimedPlotter">
        <property name="legend" class="ptolemy.kernel.util.StringAttribute" value="position, command, endStop">
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={494, 35, 1186, 714}, maximized=false}">
        </property>
        <property name="_plotSize" class="ptolemy.actor.gui.SizeAttribute" value="[1186, 670]">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[850.0, 75.0]">
        </property>
        <configure>
<?plotml <!DOCTYPE plot PUBLIC "-//UC Berkeley//DTD PlotML 1//EN"
"http://ptolemy.eecs.berkeley.edu/xml/dtd/PlotML_1.dtd">
<plot>
<title>TimedPlotter</title>
<caption></caption>
<xLabel></xLabel>
<yLabel></yLabel>
<xRange min="0.0" max="10.1"/>
<yRange min="-1.0" max="3.0"/>
<default marks="bigdots"/>
</plot>?>
        </configure>
    </entity>
    <entity name="Controler" class="ptolemy.domains.modal.modal.ModalModel">
        <property name="_tableauFactory" class="ptolemy.vergil.modal.modal.ModalTableauFactory">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[210.0, 100.0]">
        </property>
        <port name="command" class="ptolemy.domains.modal.modal.ModalPort">
            <property name="input"/>
        </port>
        <port name="power" class="ptolemy.domains.modal.modal.ModalPort">
            <property name="output"/>
        </port>
        <port name="endStop" class="ptolemy.domains.modal.modal.ModalPort">
            <property name="input"/>
        </port>
        <port name="timeDelay" class="ptolemy.domains.modal.modal.ModalPort">
            <property name="output"/>
        </port>
        <entity name="_Controller" class="ptolemy.domains.modal.modal.ModalController">
            <property name="_library" class="ptolemy.moml.LibraryAttribute">
                <configure>
      <entity name="state library" class="ptolemy.kernel.CompositeEntity"><input source="ptolemy/configs/basicUtilities.xml"></input><entity name="state" class="ptolemy.domains.modal.kernel.State"><property name="_centerName" class="ptolemy.kernel.util.Attribute"></property><property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory"></property></entity></entity>
    </configure>
            </property>
            <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={681, 215, 1198, 1009}, maximized=false}">
            </property>
            <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[985, 898]">
            </property>
            <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="0.9879032924519">
            </property>
            <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{71.5264966560133, 63.5302611071656}">
            </property>
            <property name="Annotation" class="ptolemy.vergil.kernel.attributes.TextAttribute">
                <property name="textSize" class="ptolemy.data.expr.Parameter" value="12">
                </property>
                <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Model of the controler&#10;&#10;Manual and automatic modes:&#10;  - if the user hold the button for less than 0.5s, the window goes into automatic mode, else it goes into manual mode&#10;  - in up modes, if an obstacle is detected, the window goes into emergency down mode for 1.5s">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-280.0, 335.0]">
                </property>
            </property>
            <property name="autoTime" class="ptolemy.data.expr.Parameter" value="0.5">
                <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
                </property>
                <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                    <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                    </property>
                </property>
                <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                    <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
                </property>
                <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-95.0, -345.0]">
                </property>
            </property>
            <property name="emergencyTime" class="ptolemy.data.expr.Parameter" value="1.5">
                <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
                </property>
                <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                    <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                    </property>
                </property>
                <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                    <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
                </property>
                <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[55.0, -345.0]">
                </property>
            </property>
            <property name="Annotation2" class="ptolemy.vergil.kernel.attributes.TextAttribute">
                <property name="textSize" class="ptolemy.data.expr.Parameter" value="12">
                </property>
                <property name="text" class="ptolemy.kernel.util.StringAttribute" value="Note: the delay in the Up and Down states is necessary so that the controller ignores temporarily&#10;the endStop signal which is present when the window starts from the fully closed or open positions.">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-280.0, 425.0]">
                </property>
            </property>
            <port name="command" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-330.0, -205.0]">
                </property>
            </port>
            <port name="power" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[355.0, -195.0]">
                </property>
            </port>
            <port name="endStop" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-295.0, -190.0]">
                </property>
            </port>
            <port name="timeDelay" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[355.0, -250.0]">
                </property>
            </port>
            <entity name="Stop" class="ptolemy.domains.modal.kernel.State">
                <property name="isInitialState" class="ptolemy.data.expr.Parameter" value="false">
                </property>
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-105.0, -25.0]">
                </property>
            </entity>
            <entity name="Up" class="ptolemy.domains.modal.kernel.State">
                <property name="refinementName" class="ptolemy.kernel.util.StringAttribute" value="Up">
                </property>
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-30.0, -185.0]">
                </property>
            </entity>
            <entity name="DownManu" class="ptolemy.domains.modal.kernel.State">
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[70.0, 35.0]">
                </property>
            </entity>
            <entity name="UpAuto" class="ptolemy.domains.modal.kernel.State">
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[200.0, -190.0]">
                </property>
            </entity>
            <entity name="UpManu" class="ptolemy.domains.modal.kernel.State">
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[55.0, -130.0]">
                </property>
            </entity>
            <entity name="init" class="ptolemy.domains.modal.kernel.State">
                <property name="isInitialState" class="ptolemy.data.expr.Parameter" value="true">
                </property>
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-250.0, -25.0]">
                </property>
            </entity>
            <entity name="Down" class="ptolemy.domains.modal.kernel.State">
                <property name="refinementName" class="ptolemy.kernel.util.StringAttribute" value="GoDown">
                </property>
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-20.0, 100.0]">
                </property>
            </entity>
            <entity name="DownAuto" class="ptolemy.domains.modal.kernel.State">
                <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
                </property>
                <property name="_controllerFactory" class="ptolemy.vergil.modal.modal.HierarchicalStateControllerFactory">
                </property>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[85.0, 195.0]">
                </property>
            </entity>
            <relation name="relation" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="command_isPresent &amp;&amp; command == 1">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = 1">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-0.6346419107170251">
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="-0.6164267719301637">
                </property>
                <property name="reset" class="ptolemy.data.expr.Parameter" value="true">
                </property>
            </relation>
            <relation name="relation2" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="command_isPresent &amp;&amp; command == -1">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = -1">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.6283185307179586">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="2.039779146634266">
                </property>
                <property name="reset" class="ptolemy.data.expr.Parameter" value="true">
                </property>
            </relation>
            <relation name="relation3" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="endStop_isPresent || (command_isPresent &amp;&amp; command == 0)">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.0753112107442339">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="-2.254369851179794">
                </property>
            </relation>
            <relation name="relation7" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="command_isPresent &amp;&amp; command == 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-0.32463092686262734">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="-0.06963380574682455">
                </property>
            </relation>
            <relation name="relation8" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="timeDelay_isPresent">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-0.022261368464828932">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="0.6965892267642328">
                </property>
            </relation>
            <relation name="relation4" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="endStop_isPresent || (command_isPresent &amp;&amp; command == 0)">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-0.23587594333045872">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="2.4115924111898077">
                </property>
            </relation>
            <relation name="relation10" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="endStop_isPresent || command_isPresent">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="1.5109180150737866">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="2.6798954478228634">
                </property>
            </relation>
            <relation name="relation11" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="true">
                </property>
                <property name="outputActions" class="ptolemy.domains.modal.kernel.OutputActionsAttribute" value="power = 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-0.0031447373909807737">
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="-5.352738399609937E-4">
                </property>
            </relation>
            <relation name="relation12" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="timeDelay_isPresent">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="0.6283185307179586">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="0.5036339221736308">
                </property>
            </relation>
            <relation name="relation13" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="command_isPresent &amp;&amp; command == 0">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-3.865065168598431E-4">
                    <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
                    </property>
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="0.7353946796441381">
                </property>
            </relation>
            <relation name="relation14" class="ptolemy.domains.modal.kernel.Transition">
                <property name="guardExpression" class="ptolemy.kernel.util.StringAttribute" value="endStop_isPresent">
                </property>
                <property name="exitAngle" class="ptolemy.data.expr.Parameter" value="-1.2528330537685848">
                </property>
                <property name="gamma" class="ptolemy.data.expr.Parameter" value="-1.6232196191585258">
                </property>
            </relation>
            <link port="Stop.incomingPort" relation="relation3"/>
            <link port="Stop.incomingPort" relation="relation4"/>
            <link port="Stop.incomingPort" relation="relation10"/>
            <link port="Stop.incomingPort" relation="relation11"/>
            <link port="Stop.incomingPort" relation="relation14"/>
            <link port="Stop.outgoingPort" relation="relation"/>
            <link port="Stop.outgoingPort" relation="relation2"/>
            <link port="Up.incomingPort" relation="relation"/>
            <link port="Up.outgoingPort" relation="relation7"/>
            <link port="Up.outgoingPort" relation="relation8"/>
            <link port="DownManu.incomingPort" relation="relation12"/>
            <link port="DownManu.outgoingPort" relation="relation3"/>
            <link port="UpAuto.incomingPort" relation="relation7"/>
            <link port="UpAuto.outgoingPort" relation="relation10"/>
            <link port="UpManu.incomingPort" relation="relation8"/>
            <link port="UpManu.outgoingPort" relation="relation4"/>
            <link port="init.outgoingPort" relation="relation11"/>
            <link port="Down.incomingPort" relation="relation2"/>
            <link port="Down.outgoingPort" relation="relation12"/>
            <link port="Down.outgoingPort" relation="relation13"/>
            <link port="DownAuto.incomingPort" relation="relation13"/>
            <link port="DownAuto.outgoingPort" relation="relation14"/>
        </entity>
        <entity name="Up" class="ptolemy.domains.modal.modal.Refinement">
            <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector">
                <property name="_location" class="ptolemy.kernel.util.Location" value="{-295, -285}">
                </property>
            </property>
            <port name="command" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-330.0, -205.0]">
                </property>
            </port>
            <port name="power" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[55.0, -185.0]">
                </property>
            </port>
            <port name="endStop" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-295.0, -190.0]">
                </property>
            </port>
            <port name="timeDelay" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[25.0, -210.0]">
                </property>
            </port>
            <entity name="DiscreteClock" class="ptolemy.actor.lib.DiscreteClock">
                <property name="period" class="ptolemy.actor.parameters.PortParameter" value="autoTime">
                </property>
                <property name="offsets" class="ptolemy.data.expr.Parameter" value="{autoTime}">
                </property>
                <doc>Create periodic timed events.</doc>
                <property name="_location" class="ptolemy.kernel.util.Location" value="{-165, -210}">
                </property>
            </entity>
            <relation name="relation" class="ptolemy.actor.TypedIORelation">
            </relation>
            <link port="timeDelay" relation="relation"/>
            <link port="DiscreteClock.output" relation="relation"/>
        </entity>
        <entity name="GoDown" class="ptolemy.domains.modal.modal.Refinement">
            <property name="DE Director" class="ptolemy.domains.de.kernel.DEDirector">
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-310.0, -275.0]">
                </property>
            </property>
            <port name="command" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-330.0, -205.0]">
                </property>
            </port>
            <port name="power" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[10.0, -195.0]">
                </property>
            </port>
            <port name="endStop" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="input"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-295.0, -190.0]">
                </property>
            </port>
            <port name="timeDelay" class="ptolemy.domains.modal.modal.RefinementPort">
                <property name="output"/>
                <property name="_location" class="ptolemy.kernel.util.Location" value="[-20.0, -220.0]">
                </property>
            </port>
            <entity name="DiscreteClock" class="ptolemy.actor.lib.DiscreteClock">
                <property name="period" class="ptolemy.actor.parameters.PortParameter" value="autoTime">
                </property>
                <property name="offsets" class="ptolemy.data.expr.Parameter" value="{autoTime}">
                </property>
                <doc>Create periodic timed events.</doc>
                <property name="_location" class="ptolemy.kernel.util.Location" value="{-135, -220}">
                </property>
            </entity>
            <relation name="relation" class="ptolemy.actor.TypedIORelation">
            </relation>
            <link port="timeDelay" relation="relation"/>
            <link port="DiscreteClock.output" relation="relation"/>
        </entity>
        <relation name="commandRelation" class="ptolemy.actor.TypedIORelation">
            <property name="width" class="ptolemy.data.expr.Parameter" value="Auto">
            </property>
        </relation>
        <relation name="powerRelation" class="ptolemy.actor.TypedIORelation">
            <property name="width" class="ptolemy.data.expr.Parameter" value="Auto">
            </property>
        </relation>
        <relation name="endStopRelation" class="ptolemy.actor.TypedIORelation">
            <property name="width" class="ptolemy.data.expr.Parameter" value="Auto">
            </property>
        </relation>
        <relation name="timeDelayRelation" class="ptolemy.actor.TypedIORelation">
            <property name="width" class="ptolemy.data.expr.Parameter" value="Auto">
            </property>
        </relation>
        <link port="command" relation="commandRelation"/>
        <link port="power" relation="powerRelation"/>
        <link port="endStop" relation="endStopRelation"/>
        <link port="timeDelay" relation="timeDelayRelation"/>
        <link port="_Controller.command" relation="commandRelation"/>
        <link port="_Controller.power" relation="powerRelation"/>
        <link port="_Controller.endStop" relation="endStopRelation"/>
        <link port="_Controller.timeDelay" relation="timeDelayRelation"/>
        <link port="Up.command" relation="commandRelation"/>
        <link port="Up.power" relation="powerRelation"/>
        <link port="Up.endStop" relation="endStopRelation"/>
        <link port="Up.timeDelay" relation="timeDelayRelation"/>
        <link port="GoDown.command" relation="commandRelation"/>
        <link port="GoDown.power" relation="powerRelation"/>
        <link port="GoDown.endStop" relation="endStopRelation"/>
        <link port="GoDown.timeDelay" relation="timeDelayRelation"/>
    </entity>
    <entity name="Publisher7" class="ptolemy.actor.lib.Publisher">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="command">
        </property>
        <doc>Publish the input values to all matching Subscribers.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.85, 0.6, 0.58, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[145.0, 45.0]">
        </property>
        <property name="_rotatePorts" class="ptolemy.data.expr.Parameter" value="-90">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Subscriber7" class="ptolemy.actor.lib.Subscriber">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="command">
        </property>
        <doc>Produce a sequence generated by a matching Publisher.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.76, 0.84, 0.6, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[660.0, 70.0]">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Publisher" class="ptolemy.actor.lib.Publisher">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="endStop">
        </property>
        <doc>Publish the input values to all matching Subscribers.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.85, 0.6, 0.58, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[415.0, 190.0]">
        </property>
        <property name="_rotatePorts" class="ptolemy.data.expr.Parameter" value="90">
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Subscriber3" class="ptolemy.actor.lib.Subscriber">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="endStop">
        </property>
        <doc>Produce a sequence generated by a matching Publisher.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.76, 0.84, 0.6, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[660.0, 115.0]">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Publisher2" class="ptolemy.actor.lib.Publisher">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="position">
        </property>
        <doc>Publish the input values to all matching Subscribers.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.85, 0.6, 0.58, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[415.0, 80.0]">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Subscriber" class="ptolemy.actor.lib.Subscriber">
        <property name="channel" class="ptolemy.data.expr.StringParameter" value="position">
        </property>
        <doc>Produce a sequence generated by a matching Publisher.</doc>
        <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
            <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="channel">
            </property>
            <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
            </property>
            <property name="boxColor" class="ptolemy.actor.gui.ColorAttribute" value="{0.76, 0.84, 0.6, 1.0}">
            </property>
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[660.0, 25.0]">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="TimeDelay" class="ptolemy.actor.lib.TimeDelay">
        <property name="delay" class="ptolemy.data.expr.Parameter" value="0.1">
        </property>
        <property name="_location" class="ptolemy.kernel.util.Location" value="[275.0, 155.0]">
        </property>
        <property name="_flipPortsHorizontal" class="ptolemy.data.expr.Parameter" value="true">
        </property>
        <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
        </property>
    </entity>
    <entity name="Window" class="ptolemy.actor.TypedCompositeActor">
        <property name="_location" class="ptolemy.kernel.util.Location" value="[320.0, 90.0]">
        </property>
        <property name="SDF Director" class="ptolemy.domains.sdf.kernel.SDFDirector">
            <property name="allowDisconnectedGraphs" class="ptolemy.data.expr.Parameter" value="true">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[85.0, 45.0]">
            </property>
        </property>
        <property name="low" class="ptolemy.data.expr.Parameter" value="0.0">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                </property>
            </property>
            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="{270, 50}">
            </property>
        </property>
        <property name="high" class="ptolemy.data.expr.Parameter" value="5.0">
            <property name="_hideName" class="ptolemy.kernel.util.SingletonAttribute">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.ValueIcon">
                <property name="_color" class="ptolemy.actor.gui.ColorAttribute" value="{0.0, 0.0, 1.0, 1.0}">
                </property>
            </property>
            <property name="_smallIconDescription" class="ptolemy.kernel.util.SingletonConfigurableAttribute">
                <configure>
      <svg>
        <text x="20" style="font-size:14; font-family:SansSerif; fill:blue" y="20">-P-</text>
      </svg>
    </configure>
            </property>
            <property name="_editorFactory" class="ptolemy.vergil.toolbox.VisibleParameterEditorFactory">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[270.0, 70.0]">
            </property>
        </property>
        <property name="_windowProperties" class="ptolemy.actor.gui.WindowPropertiesAttribute" value="{bounds={781, 130, 907, 580}, maximized=false}">
        </property>
        <property name="_vergilSize" class="ptolemy.actor.gui.SizeAttribute" value="[694, 470]">
        </property>
        <property name="_vergilZoomFactor" class="ptolemy.data.expr.ExpertParameter" value="1.0">
        </property>
        <property name="_vergilCenter" class="ptolemy.data.expr.ExpertParameter" value="{347.0, 235.0}">
        </property>
        <port name="power" class="ptolemy.actor.TypedIOPort">
            <property name="input"/>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[30.0, 180.0]">
            </property>
        </port>
        <port name="position" class="ptolemy.actor.TypedIOPort">
            <property name="output"/>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[480.0, 190.0]">
            </property>
        </port>
        <port name="endStop" class="ptolemy.actor.TypedIOPort">
            <property name="output"/>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[645.0, 295.0]">
            </property>
        </port>
        <entity name="Scale" class="ptolemy.actor.lib.Scale">
            <property name="factor" class="ptolemy.data.expr.Parameter" value="1">
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.AttributeValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="factor">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[115.0, 180.0]">
            </property>
        </entity>
        <entity name="Accumulator" class="ptolemy.actor.lib.Accumulator">
            <property name="lowerBound" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="upperBound" class="ptolemy.data.expr.Parameter" value="10">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[265.0, 190.0]">
            </property>
        </entity>
        <entity name="Comparator" class="ptolemy.actor.lib.logic.Comparator">
            <property name="comparison" class="ptolemy.kernel.util.StringAttribute" value="&gt;=">
                <property name="style" class="ptolemy.actor.gui.style.ChoiceStyle">
                    <property name="gt" class="ptolemy.kernel.util.StringAttribute" value="&gt;">
                    </property>
                    <property name="ge" class="ptolemy.kernel.util.StringAttribute" value="&gt;=">
                    </property>
                    <property name="lt" class="ptolemy.kernel.util.StringAttribute" value="&lt;">
                    </property>
                    <property name="le" class="ptolemy.kernel.util.StringAttribute" value="&lt;=">
                    </property>
                    <property name="eq" class="ptolemy.kernel.util.StringAttribute" value="==">
                    </property>
                </property>
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.AttributeValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="comparison">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[385.0, 285.0]">
            </property>
        </entity>
        <entity name="Comparator2" class="ptolemy.actor.lib.logic.Comparator">
            <property name="comparison" class="ptolemy.kernel.util.StringAttribute" value="&lt;=">
                <property name="style" class="ptolemy.actor.gui.style.ChoiceStyle">
                    <property name="gt" class="ptolemy.kernel.util.StringAttribute" value="&gt;">
                    </property>
                    <property name="ge" class="ptolemy.kernel.util.StringAttribute" value="&gt;=">
                    </property>
                    <property name="lt" class="ptolemy.kernel.util.StringAttribute" value="&lt;">
                    </property>
                    <property name="le" class="ptolemy.kernel.util.StringAttribute" value="&lt;=">
                    </property>
                    <property name="eq" class="ptolemy.kernel.util.StringAttribute" value="==">
                    </property>
                </property>
            </property>
            <property name="_icon" class="ptolemy.vergil.icon.AttributeValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="comparison">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[385.0, 365.0]">
            </property>
        </entity>
        <entity name="Const" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="high">
            </property>
            <doc>Create a constant sequence.</doc>
            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
                </property>
                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[205.0, 295.0]">
            </property>
        </entity>
        <entity name="Const2" class="ptolemy.actor.lib.Const">
            <property name="value" class="ptolemy.data.expr.Parameter" value="low">
            </property>
            <doc>Create a constant sequence.</doc>
            <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
                <property name="attributeName" class="ptolemy.kernel.util.StringAttribute" value="value">
                </property>
                <property name="displayWidth" class="ptolemy.data.expr.Parameter" value="60">
                </property>
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[208.3332290649414, 374.99879455566406]">
            </property>
        </entity>
        <entity name="Limiter" class="ptolemy.actor.lib.Limiter">
            <property name="bottom" class="ptolemy.data.expr.Parameter" value="low">
            </property>
            <property name="top" class="ptolemy.data.expr.Parameter" value="high">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[415.0, 190.0]">
            </property>
        </entity>
        <entity name="BooleanToAnything" class="ptolemy.actor.lib.conversions.BooleanToAnything">
            <property name="falseValue" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="trueValue" class="ptolemy.data.expr.Parameter" value="1">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[475.0, 285.0]">
            </property>
            <property name="_flipPortsHorizontal" class="ptolemy.data.expr.Parameter" value="false">
            </property>
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
        </entity>
        <entity name="BooleanToAnything2" class="ptolemy.actor.lib.conversions.BooleanToAnything">
            <property name="falseValue" class="ptolemy.data.expr.Parameter" value="0">
            </property>
            <property name="trueValue" class="ptolemy.data.expr.Parameter" value="1">
            </property>
            <property name="_location" class="ptolemy.kernel.util.Location" value="[475.0, 365.0]">
            </property>
            <property name="_flipPortsHorizontal" class="ptolemy.data.expr.Parameter" value="false">
            </property>
            <property name="_hideName" class="ptolemy.data.expr.SingletonParameter" value="true">
            </property>
        </entity>
        <entity name="AddSubtract" class="ptolemy.actor.lib.AddSubtract">
            <property name="_location" class="ptolemy.kernel.util.Location" value="[570.0, 295.0]">
            </property>
        </entity>
        <relation name="relation" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation3" class="ptolemy.actor.TypedIORelation">
            <vertex name="vertex1" value="[325.0, 190.0]">
            </vertex>
        </relation>
        <relation name="relation4" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation6" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation10" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation2" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation5" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation7" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation8" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation9" class="ptolemy.actor.TypedIORelation">
        </relation>
        <relation name="relation11" class="ptolemy.actor.TypedIORelation">
        </relation>
        <link port="power" relation="relation"/>
        <link port="position" relation="relation10"/>
        <link port="endStop" relation="relation11"/>
        <link port="Scale.input" relation="relation"/>
        <link port="Scale.output" relation="relation2"/>
        <link port="Accumulator.input" relation="relation2"/>
        <link port="Accumulator.output" relation="relation3"/>
        <link port="Comparator.left" relation="relation3"/>
        <link port="Comparator.right" relation="relation4"/>
        <link port="Comparator.output" relation="relation5"/>
        <link port="Comparator2.left" relation="relation3"/>
        <link port="Comparator2.right" relation="relation6"/>
        <link port="Comparator2.output" relation="relation7"/>
        <link port="Const.output" relation="relation4"/>
        <link port="Const2.output" relation="relation6"/>
        <link port="Limiter.input" relation="relation3"/>
        <link port="Limiter.output" relation="relation10"/>
        <link port="BooleanToAnything.input" relation="relation5"/>
        <link port="BooleanToAnything.output" relation="relation8"/>
        <link port="BooleanToAnything2.input" relation="relation7"/>
        <link port="BooleanToAnything2.output" relation="relation9"/>
        <link port="AddSubtract.plus" relation="relation8"/>
        <link port="AddSubtract.minus" relation="relation9"/>
        <link port="AddSubtract.output" relation="relation11"/>
    </entity>
    <relation name="relation13" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[100.0, 90.0]">
        </vertex>
    </relation>
    <relation name="relation10" class="ptolemy.actor.TypedIORelation">
        <vertex name="vertex1" value="[415.0, 155.0]">
        </vertex>
    </relation>
    <relation name="relation2" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation5" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation6" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation7" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation3" class="ptolemy.actor.TypedIORelation">
    </relation>
    <relation name="relation4" class="ptolemy.actor.TypedIORelation">
    </relation>
    <link port="Input scenario.output" relation="relation13"/>
    <link port="TimedPlotter.input" relation="relation5"/>
    <link port="TimedPlotter.input" relation="relation6"/>
    <link port="TimedPlotter.input" relation="relation7"/>
    <link port="Controler.command" relation="relation13"/>
    <link port="Controler.power" relation="relation3"/>
    <link port="Controler.endStop" relation="relation2"/>
    <link port="Publisher7.input" relation="relation13"/>
    <link port="Subscriber7.output" relation="relation6"/>
    <link port="Publisher.input" relation="relation10"/>
    <link port="Subscriber3.output" relation="relation7"/>
    <link port="Publisher2.input" relation="relation4"/>
    <link port="Subscriber.output" relation="relation5"/>
    <link port="TimeDelay.input" relation="relation10"/>
    <link port="TimeDelay.output" relation="relation2"/>
    <link port="Window.power" relation="relation3"/>
    <link port="Window.position" relation="relation4"/>
    <link port="Window.endStop" relation="relation10"/>
</entity>
