Esempio n. 1
0
 /// <summary>
 /// Creates an instance of the Engine class
 /// </summary>
 /// <param name="a_ihm">Reference to the application object instance that must implement the IUserInterface</param>
 public Engine(IUserInterface a_ihm)
 {
     rulesBase        = new RulesBase();
     initialFactsBase = null;
     factsBase        = new FactsBase();
     ihm = a_ihm;
 }
Esempio n. 2
0
 // METHODES
 /// <summary>
 /// Sets new already known facts in the facts base for a new identification problem, these known facts replace former already known facts (if exist)
 /// </summary>
 /// <param name="a_factsBase">FactsBase object including already known facts</param>
 public void SetFactsBase(FactsBase a_factsBase)
 {
     if (a_factsBase != null && a_factsBase.Facts.Count != 0)
     {
         initialFactsBase       = new FactsBase();
         initialFactsBase.Facts = new List <IFact>(a_factsBase.Facts);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Sets new already known facts in the facts base for a new identification problem, these known facts replace former already known facts (if exist)
 /// </summary>
 /// <param name="a_factsBase">IFact object collection of already known facts</param>
 public void SetFactsBase(List <IFact> a_facts)
 {
     if (a_facts != null && a_facts.Count != 0)
     {
         initialFactsBase = new FactsBase();
         foreach (var fact in a_facts)
         {
             initialFactsBase.Facts.Add(fact);
         }
     }
 }
Esempio n. 4
0
 /// <summary>
 /// Creates an instance of the Engine class
 /// </summary>
 /// <param name="a_ihm">Reference to the application object instance that must implement the IUserInterface</param>
 /// <param name="a_rulesBase">RulesBase instance for the given identification problem</param>
 public Engine(IUserInterface a_ihm, RulesBase a_rulesBase)
 {
     if (a_rulesBase != null)
     {
         rulesBase = a_rulesBase;
     }
     else
     {
         rulesBase = new RulesBase();
     }
     initialFactsBase = null;
     factsBase        = new FactsBase();
     ihm = a_ihm;
 }
Esempio n. 5
0
        /// <summary>
        /// Creates an instance of the Engine class
        /// </summary>
        /// <param name="a_ihm">Reference to the application object instance that must implement the IUserInterface</param>
        /// <param name="a_rulesBase">RulesBase instance for the given identification problem</param>
        /// <param name="a_factsBase">FactsBase instance including already known facts for the given identification problem</param>
        public Engine(IUserInterface a_ihm, RulesBase a_rulesBase, FactsBase a_factsBase)
        {
            if (a_rulesBase != null)
            {
                rulesBase = a_rulesBase;
            }
            else
            {
                rulesBase = new RulesBase();
            }
            if (a_factsBase != null && a_factsBase.Facts.Count != 0)
            {
                initialFactsBase = a_factsBase;
                factsBase        = new FactsBase();
                factsBase.Facts  = new List <IFact>(initialFactsBase.Facts);
            }
            else
            {
                initialFactsBase = null;
                factsBase        = new FactsBase();
            }

            ihm = a_ihm;
        }