<?xml version="1.0" encoding="UTF-8"?>
<program xmlns="http://www.nomoseed.org/program" name="tutorial_4">
  <header xmlns="http://www.nomoseed.org/project">
    <author>Cédric Coussinet (cedric.coussinet@nomoseed.net)</author>
    <copyright>
      <mention xml:lang="en">
        Copyright (2013) Cédric Coussinet
      </mention>
    </copyright>
    <license name="GPLv3">
      <mention xml:lang="en">
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published
        by the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
        
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
        GNU General Public License for more details.
        
        You should have received a copy of the GNU General Public License
        along with this program. If not, see http://www.gnu.org/licenses
      </mention>
    </license>
    <datetime>2013-10-22T06:37:56Z</datetime>
    <version/>
    <annotation>
      <documentation xml:lang="fr">
        Programme  correspondant à l'exemple de création d'une règle quelconque avec des variantes la gestion des indices temporelles dans le cadre du tutoriel sur la création de règle.
      </documentation>
    </annotation>
  </header>
  <body>
    <models xmlns:xi="http://www.w3.org/2001/XInclude">
      <new instance="tutorial_4">
        <xi:include href="tutorial_4.mod" parse="xml"/>
      </new>
    </models>
    <scheme>
      <rule name="advance">
        <conclusion model="tutorial_4" category="command" type="motor">
          <information value="advance"/>
          <output value="2"/>
        </conclusion>
      </rule>
      <rule name="detect_anomaly">
        <premise model="plant" category="anomaly" type="anomaly">
          <information tolerance="INF"/>
          <credibility tolerance="INF"/>
          <timespan value="0" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="command" type="sound">
          <information value="red"/>
          <output value="0"/>
        </conclusion>
      </rule>
      <rule name="detect_conception">
        <premise model="tutorial_4" category="conception" type="concept_a">
          <information tolerance="INF"/>
          <credibility tolerance="INF"/>
          <timespan value="0" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="command" type="sound">
          <information value="green"/>
          <output value="100"/>
        </conclusion>
      </rule>
      <rule name="hue_blue">
        <premise model="tutorial_4" category="input" type="hue">
          <information value="200" tolerance="1"/>
        </premise>
        <conclusion model="tutorial_4" category="perception" type="hue">
          <information value="blue"/>
        </conclusion>
      </rule>
      <rule name="hue_unknown">
        <premise model="tutorial_4" category="input" type="hue">
          <information tolerance="INF"/>
        </premise>
        <conclusion model="tutorial_4" category="perception" type="hue">
          <information value="default"/>
        </conclusion>
      </rule>
      <rule name="begin_affectation" relevance="0">
        <conclusion model="plant" category="transition" type="transition">
          <information value="begin_affectation"/>
        </conclusion>
      </rule>
      <rule name="scope_hue">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="1" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="scope" type="register_01">
          <information value="perception"/>
        </conclusion>
      </rule>
      <rule name="scope_concept_a">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="1" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="scope" type="register_02">
          <information value="concept_a"/>
        </conclusion>
      </rule>
      <rule name="copy_hue">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="3" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="operator" type="register_01">
          <information value="get_before"/>
        </conclusion>
      </rule>
      <rule name="create_conception">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="4" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="operator" type="register_02">
          <information value="create_conception"/>
        </conclusion>
      </rule>
      <rule name="target_reference">
        <premise model="plant" category="operator" type="register_02">
          <information value="create_conception" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="0" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="operator" type="register_02">
          <information value="transform_in_temporal_reference"/>
        </conclusion>
      </rule>
      <!--rule name="forward_concept_a">
        <premise model="plant" category="operator" type="register_02">
          <information value="create_conception" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="0" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="operator" type="register_02">
          <information value="forward"/>
        </conclusion>
      </rule-->
      <rule name="begin_excitation">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="6" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="transition" type="transition">
          <information value="begin_excitation"/>
        </conclusion>
      </rule>
      <rule name="create_premise">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="6" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="operator" type="register_01">
          <information value="create_premise_1"/>
        </conclusion>
      </rule>
      <rule name="begin_finalization">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="7" tolerance="0"/>
        </premise>
        <conclusion model="plant" category="transition" type="transition">
          <information value="begin_finalization"/>
        </conclusion>
      </rule>
      <rule name="create_conclusion">
        <premise model="plant" category="transition" type="transition">
          <information value="begin_affectation" tolerance="0"/>
          <credibility tolerance="INF"/>
          <timespan value="7" tolerance="0"/>
        </premise>
        <conclusion model="tutorial_4" category="operator" type="register_02">
          <information value="create_conclusion_1"/>
        </conclusion>
      </rule>
    </scheme>
  </body>
</program>
