diff options
Diffstat (limited to 'src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java')
-rw-r--r-- | src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java b/src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java new file mode 100644 index 0000000..3cb744d --- /dev/null +++ b/src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java | |||
@@ -0,0 +1,34 @@ | |||
1 | package ch.epfl.maze.physical.stragegies.reducer; | ||
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 choice filter that can exclude choices. | ||
11 | * | ||
12 | * @author Pacien TRAN-GIRARD | ||
13 | */ | ||
14 | public interface ChoiceReducer { | ||
15 | |||
16 | /** | ||
17 | * Reduces the Direction choices by eliminating the improper ones from the given choices. | ||
18 | * | ||
19 | * @param choices The choices left to the animal | ||
20 | * @return A subset of possible direction of the animal, chosen in {@code choices} | ||
21 | */ | ||
22 | Set<Direction> reduce(Set<Direction> choices); | ||
23 | |||
24 | /** | ||
25 | * Reduces the Direction choices by eliminating the improper ones from the given choices. | ||
26 | * In this variation, the animal knows the world entirely. It can therefore | ||
27 | * use the position of other animals in the world to move more effectively. | ||
28 | * | ||
29 | * @param choices The choices left to the animal | ||
30 | * @return A subset of possible direction of the animal, chosen in {@code choices} | ||
31 | */ | ||
32 | Set<Direction> reduce(Set<Direction> choices, World world); | ||
33 | |||
34 | } | ||