diff options
author | Pacien TRAN-GIRARD | 2015-11-21 10:36:18 +0100 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2015-11-21 10:36:18 +0100 |
commit | 655ac88f4e73b2df532a451aedf5a561ea1b0d2c (patch) | |
tree | ef6f914a465575f313e2b280bf0639d87a4cbd58 /src/ch/epfl/maze/simulation/Simulation.java | |
parent | 56279eb59ccdea48b18daa027a5095d861b4e2f4 (diff) | |
download | maze-solver-655ac88f4e73b2df532a451aedf5a561ea1b0d2c.tar.gz |
Import project structure
Diffstat (limited to 'src/ch/epfl/maze/simulation/Simulation.java')
-rw-r--r-- | src/ch/epfl/maze/simulation/Simulation.java | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/src/ch/epfl/maze/simulation/Simulation.java b/src/ch/epfl/maze/simulation/Simulation.java new file mode 100644 index 0000000..c3190b3 --- /dev/null +++ b/src/ch/epfl/maze/simulation/Simulation.java | |||
@@ -0,0 +1,84 @@ | |||
1 | package ch.epfl.maze.simulation; | ||
2 | |||
3 | import java.util.List; | ||
4 | import java.util.Map; | ||
5 | |||
6 | import ch.epfl.maze.graphics.Animation; | ||
7 | import ch.epfl.maze.physical.Animal; | ||
8 | import ch.epfl.maze.physical.World; | ||
9 | |||
10 | /** | ||
11 | * The {@code Simulation} interface defines a set of rules that must be | ||
12 | * fulfilled in order to be displayed. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | public interface Simulation { | ||
17 | |||
18 | /** | ||
19 | * Asks the {@code Simulation} to compute the next move and, if specified, | ||
20 | * notifies the changes to the listener. | ||
21 | * | ||
22 | * @param listener | ||
23 | * The listener to which the function will notify the changes | ||
24 | * (can be null) | ||
25 | */ | ||
26 | |||
27 | public void move(Animation listener); | ||
28 | |||
29 | /** | ||
30 | * Determines if the simulation is over. | ||
31 | * | ||
32 | * @return <b>true</b> if no more moves can be made, <b>false</b> otherwise | ||
33 | */ | ||
34 | |||
35 | public boolean isOver(); | ||
36 | |||
37 | /** | ||
38 | * Retrieves the current state of the simulated world. | ||
39 | * | ||
40 | * @return The {@code World} that is being simulated | ||
41 | */ | ||
42 | |||
43 | public World getWorld(); | ||
44 | |||
45 | /** | ||
46 | * Retrieves the step counter of the {@code Simulation}. | ||
47 | * | ||
48 | * @return The current step counter | ||
49 | */ | ||
50 | |||
51 | public int getSteps(); | ||
52 | |||
53 | /** | ||
54 | * Retrieves the mapping of the steps done by the animals that have finished | ||
55 | * the simulation. | ||
56 | * | ||
57 | * @return Map of steps done by animals which have accomplished the | ||
58 | * simulation | ||
59 | */ | ||
60 | |||
61 | public Map<Integer, List<Animal>> getArrivalTimes(); | ||
62 | |||
63 | /** | ||
64 | * Retrieves the record table of the animals that have finished the | ||
65 | * simulation. | ||
66 | * | ||
67 | * @return A {@code String} containing the top 10 animals which have | ||
68 | * accomplished the simulation | ||
69 | */ | ||
70 | |||
71 | public String getRecordTable(); | ||
72 | |||
73 | /** | ||
74 | * Restarts the simulation from the beginning. | ||
75 | */ | ||
76 | |||
77 | public void restart(); | ||
78 | |||
79 | /** | ||
80 | * Stops abruptly the simulation. | ||
81 | */ | ||
82 | |||
83 | public void stop(); | ||
84 | } | ||