예제 #1
0
        public void setFireOnce()
        {
            Pyromaniac agent = new Pyromaniac(1, 1);

            //set fire to (1,2)
            (agent.GetNextAction(world)).Invoke(world);
            Assert.IsFalse(world.isClear(1, 2));
            Assert.AreEqual(agent.CurrentLocation, 2);
            Assert.AreEqual(agent.TotalCost, 0);
        }
예제 #2
0
        public void stuck2()
        {
            world.SetFire(1, 2);
            Pyromaniac agent = new Pyromaniac(2, 1);

            for (int i = 0; i < 20; i++)
            {
                double lastCost = agent.TotalCost;
                (agent.GetNextAction(world)).Invoke(world);
                Assert.AreEqual(agent.CurrentLocation, 1);
            }
            Assert.AreEqual(agent.TotalCost, Costs.Instance.Epsilon * 10);
        }