Skip to content

Catch all Pokemon in given graph. Assignment number 2 in OOP class

Notifications You must be signed in to change notification settings

AmitSheer/Pokemon_game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pokemon_game

Catch all Pokemon in given graph. Assignment number 2 in OOP class. Helping Professor Boaz catch all of the pokemon on the graph

Usage

There are 2 options in order to run the program. One option is to run the program normaly and then input the ID and Scenario. The second option is to run the program through the cmd and input the ID and Scenario in the number after the JAR name, that way the jar opened window will close when the scenario time runs out.

Open application to run multiple scenarios

  1. Go to folder E:\Git\Pokemon_game\out\artifacts\Ex2_jar\
  2. Run java -jar Ex2.jar
  3. In the window you have the option to input the: * ID to run with * Scenario to use
  4. Then press the start button
    panel
  5. View the game run on the left side of the divider
    gamePanel
  6. The score for the scenario will be shown top left corner where the timer was
    Score

Open from application to run one scenario

  1. Go to folder E:\Git\Pokemon_game\out\artifacts\Ex2_jar\
  2. Run java -jar Ex2.jar {USER_ID} {SCENARIO_NUMBER}
  3. View the game run on the left side of the divider
    gamePanel
  4. The scenario will finish running and will save the result in the server.

Structure

This platforme is based on a directed connected graph, the algorithm's used to check the graph for three things:

  1. SCC, strongly connected components
  2. Shortest Path Distance, the shortest path from node to node
  3. Shortest Path, the path to take to get from one node to the other

Algorithms

Two algorithms are used in the program.

  1. Tarjan - check SCC
  2. Dijkstra - find the shortest path by distance

Dijkstra

This algorithm check the graph for shortest path from one node to the other, by putting them into a priority queue ordered according to distance, or 'weight', of the path to the node. Then moving on the graph according to the order of the queue.

Tarjan

This algorithm uses Depth-First Search , but with a quirk. When a algorithm visits a node it adds it to a stack, when it visits the starting node it unloads the stack and counts it as an SCC, and adds all of the unloaded nodes into a list of lists of SCC nodes.

For the inner workings visit the wiki.

About

Catch all Pokemon in given graph. Assignment number 2 in OOP class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages