summaryrefslogtreecommitdiff
path: root/src/ch/epfl/maze/physical/zoo/Hamster.java
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2015-11-24 11:11:17 +0100
committerPacien TRAN-GIRARD2015-11-24 11:11:17 +0100
commitbc477506342411e9156b3230d847cb92bcb8e5f9 (patch)
treed952a5d14dccef38bfba3f8e27bfe10ea65d446a /src/ch/epfl/maze/physical/zoo/Hamster.java
parent903553fe9e03e4af75eb7f8547e08b480bc58ec4 (diff)
downloadmaze-solver-bc477506342411e9156b3230d847cb92bcb8e5f9.tar.gz
Reformat code
Diffstat (limited to 'src/ch/epfl/maze/physical/zoo/Hamster.java')
-rw-r--r--src/ch/epfl/maze/physical/zoo/Hamster.java5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/ch/epfl/maze/physical/zoo/Hamster.java b/src/ch/epfl/maze/physical/zoo/Hamster.java
index 3c903f5..7fa0b0d 100644
--- a/src/ch/epfl/maze/physical/zoo/Hamster.java
+++ b/src/ch/epfl/maze/physical/zoo/Hamster.java
@@ -16,7 +16,6 @@ import java.util.stream.Collectors;
16 * 16 *
17 * @author Pacien TRAN-GIRARD 17 * @author Pacien TRAN-GIRARD
18 */ 18 */
19
20public class Hamster extends ProbabilisticAnimal { 19public class Hamster extends ProbabilisticAnimal {
21 20
22 private final List<Vector2D> deadPaths; 21 private final List<Vector2D> deadPaths;
@@ -26,7 +25,6 @@ public class Hamster extends ProbabilisticAnimal {
26 * 25 *
27 * @param position Starting position of the hamster in the labyrinth 26 * @param position Starting position of the hamster in the labyrinth
28 */ 27 */
29
30 public Hamster(Vector2D position) { 28 public Hamster(Vector2D position) {
31 super(position); 29 super(position);
32 this.deadPaths = new ArrayList<>(); 30 this.deadPaths = new ArrayList<>();
@@ -38,7 +36,6 @@ public class Hamster extends ProbabilisticAnimal {
38 * @param choices An array of choices 36 * @param choices An array of choices
39 * @return An array of smart choices 37 * @return An array of smart choices
40 */ 38 */
41
42 private Direction[] excludeDeadPaths(Direction[] choices) { 39 private Direction[] excludeDeadPaths(Direction[] choices) {
43 return (new ArrayList<>(Arrays.asList(choices))) 40 return (new ArrayList<>(Arrays.asList(choices)))
44 .stream() 41 .stream()
@@ -51,7 +48,6 @@ public class Hamster extends ProbabilisticAnimal {
51 * Moves without retracing directly its steps and by avoiding the dead-ends 48 * Moves without retracing directly its steps and by avoiding the dead-ends
52 * it learns during its journey. 49 * it learns during its journey.
53 */ 50 */
54
55 @Override 51 @Override
56 public Direction move(Direction[] choices) { 52 public Direction move(Direction[] choices) {
57 Direction[] smartChoices = this.excludeDeadPaths(choices); 53 Direction[] smartChoices = this.excludeDeadPaths(choices);
@@ -63,4 +59,5 @@ public class Hamster extends ProbabilisticAnimal {
63 public Animal copy() { 59 public Animal copy() {
64 return new Hamster(this.getPosition()); 60 return new Hamster(this.getPosition());
65 } 61 }
62
66} 63}