diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/stragegies/picker/ChoicePicker.java')
-rw-r--r-- | src/ch/epfl/maze/physical/stragegies/picker/ChoicePicker.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/stragegies/picker/ChoicePicker.java b/src/ch/epfl/maze/physical/stragegies/picker/ChoicePicker.java new file mode 100644 index 0000000..76fe3eb --- /dev/null +++ b/src/ch/epfl/maze/physical/stragegies/picker/ChoicePicker.java | |||
@@ -0,0 +1,44 @@ | |||
1 | package ch.epfl.maze.physical.stragegies.picker; | ||
2 | |||
3 | import ch.epfl.maze.physical.World; | ||
4 | import ch.epfl.maze.util.Direction; | ||
5 | import ch.epfl.maze.util.Vector2D; | ||
6 | |||
7 | import java.util.Set; | ||
8 | |||
9 | /** | ||
10 | * A decision maker that can pick a Direction given multiple choices. | ||
11 | * | ||
12 | * @author Pacien TRAN-GIRARD | ||
13 | */ | ||
14 | public interface ChoicePicker { | ||
15 | |||
16 | Direction FALLBACK_DIRECTION = Direction.NONE; | ||
17 | |||
18 | /** | ||
19 | * Retrieves the next direction of the animal, by selecting one choice among | ||
20 | * the ones available from its position. | ||
21 | * | ||
22 | * @param choices The choices left to the animal at its current position (see | ||
23 | * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) | ||
24 | * World.getChoices(Vector2D)}) | ||
25 | * @return The next direction of the animal, chosen in {@code choices} | ||
26 | */ | ||
27 | Direction pick(Set<Direction> choices); | ||
28 | |||
29 | /** | ||
30 | * Retrieves the next direction of the animal, by selecting one choice among | ||
31 | * the ones available from its position. | ||
32 | * <p> | ||
33 | * In this variation, the animal knows the world entirely. It can therefore | ||
34 | * use the position of other animals in the daedalus to move more effectively. | ||
35 | * | ||
36 | * @param choices The choices left to the animal at its current position (see | ||
37 | * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) | ||
38 | * World.getChoices(Vector2D)}) | ||
39 | * @param world The world in which the animal moves | ||
40 | * @return The next direction of the animal, chosen in {@code choices} | ||
41 | */ | ||
42 | Direction pick(Set<Direction> choices, World world); | ||
43 | |||
44 | } | ||