Esempio n. 1
0
        private static BaseTraveler[] NaturalPlayers()
        {
            Human human = new Human(_humanStartLocation);

            human.Goal         = _humanGoal;
            human.costs.Pickup = _humanPickup;
            human.costs.Fire   = _humanStartFire;

            NeutralAgent agent = new NeutralAgent(_gameStartLocation, _gameGoal, human, 2, _horizon);

            agent.costs.Fire   = _GameStartFire;
            agent.costs.Pickup = _gamePickup;
            return(new BaseTraveler[] { human, agent });
        }
Esempio n. 2
0
        public void NaturalGame()
        {
            TravelWorld world = new TravelWorld();

            world.AddPlaces(2, 3, 4);
            world.AddWay(3, 2, 2);
            world.AddWay(3, 4, 2);
            world.AddWay(2, 4, 10);
            world.SetFire(2, 4);


            Human human = new Human(2);

            human.costs.Fire   = 1;
            human.costs.Pickup = 5;
            human.Goal         = 4;

            BasicCuttof cuttOf = new BasicCuttof();

            agent              = new NeutralAgent(2, 4, human, 3, 10);
            agent.costs.Fire   = 10;
            agent.costs.Pickup = 5;

            world.AddPlayer(human);
            world.AddPlayer(agent);

            //eval.SetParams(agent, human, 10);
            cuttOf.SetParams(agent, 3);

            agent.GetNextAction(world)(world);
            Assert.AreEqual(3, agent.CurrentLocation);
            Assert.IsTrue(world.isClear(2, 3));

            agent.GetNextAction(world)(world);
            Assert.AreEqual(4, agent.CurrentLocation);
            Assert.IsTrue(world.isClear(4, 3));
        }