Ejemplo n.º 1
0
 public TwoTermExpression(IBooleanResolvable _a, IBooleanResolvable _b, Random rng, int _operator = -1)
 {
     termA = _a;
     termB = _b;
     termA.increaseOperatorPriority();
     termB.increaseOperatorPriority();
     if (_operator < 0)
     {
         boolOperator = rng.Next(0, 15); // random number min 0 max 15
         // consider reorganizing the operators to cut down on fill time
         while (boolOperator == (int)Operators.T ||
                boolOperator == (int)Operators.F ||
                boolOperator == (int)Operators.P ||
                boolOperator == (int)Operators.Q ||
                boolOperator == (int)Operators.T ||
                boolOperator == (int)Operators.NotP ||
                boolOperator == (int)Operators.NotQ)
         {
             boolOperator = rng.Next(0, 15); // I think those operators are logically worthless here
         }
     }
     else
     {
         boolOperator = _operator;
     }
 }
Ejemplo n.º 2
0
 public override void increaseOperatorPriority()
 {
     boolOperator += 16;
     termA.increaseOperatorPriority();
     termB.increaseOperatorPriority();
 }