-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntention.java
66 lines (59 loc) · 1.35 KB
/
Intention.java
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
/**
* Class for representing an agent's intentions.
* So far allows for an agent's intention to
* change speed or change direction.
*
* @author Matthew Stone
* @version 1.0
*
*/
public class Intention {
/**
* Class information
*/
/**
* Enumerates the different kinds of things
* that an agent can intend to do.
* "description" allows intentions to be
* pretty-printed.
*/
public static enum ActionType {
TURN ("turn"),
CHANGE_SPEED ("change in speed");
public final String description;
private ActionType(String d) {
description = d;
}
}
/**
* Instance members
*/
/** what kind of thing does this intention describe */
private ActionType type;
/** how much: change in speed or change in angle */
private double param;
/**
* Constructor
*
* @param type what to do
* @param param how much to do
*/
public Intention(ActionType type, double param) {
this.type = type;
this.param = param;
}
/**
* Accessor
* @return type of action inteded
*/
public ActionType getType() {
return type;
}
/**
* Accessor
* @return action argument: change in speed or change in angle
*/
public double getParam() {
return param;
}
}