예제 #1
0
 // Makes Quality Decision for an implicit Action.
 public override float Evaluate(RuleController controller, Rule rule, Decision decision)
 {
     // Do decision logic here.
     if (decision.inputID.Length == 2)
     {
         float a = rule.GetDecisionByIdentifier(decision.inputID[0]).Make(controller, rule);
         float b = rule.GetDecisionByIdentifier(decision.inputID[1]).Make(controller, rule);
         return((a < b) ? 1 : 0);
     }
     return(0);
 }
예제 #2
0
 // Makes Quality Decision for an implicit Action.
 public override float Evaluate(RuleController controller, Rule rule, Decision decision)
 {
     // Do decision logic here.
     if (decision.inputID.Length > 1)
     {
         float value = rule.GetDecisionByIdentifier(decision.inputID[0]).Make(controller, rule);
         for (int i = 1; i < decision.inputID.Length; i++)
         {
             if (rule.GetDecisionByIdentifier(decision.inputID[i]).Make(controller, rule) != value)
             {
                 return(0);
             }
         }
         return(1);
     }
     return(0);
 }
예제 #3
0
        public override float Evaluate(RuleController controller, Rule rule, Decision decision)
        {
            float total = 0f;

            foreach (int input in decision.inputID)
            {
                if (total == 0)
                {
                    total = rule.GetDecisionByIdentifier(input).Make(controller, rule);
                }
                else
                {
                    total -= rule.GetDecisionByIdentifier(input).Make(controller, rule);
                }
            }
            return(total);
        }
예제 #4
0
        // Makes Quality Decision for an implicit Action.
        public override float Evaluate(RuleController controller, Rule rule, Decision decision)
        {
            if (decision.inputID.Length > 1)
            {
                float total = rule.GetDecisionByIdentifier(decision.inputID[0]).Make(controller, rule);

                for (int i = 1; i < decision.inputID.Length; i++)
                {
                    total /= rule.GetDecisionByIdentifier(decision.inputID[i]).Make(controller, rule);
                }
                return(total);
            }
            else if (decision.inputID.Length == 1)
            {
                return(rule.GetDecisionByIdentifier(decision.inputID[0]).Make(controller, rule));
            }
            return(0f);
        }
예제 #5
0
 public override float Evaluate(RuleController controller, Rule rule, Decision decision)
 {
     foreach (int input in decision.inputID)
     {
         if (rule.GetDecisionByIdentifier(input).Make(controller, rule) == 1)
         {
             return(1f);
         }
     }
     return(0f);
 }