Esempio n. 1
0
 public void agent_H2O_seuil_haut()
 {
     while (true)
     {
         linda.lindaRead("detection_H2O_haut");
         var niveau = Convert.ToInt32(linda.lindaRead("niveau_H2O").Arguments.Split(',')[1]);
         var seuil  = Convert.ToInt32(linda.lindaRead("value_Seuil_H2O_Haut").Arguments.Split(',')[1]);
         if (niveau >= seuil)
         {
             linda.lindaOut(new LindaTuple("H2O_haut_detecte"));
             linda.lindaIn("detection_H2O_haut");
         }
     }
 }
Esempio n. 2
0
        public void agentSurveillance_gaz_haut()
        {
            while (true)
            {
                linda.lindaRead("surveillance_gaz_haut");

                var niveau_ch4 = Convert.ToInt32(linda.lindaRead("niveau_CH4").Arguments.Split(',')[1]);
                var niveau_co  = Convert.ToInt32(linda.lindaRead("niveau_CO").Arguments.Split(',')[1]);

                var seuil_ch4 = Convert.ToInt32(linda.lindaRead("value_Seuil_CH4_Haut").Arguments.Split(',')[1]);
                var seuil_co  = Convert.ToInt32(linda.lindaRead("value_Seuil_CO_Haut").Arguments.Split(',')[1]);

                if ((niveau_ch4 >= seuil_ch4) || (niveau_co >= seuil_co))
                {
                    linda.lindaOut(new LindaTuple("activation_ventilateur"));
                    linda.lindaOut(new LindaTuple("detection_gaz_bas"));
                    linda.lindaIn("surveillance_gaz_haut");
                }
            }
        }
Esempio n. 3
0
 public void agent_H2O_seuil_bas()
 {
     while (true)
     {
         linda.lindaRead("detection_H2O_bas");
         var niveau = Convert.ToInt32(linda.lindaRead("niveau_H2O").Arguments.Split(',')[1]);
         var seuil  = Convert.ToInt32(linda.lindaRead("value_Seuil_H2O_Bas").Arguments.Split(',')[1]);
         if (niveau < seuil)
         {
             linda.lindaOut(new LindaTuple("desactivation_pompe"));
             if (linda.lindaReadP("detection_gaz_bas") != null)
             {
                 linda.lindaIn("detection_gaz_bas");
                 linda.lindaOut(new LindaTuple("desactivation_ventilateur"));
             }
             linda.lindaOut(new LindaTuple("detection_H2O_haut"));
             linda.lindaIn("surveillance_gaz_haut");
             linda.lindaIn("detection_H2O_bas");
         }
     }
 }
Esempio n. 4
0
 public void agentCommandePompeVentilo()
 {
     while (true)
     {
         linda.lindaIn("H2O_haut_detecte");
         int seuilCH4  = Convert.ToInt32(this.linda.lindaRead("value_Seuil_CH4_Haut").Arguments.Split(',')[1]);
         int seuilCO   = Convert.ToInt32(this.linda.lindaRead("value_Seuil_CO_Haut").Arguments.Split(',')[1]);
         int niveauCH4 = Convert.ToInt32(linda.lindaRead("niveau_CH4").Arguments.Split(',')[1]);
         int niveauCO  = Convert.ToInt32(linda.lindaRead("niveau_CO").Arguments.Split(',')[1]);
         if ((niveauCH4 < seuilCH4) && (niveauCO < seuilCO))
         {
             linda.lindaOut(new LindaTuple("activation_pompe"));
             linda.lindaOut(new LindaTuple("surveillance_gaz_haut"));
             linda.lindaOut(new LindaTuple("detection_H2O_bas"));
         }
         else
         {
             linda.lindaOut(new LindaTuple("activation_ventilateur"));
             linda.lindaOut(new LindaTuple("detection_gaz_bas"));
             linda.lindaOut(new LindaTuple("H2O_haut_detecte"));
         }
     }
 }