package ch.epfl.maze.physical.stragegies.picker; import ch.epfl.maze.physical.Daedalus; import ch.epfl.maze.physical.World; import ch.epfl.maze.util.Direction; import ch.epfl.maze.util.Vector2D; import java.util.Set; /** * A decision maker that can pick a Direction given multiple choices. * * @author Pacien TRAN-GIRARD */ public interface ChoicePicker { Direction FALLBACK_DIRECTION = Direction.NONE; /** * Retrieves the next direction of the animal, by selecting one choice among * the ones available from its position. * * @param choices The choices left to the animal at its current position (see * {@link ch.epfl.maze.physical.World#getChoices(Vector2D) * World.getChoices(Vector2D)}) * @return The next direction of the animal, chosen in {@code choices} */ Direction pick(Set choices); /** * Retrieves the next direction of the animal, by selecting one choice among * the ones available from its position. *

* In this variation, the animal knows the world entirely. It can therefore * use the position of other animals in the daedalus to move more effectively. * * @param choices The choices left to the animal at its current position (see * {@link World#getChoices(Vector2D) * World.getChoices(Vector2D)}) * @param daedalus The daedalus in which the animal moves * @return The next direction of the animal, chosen in {@code choices} */ Direction pick(Set choices, Daedalus daedalus); }