Esempio n. 1
0
File: Goal.cs Progetto: luftj/GOST
 /// <summary>
 /// Checks wether the given WorldModel complies with this goals conditions.
 /// </summary>
 /// <returns>"true" if goal is fulfilled.</returns>
 public bool isFulfilled(WorldModel model)
 {
     foreach (KeyValuePair <string, bool> item in conditions)
     {
         if (item.Value != model.getCondition(item.Key))
         {
             return(false);
         }
     }
     return(true);
 }
Esempio n. 2
0
File: Goal.cs Progetto: luftj/GOST
        public int getNumUnmetConditions(WorldModel model)
        {
            int numUnmetConditions = 0;

            foreach (KeyValuePair <string, bool> item in conditions)
            {
                if (model.getCondition(item.Key) != item.Value)
                {
                    ++numUnmetConditions;
                }
            }
            return(numUnmetConditions);
        }
Esempio n. 3
0
 public bool isPossible(WorldModel model)
 {
     foreach (KeyValuePair <string, bool> item in preconditions)
     {
         bool?modelIs = model.getCondition(item.Key);
         if (modelIs == null)
         {
             continue;
         }
         if (item.Value != modelIs)
         {
             return(false);
         }
     }
     return(true);
 }