summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/stragegies/reducer/ChoiceReducer.java
blob: 3cb744da245eb4cd5c4cc594b3a130f9ddb86623 (plain)
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
package ch.epfl.maze.physical.stragegies.reducer;

import ch.epfl.maze.physical.World;
import ch.epfl.maze.util.Direction;
import ch.epfl.maze.util.Vector2D;

import java.util.Set;

/**
 * A choice filter that can exclude choices.
 *
 * @author Pacien TRAN-GIRARD
 */
public interface ChoiceReducer {

    /**
     * Reduces the Direction choices by eliminating the improper ones from the given choices.
     *
     * @param choices The choices left to the animal
     * @return A subset of possible direction of the animal, chosen in {@code choices}
     */
    Set<Direction> reduce(Set<Direction> choices);

    /**
     * Reduces the Direction choices by eliminating the improper ones from the given choices.
     * In this variation, the animal knows the world entirely. It can therefore
     * use the position of other animals in the world to move more effectively.
     *
     * @param choices The choices left to the animal
     * @return A subset of possible direction of the animal, chosen in {@code choices}
     */
    Set<Direction> reduce(Set<Direction> choices, World world);

}