-
Notifications
You must be signed in to change notification settings - Fork 0
Classes and UML Diagram
idobar1403 edited this page Jan 8, 2022
·
4 revisions
The Arena class holds:
- pokemons_lst - The list that contains the pokemons.
- agents_lst - The list of agents.
- graph_algo - The graph algo class.
- info_dict - The dict that has the info of the game.
- dijkstra_list - Dictionary that every key is the node id and the value is list with the shortest weight of the path between this node to every other node.
- client - the client of the game.
The Arena class functions:
- init - Initialize the arena class from the info we got from the client.
- update_pokemons_lst - Update the arena.pokemon_lst with the given json from the client.
- update_agent_lst - Update the agents values from the client.get_agents
- place_agents_at_beginning - Create the agents and place them at the nodes that has the most pokemons near them.
- update_game_info - Update the game info from the client.
The Play_game holds:
- moves - counts the moves the client made.
- grade - sums the grade of the game.
The Play_game class functions:
- AllocateAgent - allocate agent to given pokemon.
- get_all_permutations - give list and return all the permutations of the list.
- calculate_time_of_path - using the dijkstra dictionary to calculate the weight of the path.
- dist_between_points - given two points it return the dist between the two points.
- thread_function - the thread that sleeps and activate the move method from the client. It is responsible for the movement of the nodes, and eating the pokemons.
- run_game - runs the game.

| Our Unified Modeling Language representation |
Note: We have subtracted all the DiGraph and GraphAlgo classes for which the implementation is identical to Ex3. You may find that full UML Here