The Algorithm - TorNim0s/Pokemon-Game GitHub Wiki

The Algorithm

The algorithm goes a follows:

  • We send each agent to a "mission".
  • Each "mission" checks if there any pokemons that don't have any agent assigned to them.
  • Based on the pokemons that are not chosen already by another agent, we choose the best pokemon we can catch.
    • How we choose who's the best pokemon to catch, for each pokemon:
    • We calculate the shortest path to the pokemon using the TSP algorithm from the last task.
    • Calculating the time it takes the agent to reach the pokemon by diving the distance with his speed.
    • Then we divide the the time with the value of the pokemon.
    • And lastly we choose the the pokemon with the lowest "weight" and send the agent towards that pokemon.