Skip to content

The Algorithm

Ofek Rotem edited this page Jan 8, 2022 · 2 revisions

The Algorithm

The first challenge was deciding where to place the agents at the beggining of each game.
These are the steps made to decide agent aloccation:

  1. The first agent is placed on the center node. That way he is in the best strategic spot on the map.
  2. If the current level allows more than one agent, we look for the pokemon thats the farthest from all agents currently on the map and place the additional agent on the src node of the edge that pokemon is on.
  3. Redo step 2 for as many agents the level allows.

Now after we placed the agents the game beggins and as long as its running we do these steps continuously until the game is ended:

  1. We only want to send commands to agents that are currently not in movement, so first we check if the agent is not currently in movement.
  2. For each of those agents we look for the clossest pokemon and send the agent to the src node of the edge that pokemon is on. If the distance to that src node is 0, meaning the agent is currently on that node, we send the agent to the dest node of that edge so he can catch that pokemon.

Back to home page

Clone this wiki locally