<?xml version="1.0" encoding="UTF-8"?>
<program xmlns="http://www.nomoseed.org/program" name="controller">
<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>2014-07-08T10:41:46Z</datetime>
    <version>0.0</version>
    <annotation>
      <documentation xml:lang="fr">Quel est le contexte ?</documentation>
    </annotation>
  </header>
<body>
<models>
<new instance="controller">
<model xmlns="http://www.nomoseed.org/model" name="controller">
<base>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../../formalisms/automaton/automaton.mod" parse="xml"/>
</base>
<definition>
<conception_type name="state">
<items>
<item name="search_location"/>
<item name="search_sphere"/>
<item name="start"/>
<item name="terminate"/>
</items>
</conception_type>
<conception_type name="event">
<items>
<item name="found"/>
<item name="no_found"/>
<item name="switched_to_off"/>
<item name="switched_to_on"/>
</items>
</conception_type>
</definition>
</model>
</new>
</models>
<scheme>
<rule name="initialize" relevance="0.0">
<conclusion category="conception" model="controller" type="state">
<information value="start" delay="0"/>
</conclusion>
</rule>
<rule name="search_location">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_location" delay="MAX"/>
</conclusion>
</rule>
<rule name="search_sphere">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_sphere" delay="MAX"/>
</conclusion>
</rule>
<rule name="start">
<premise category="conception" model="controller" type="state">
<information value="start" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="start" delay="MAX"/>
</conclusion>
</rule>
<rule name="terminate">
<premise category="conception" model="controller" type="state">
<information value="terminate" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate" delay="MAX"/>
</conclusion>
</rule>
<scheme name="search_location">
<rule name="search_location_no_found_search_location_front">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="no_found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_location"/>
</conclusion>
</rule>
<rule name="search_location_no_found_search_location">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="no_found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_location"/>
</conclusion>
</rule>
<rule name="search_location_found_terminate_front">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
<rule name="search_location_found_terminate">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
<rule name="search_location_switched_to_off_terminate_front">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
<rule name="search_location_switched_to_off_terminate">
<premise category="conception" model="controller" type="state">
<information value="search_location" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
</scheme>
<scheme name="search_sphere">
<rule name="search_sphere_no_found_search_sphere_front">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="no_found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_sphere"/>
</conclusion>
</rule>
<rule name="search_sphere_no_found_search_sphere">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="no_found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_sphere"/>
</conclusion>
</rule>
<rule name="search_sphere_found_search_location_front">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_location"/>
</conclusion>
</rule>
<rule name="search_sphere_found_search_location">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="found" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_location"/>
</conclusion>
</rule>
<rule name="search_sphere_switched_to_off_terminate_front">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
<rule name="search_sphere_switched_to_off_terminate">
<premise category="conception" model="controller" type="state">
<information value="search_sphere" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
</scheme>
<scheme name="start">
<rule name="start_switched_to_on_search_sphere_front">
<premise category="conception" model="controller" type="state">
<information value="start" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_on" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_sphere"/>
</conclusion>
</rule>
<rule name="start_switched_to_on_search_sphere">
<premise category="conception" model="controller" type="state">
<information value="start" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_on" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="search_sphere"/>
</conclusion>
</rule>
<rule name="start_switched_to_off_terminate_front">
<premise category="conception" model="controller" type="state">
<information value="start" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
<rule name="start_switched_to_off_terminate">
<premise category="conception" model="controller" type="state">
<information value="start" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="-1" tolerance="INF"/>
</premise>
<premise category="conception" model="controller" type="event">
<information value="switched_to_off" tolerance="0"/>
<credibility value="1" tolerance="INF"/>
<timespan value="0" tolerance="0"/>
</premise>
<conclusion category="conception" model="controller" type="state">
<information value="terminate"/>
</conclusion>
</rule>
</scheme>
<scheme name="terminate"/>
</scheme>
</body>
<sdk>
    <formalism xmlns="http://www.nomoseed.org/sdk" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="automaton">
      <automaton xmlns="http://www.nomoseed.org/automaton">
        <state name="start">
          <transition target="search_sphere" event="switched_to_on"/>
          <transition target="terminate" event="switched_to_off"/>
        </state>
        <state name="search_sphere">
          <transition target="search_sphere" event="no_found"/>
          <transition target="search_location" event="found"/>
          <transition target="terminate" event="switched_to_off"/>
        </state>
        <state name="search_location">
          <transition target="search_location" event="no_found"/>
          <transition target="terminate" event="found"/>
          <transition target="terminate" event="switched_to_off"/>
        </state>
        <state name="terminate"/>
      </automaton>
    </formalism>
  </sdk>
</program>
