-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAgent.h
More file actions
89 lines (66 loc) · 1.85 KB
/
Agent.h
File metadata and controls
89 lines (66 loc) · 1.85 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
https://powcoder.com
代写代考加微信 powcoder
Assignment Project Exam Help
Add WeChat powcoder
// Interface to the Agent ADT
// !!! DO NOT MODIFY THIS FILE !!!
#ifndef AGENT_H
#define AGENT_H
#include "Map.h"
// Constants to represent search strategies used by the agents
#define STATIONARY -1 // Useful for debugging
#define RANDOM 0
#define CHEAPEST_LEAST_VISITED 1
#define DFS 2
typedef struct agent *Agent;
typedef struct move {
int to;
int staminaCost;
} Move;
////////////////////////////////////////////////////////////////////////
/**
* Creates a new agent
*/
Agent AgentNew(int start, int stamina, int strategy, Map m, char *name);
/**
* Frees all memory associated with the agent
*/
void AgentFree(Agent agent);
////////////////////////////////////////////////////////////////////////
// Gets information about the agent
/**
* Gets the name of the agent
*/
char *AgentName(Agent agent);
/**
* Gets the current location of the agent
*/
int AgentLocation(Agent agent);
/**
* Gets the amount of stamina the agent currently has
*/
int AgentStamina(Agent agent);
////////////////////////////////////////////////////////////////////////
// Making moves
/**
* Calculates the agent's next move
*/
Move AgentGetNextMove(Agent agent, Map m);
/**
* Executes a given move
*/
void AgentMakeNextMove(Agent agent, Move move);
////////////////////////////////////////////////////////////////////////
// Learning information
/**
* Tells the agent where the thief is
*/
void AgentGainInfo(Agent agent, int thiefLocation);
////////////////////////////////////////////////////////////////////////
// Displaying state
/**
* Prints information about the agent (for debugging purposes)
*/
void AgentShow(Agent agent);
////////////////////////////////////////////////////////////////////////
#endif