/// <summary> /// Constructor for creating an operand Node as at a specific value /// </summary> /// <param name="operandType"></param> public Operand(OperandEnum operandType) { OperandType = operandType; _divideByZeroFlag = false; }
/// <summary> /// Tries to mutate and returns false if it mutates to the same thing /// </summary> /// <returns></returns> public override bool Mutate() { var oldOpType = OperandType; if (_rGen.NextDouble() < (Settings.VariableProb / 2)) OperandType = OperandEnum.x; else OperandType = (OperandEnum)_rGen.Next(0, (int)OperandEnum.x+1); return oldOpType != OperandType; }