- First part:
deals with the construction of directional weighted graphstarting from the creation of the nodes and edges in the graph,
continues with the creation of the graph itself (such as connecting the nodes in the graph and more) and basic algorithms related to the graph (paths in the parent link graph and more). A graph is made up of four interfaces arranged according to the hierarchy from the creation of a node to the execution of an algorithm on the graph.- Second part:
Engaged in creating the Pokemon game from building the game itself graphics, actions performed in the game, placing the agents and building a victory strategy.
is made up of 4 classes
NodeData class:
This implements node_data node in a graph consists of a
info, tag, location and weight.
In this class you can perform operations on a node in a graph such as a
constructor and get and set operations on the node fields.
DWGraph_DS class:
This implementation directed_weighted_graph
A graph is made up of a
Vertices, Neighbors, countMC and edgeSize.
In this class there are several functions that can be done in the graph such as:
constructor, add node, delete node and edge, make a connection between 2 nodes, get a collection of all the node and neighbors and more.
And operations that can be performed in edge: constructor and get and set operations to edge fields that are src, des, weight, info, tag.
Graph_Algo class:
This implementation dw_graph_algorithms
This class represents a number of algorithms that can be made on a graph
Main functions:
isConnected- checks whether the graph is linked.
shortestPathDist- Returns the length of the shortest path.
shortestPath- Returns a list of nodes in the shortest path.
The class methods use 2 main algorithms Dijkstra and BFS
Point3D class:
This implementation geo_location
that represents a geo location <x,y,z>.
In this class the number of functions that can be performed in a location.
Data Structure:
HashMap-It is used because it allows you to get data based on key in O(1).
ArrayList-Because it has the ability to create a list in the desired order.
PriorityQueue-Because it has the ability to adjust the position of the object by definition.
is made up of 8 classes
Agent class:
Class representing an agent in a graph for each agent Multiple fields:.
EPS, Count, _Seed, _Hand, _Pos, _Speed, _Sedge_Course, _Shoot_Course, _gg ,_Fruit_Course, _Sg_DT,.
This class advises a number of actions that can be performed on an agent such as:.
builds, get and set actions for the class fields,
Main functions:
setNectNode- Defines the next node for the agent.
getNextNode- Returns the node to which the agent is intended
And more.
Arena class:
This class represents the data of each stage of the game
Allows you to get and configure data for the game
The class is made up of the fields: EPS1, _gg, _agents, _pokemons, _info, timer, MIN, MAX.
In this class you can perform a number of operations on the game such as: get and set operations for the class variables,
getAgent- Returns the agents that belong to the phase.
json2Pokemons- Gets a string of Pokemon and returns a list containing them.
updateEdge- Updates the locations of Pokemon to edges.
and more.
Ex2 class:
In this class the main is defined through which the game can be run.
GameFrame class:
This class represents a GUI class to present game on a graph.
which contains features of the game window and the creation of
a panel for drawing components on the frame window.
GamePanel class:
The GamePanel class is used for drawing the components on the frame of the game
Contains: drawing information about the game, graph, Pokemon, agents, and refreshing
the components each time.
Class variables: _ ar, _w2f.
LoginGameFrame class:
This class defines the game login window using the following functions:
LoginGameFrame- A method that defines the graphical parts of the login window such as type, button text box and more.
windowCenter - places the login screen in the middle of the screen.
MainGame class:
The department where the game takes place,
Department fields: _win, _ar, scenario_num, id, dt.
The game is run using the following functions:
Main functions:
moveAgents- A function in which the move is made to each agent and a route is assigned to the agent.
strategy2- victory strategy was built in the department: MainGame
Which uses the shortestPath function - which returns a list of nodes of the shortest route (defined in the DWGraph_Algo class).
This is how the shortest route to each Pokemon in the game to which the agent is sent is calculated.
When a situation arises where an agent in a game is stuck at the edge we will make a low break and a high number of moves so that he can eat the Pokmon and advance to the next edge.
Pokemon class:
This class defines pokemon
Class fields: _edge, _value, _type, _pos, min_dist, min_ro, id.
In this class you can do various actions on Pokemon such as: get and set actions for the class variables, builder, and more.
Goal of the game: Collect as many Pokemon as possible.
The more Pokemon you collect with the help of the agents, the higher the score, depending on the specific value of the Pokemon. In order to reach the maximum score, a victory strategy was built in the department: MainGame Which uses the shortestPath function - which returns a list of nodes of the shortest route (defined in the DWGraph_Algo class). This is how the shortest route to each Pokemon in the game to which the agent is sent is calculated. When a situation arises where an agent in a game is stuck at the edge we will make a low break and a high number of moves so that he can eat the Pokmon and advance to the next edge.
For more information on the game visit Wiki
Login Page | Game Page |
---|---|
Authors @Shilo Elimelech @Lior Atiya