-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstrategy.h
More file actions
49 lines (43 loc) · 1.14 KB
/
Copy pathstrategy.h
File metadata and controls
49 lines (43 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Project name: Food collection
* Version 4
* Student : Albert Eduard Merino Pulido
*/
#ifndef strategy_h
#define strategy_h
#include "map.h"
#include <climits>
#include <queue>
#include <map>
using namespace std;
typedef struct Node {
Cell * state;
struct Node * parent;
Direction action;
Node();
Node(Cell *, Node *, Direction);
vector<Direction> path();
} Node;
class Strategy {
public:
// Constructors
Strategy();
Strategy(Map *, CellType agent);
Map * getGameState();
void setGameState(Map * gameState);
virtual Direction getAction();
virtual Map observationFunction(Map state);
virtual void registerInitialState();
virtual void final(Map state);
Direction randomChoice(vector<Direction> );
vector<Direction> getLegalActions(Cell *);
int getDistance(Map, Cell *, Cell *);
vector<Direction> blindSearchGraph(Map, Cell *);
vector<Direction> closestDistance(Map gameState, Cell * initial, Cell * goal);
int closestFoodDistance(Map state, Cell * position);
protected:
Map * gameState;
CellType agent1;
CellType agent2;
};
#endif // ifndef strategy_h