public void LHDoubleRHOperation()
        {
            Operation rh = new AddOperation(7, 11);
            Operation op = new AddOperation(13, rh);

            Assert.AreEqual(31, op.Evaluate());
        }
        public void LHOPerationRHDouble()
        {
            Operation lh = new AddOperation(7, 11);
            Operation op = new AddOperation(lh, 13);

            Assert.AreEqual(31, op.Evaluate());
        }
        public void TwoOperations()
        {
            Operation lh = new AddOperation(7, 11);
            Operation rh = new AddOperation(13, 19);
            Operation op = new AddOperation(lh, rh);

            Assert.AreEqual(50, op.Evaluate());
        }
Example #4
0
            protected override bool _Evaluate(out double deltaTime, out double deltaPenalty)
            {
                // Pick random order:
                int ind = StaticRandom.Next(0, State.UnScheduledOrders.Count);

                // Evaluate the addition:
                addOp = new AddOperation(State, ind);
                bool possible = addOp.Evaluate();

                deltaTime    = addOp.DeltaTime;
                deltaPenalty = addOp.DeltaPenalty;
                return(possible);
            }
        public void TwoDoubles()
        {
            Operation op = new AddOperation(7, 11);

            Assert.AreEqual(18, op.Evaluate());
        }