<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" xmlns:dmndi="https://www.omg.org/spec/DMN/20191111/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:biodi="http://bpmn.io/schema/dmn/biodi/2.0" id="marsLander" name="Mars Lander" namespace="http://camunda.org/schema/1.0/dmn" exporter="Camunda Modeler" exporterVersion="4.0.0">
  <inputData id="InputData_0kvngpk" name="hSpeed" />
  <inputData id="InputData_1sfszif" name="dx" />
  <decision id="Decision_1noc97m" name="Adjust hMovement">
    <informationRequirement id="InformationRequirement_0br630r">
      <requiredInput href="#InputData_0kvngpk" />
    </informationRequirement>
    <informationRequirement id="InformationRequirement_0kpaf24">
      <requiredInput href="#InputData_1sfszif" />
    </informationRequirement>
    <decisionTable id="DecisionTable_1ykiv96" hitPolicy="FIRST">
      <input id="InputClause_0v7z6wt" label="hSpeed" biodi:width="192">
        <inputExpression id="LiteralExpression_0kykod3" typeRef="integer">
          <text>hSpeed</text>
        </inputExpression>
      </input>
      <input id="InputClause_1s80yr0" label="dx">
        <inputExpression id="LiteralExpression_0htxk70" typeRef="integer">
          <text>dx</text>
        </inputExpression>
      </input>
      <input id="InputClause_08e7h3t" label="rotate">
        <inputExpression id="LiteralExpression_08qi8n4" typeRef="integer">
          <text>rotate</text>
        </inputExpression>
      </input>
      <output id="OutputClause_1py8ecg" label="newRotate" name="newRotate" typeRef="integer" />
      <output id="OutputClause_02p7wb8" label="power" name="power" typeRef="integer" />
      <rule id="DecisionRule_1yjtrpd">
        <description>We are away from the landing area and we fly in the wrong direction!</description>
        <inputEntry id="UnaryTests_0fvwhuk">
          <text>&lt; 0</text>
        </inputEntry>
        <inputEntry id="UnaryTests_1wrfnlw">
          <text>&lt; -50</text>
        </inputEntry>
        <inputEntry id="UnaryTests_18sk25y">
          <text>&gt; -20</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0kiyu5g">
          <text>rotate - 15</text>
        </outputEntry>
        <outputEntry id="LiteralExpression_11sae8q">
          <text>4</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_1e3cal1">
        <description>Same as above, but symmetricaly</description>
        <inputEntry id="UnaryTests_0wl99gc">
          <text>&gt; 0</text>
        </inputEntry>
        <inputEntry id="UnaryTests_18u87bm">
          <text>&gt; 50</text>
        </inputEntry>
        <inputEntry id="UnaryTests_15nzm52">
          <text>&lt; 20</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1lph4bb">
          <text>rotate + 15</text>
        </outputEntry>
        <outputEntry id="LiteralExpression_105ofzm">
          <text>4</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_1w7tc4v">
        <description>We are at the landing area (power = 1 to balance gravitation)</description>
        <inputEntry id="UnaryTests_0oyn1l2">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_1478arl">
          <text>[-50..50]</text>
        </inputEntry>
        <inputEntry id="UnaryTests_0397i74">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0qhe6dr">
          <text>0</text>
        </outputEntry>
        <outputEntry id="LiteralExpression_02nx7ny">
          <text>1</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_0o6ob7w">
        <description>In all other cases, keep current rotation and move with average power</description>
        <inputEntry id="UnaryTests_139r9dn">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_0uanr5k">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_1d3ouwt">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1qtkqp4">
          <text>rotate</text>
        </outputEntry>
        <outputEntry id="LiteralExpression_1fqj5i9">
          <text>2</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
  <inputData id="InputData_1i1oy70" name="fuel" />
  <decision id="Decision_0kajy96" name="Fuel adjustment">
    <informationRequirement id="InformationRequirement_1k9m6vh">
      <requiredDecision href="#Decision_1noc97m" />
    </informationRequirement>
    <informationRequirement id="InformationRequirement_1j875yh">
      <requiredInput href="#InputData_1i1oy70" />
    </informationRequirement>
    <decisionTable id="DecisionTable_0v0ub64" hitPolicy="FIRST">
      <input id="InputClause_1he58j4" label="power">
        <inputExpression id="LiteralExpression_10xjhmy" typeRef="integer">
          <text>power</text>
        </inputExpression>
      </input>
      <input id="InputClause_1y61bpc" label="fuel" biodi:width="192">
        <inputExpression id="LiteralExpression_1gok4up" typeRef="integer">
          <text>fuel</text>
        </inputExpression>
      </input>
      <output id="OutputClause_1jqz1kx" label="newPower" name="newPower" typeRef="integer" />
      <rule id="DecisionRule_1hbt3pk">
        <description>We have to cut the fuel consumption!</description>
        <inputEntry id="UnaryTests_0mtryxc">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_15ybjqj">
          <text>&lt; 200</text>
        </inputEntry>
        <outputEntry id="LiteralExpression_0er0m0c">
          <text>if power &gt; 2 then power-1 else power</text>
        </outputEntry>
      </rule>
      <rule id="DecisionRule_1e5t5kf">
        <description>Default case</description>
        <inputEntry id="UnaryTests_180sq27">
          <text></text>
        </inputEntry>
        <inputEntry id="UnaryTests_1luvdlk">
          <text></text>
        </inputEntry>
        <outputEntry id="LiteralExpression_1cmadd0">
          <text>power</text>
        </outputEntry>
      </rule>
    </decisionTable>
  </decision>
  <dmndi:DMNDI>
    <dmndi:DMNDiagram id="DMNDiagram_0i21c0s">
      <dmndi:DMNShape id="DMNShape_1qptl33" dmnElementRef="InputData_0kvngpk">
        <dc:Bounds height="45" width="125" x="-13" y="377" />
      </dmndi:DMNShape>
      <dmndi:DMNEdge id="DMNEdge_0blqvgt" dmnElementRef="InformationRequirement_0br630r">
        <di:waypoint x="50" y="377" />
        <di:waypoint x="120" y="350" />
        <di:waypoint x="120" y="330" />
      </dmndi:DMNEdge>
      <dmndi:DMNShape id="DMNShape_09fkdin" dmnElementRef="InputData_1sfszif">
        <dc:Bounds height="45" width="125" x="147" y="377" />
      </dmndi:DMNShape>
      <dmndi:DMNEdge id="DMNEdge_0ysrvvo" dmnElementRef="InformationRequirement_0kpaf24">
        <di:waypoint x="210" y="377" />
        <di:waypoint x="180" y="350" />
        <di:waypoint x="180" y="330" />
      </dmndi:DMNEdge>
      <dmndi:DMNShape id="DMNShape_1mgqrpg" dmnElementRef="Decision_1noc97m">
        <dc:Bounds height="80" width="180" x="60" y="250" />
      </dmndi:DMNShape>
      <dmndi:DMNShape id="DMNShape_1xwpvnu" dmnElementRef="InputData_1i1oy70">
        <dc:Bounds height="45" width="125" x="328" y="258" />
      </dmndi:DMNShape>
      <dmndi:DMNEdge id="DMNEdge_1s55uze" dmnElementRef="InformationRequirement_1k9m6vh">
        <di:waypoint x="150" y="250" />
        <di:waypoint x="250" y="220" />
        <di:waypoint x="250" y="200" />
      </dmndi:DMNEdge>
      <dmndi:DMNEdge id="DMNEdge_0e2ztan" dmnElementRef="InformationRequirement_1j875yh">
        <di:waypoint x="391" y="258" />
        <di:waypoint x="310" y="220" />
        <di:waypoint x="310" y="200" />
      </dmndi:DMNEdge>
      <dmndi:DMNShape id="DMNShape_0cjyryc" dmnElementRef="Decision_0kajy96">
        <dc:Bounds height="80" width="180" x="190" y="120" />
      </dmndi:DMNShape>
    </dmndi:DMNDiagram>
  </dmndi:DMNDI>
</definitions>
