public void basicGame2() { TravelWorld world = new TravelWorld(); world.AddPlaces(2, 3, 4); world.AddWay(3, 2, 1); world.AddWay(3, 4, 1); world.AddWay(2, 4, 10); Human human = new Human(2); human.costs.Pickup = 2; human.costs.Fire = 6; agent = new CompetetiveAgent(2, 4, human, 3, 10); agent.costs.Pickup = 2; agent.costs.Fire = 6; world.AddPlayer(human); world.AddPlayer(agent); agent.GetNextAction(world)(world); Assert.AreEqual(3, agent.CurrentLocation); agent.GetNextAction(world)(world); Assert.AreEqual(4, agent.CurrentLocation); }
public void SetParams(BaseTraveler player1, BaseTraveler player2, int depth) { // _goal = goal; _depth = depth; _player1 = player1; _player2 = player2; }
public Simulator(TravelWorld world, params BaseTraveler[] agents) { _world = world; _agents = agents; _human = agents[0]; _gameAgent = agents[1]; }
public void SetParams(BaseTraveler player, BaseTraveler rival, int totalMoves) { _player = player; //_goal = goal; _totalMoves = totalMoves; _rival = rival; //_rivalGoal = rivalGoal; }
public void GoToDest(BaseTraveler agent) { TravelWorld world = new TravelWorld(); world.AddPlaces(1, 2, 3, 4); world.AddWay(1, 2, 1); world.AddWay(3, 2, 1); world.AddWay(3, 4, 1); Assert.IsTrue((agent.GetNextAction(world)).Invoke(world)); Assert.AreEqual(agent.CurrentLocation, 3); Assert.IsTrue((agent.GetNextAction(world)).Invoke(world)); Assert.AreEqual(agent.CurrentLocation, 4); }
public void noOperation(BaseTraveler agent) { TravelWorld world = new TravelWorld(); world.AddPlaces(1, 2, 3, 4); world.AddWay(1, 2, 1); world.AddWay(3, 2, 1); world.AddWay(3, 4, 1); world.SetFire(1, 2); double prevCost = agent.TotalCost; (agent.GetNextAction(world)).Invoke(world); Assert.AreEqual(agent.TotalCost - prevCost, Costs.Instance.Epsilon); Assert.AreEqual(agent.CurrentLocation, 2); }
public void GoToDestOnce(BaseTraveler agent) { TravelWorld world = new TravelWorld(); world.AddPlaces(1, 2, 3, 4); world.AddWay(1, 2, 1); world.AddWay(3, 2, 1); world.AddWay(3, 4, 1); world.AddWay(2, 4, 20); double prevCost = agent.TotalCost; Assert.IsTrue((agent.GetNextAction(world)).Invoke(world)); Assert.AreEqual(agent.TotalCost - prevCost, 20); Assert.AreEqual(agent.CurrentLocation, 4); }
internal void SetLocation(BaseTraveler player, int location) { _locations[player] = location; }
public void AddPlayer(BaseTraveler player) { _locations.Add(player, player.CurrentLocation); }
public NaturalEval(int goal, BaseTraveler player, int MaxMoves) { _goal = goal; _player = player; _MaxMoves = MaxMoves; }
public void SetParams(BaseTraveler player, int depth) { // _goal = goal; _depth = depth; _player = player; }