Our Strategy - achiyazigi/directional-weighted-graph-DS GitHub Wiki

Our idea leans on a couple of main principles :

  1. The agent's starting node is being determined by the most valuable pokemon. which means, each agent is placed on the source node of the chosen pokemon's edge.
  2. The pokemon's edge is calculated from its position by the "triangle inequality" concept. which means, if the distance from u to v is close enough to the distance from u to pokemon p + distance from p to v than p lies on edge: (u,v).
  3. By using Dijkstra's algorithm implemented by us, each agent calculates the shortest path to the closest available pokemon and marks it as a "handled" pokemon, so other agents won't choose the same target.
  4. iterating over agents who reached their local destination node (the first in their shrinking path), a new destination is set by popping the first node from the path.
  5. The moment an agent collects its target, step 3 will be repeated.
  6. We added a nice feature which marks pokemons popped in the way of an agent after step 3.

the project structure:

  • Engine: gets the user input, creates the threads (code and graphics) and start them.
  • Myclient: the actual code described above, runnable and executed with "code" thread, starts another thread "mover" to make moves.
  • Frame: creates the graphics using Jframe (repaint by graphics thread) - 144 fps.