示例#1
0
文件: Goal.cs 项目: 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);
 }
示例#2
0
文件: Goal.cs 项目: 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);
        }
示例#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);
 }