Browse Source

Merge branch 'master' into dev/explo

Bastien Sevajol 8 years ago
parent
commit
395904fb5e

+ 10 - 1
config.py View File

@@ -4,7 +4,8 @@ import argparse
4 4
 
5 5
 parser = argparse.ArgumentParser(description='Select sandbox.')
6 6
 parser.add_argument('sandbox', metavar='sandbox', type=str, nargs=1,
7
-                    help='Name of sandbox: ' + ', '.join(['exploration', 'all', 'test']))
7
+                    help='Name of sandbox: ' + ', '.join(['exploration', 'all', 'test', 'load']))
8
+parser.add_argument('path', metavar='sandbox', type=str, nargs=1)
8 9
 
9 10
 args = parser.parse_args()
10 11
 
@@ -14,6 +15,14 @@ elif 'exploration' in args.sandbox:
14 15
     from intelligine.sandbox.exploration.exploration import simulations, visualisation as pygame_visualisation
15 16
 elif 'test' in args.sandbox:
16 17
     from intelligine.sandbox.test.test import simulations, visualisation as pygame_visualisation
18
+elif 'load' in args.sandbox:
19
+    from os import getcwd
20
+    from intelligine.display.pygame.config import map_config
21
+    from intelligine.display.pygame.visualisation import get_standard_extract_from_map
22
+
23
+    simulations, pygame_visualisation = get_standard_extract_from_map(getcwd()+args.path[0],
24
+                                                                      map_config)
25
+
17 26
 else:
18 27
     parser.parse_args(['-h'])
19 28
 

+ 1 - 1
intelligine/tests/simulation/bypass/TestByPass.py View File

@@ -6,7 +6,7 @@ from intelligine.tests.src.simulation.SimpleTestWorld1Simulation import SimpleTe
6 6
 class TestByPass(SimpleTestWorld1Simulation):
7 7
 
8 8
     _ant_move_history = []
9
-    _assert_ant_move_history = [(0, 21, 20), (0, 21, 19), (0, 21, 18), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 14), (0, 22, 13), (0, 23, 12), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 23, 11), (0, 22, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 22, 12), (0, 23, 13), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 23, 15), (0, 22, 16), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 13), (0, 21, 12), (0, 21, 11), (0, 21, 10), (0, 21, 9), (0, 21, 8), (0, 21, 7), (0, 21, 6), (0, 21, 5), (0, 21, 4), (0, 21, 3), (0, 22, 2), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 22, 1), (0, 21, 1), (0, 20, 1), (0, 19, 1), (0, 18, 1), (0, 17, 1), (0, 16, 1), (0, 15, 1), (0, 14, 1), (0, 13, 1), (0, 12, 1), (0, 11, 1), (0, 10, 1), (0, 9, 1), (0, 8, 2), (0, 7, 2), (0, 6, 3), (0, 5, 4), (0, 4, 5), (0, 3, 5), (0, 4, 6), (0, 5, 7), (0, 6, 8), (0, 7, 9), (0, 8, 10), (0, 9, 11), (0, 10, 12), (0, 11, 13), (0, 11, 14), (0, 12, 15), (0, 13, 16), (0, 14, 17), (0, 15, 17), (0, 16, 17), (0, 17, 17), (0, 18, 17), (0, 19, 17), (0, 19, 16), (0, 19, 15), (0, 19, 14), (0, 19, 13), (0, 19, 12), (0, 19, 11), (0, 19, 10), (0, 19, 9), (0, 18, 9), (0, 17, 9), (0, 16, 9), (0, 15, 9), (0, 14, 9), (0, 13, 9), (0, 13, 10), (0, 13, 11), (0, 13, 12), (0, 13, 13), (0, 14, 13), (0, 15, 13), (0, 16, 13), (0, 17, 13), (0, 17, 14), (0, 16, 15), (0, 15, 15), (0, 14, 15), (0, 13, 15), (0, 14, 15), (0, 15, 15), (0, 16, 15), (0, 17, 15), (0, 17, 14), (0, 16, 13), (0, 15, 13), (0, 14, 13), (0, 13, 13), (0, 13, 12), (0, 13, 11), (0, 13, 10), (0, 13, 9), (0, 14, 9), (0, 15, 9), (0, 16, 9), (0, 17, 9), (0, 18, 9), (0, 19, 9), (0, 19, 10), (0, 19, 11), (0, 19, 12), (0, 19, 13), (0, 19, 14), (0, 19, 15), (0, 19, 16), (0, 19, 17), (0, 18, 17), (0, 17, 17), (0, 16, 17), (0, 15, 17), (0, 14, 17), (0, 13, 17), (0, 12, 17), (0, 11, 17), (0, 10, 17), (0, 9, 17), (0, 8, 17), (0, 7, 17), (0, 6, 17), (0, 5, 17), (0, 4, 17), (0, 3, 17), (0, 2, 17), (0, 1, 17), (0, 1, 16), (0, 1, 15), (0, 1, 14), (0, 1, 13), (0, 1, 12), (0, 1, 11), (0, 1, 10), (0, 1, 9), (0, 1, 8), (0, 1, 7), (0, 1, 6), (0, 1, 5), (0, 1, 4), (0, 1, 3), (0, 1, 2), (0, 1, 1), (0, 2, 1), (0, 3, 1), (0, 4, 1), (0, 5, 1), (0, 6, 1), (0, 7, 1), (0, 8, 1), (0, 9, 1), (0, 10, 1), (0, 11, 1), (0, 12, 1), (0, 13, 1), (0, 14, 1), (0, 15, 1), (0, 16, 1), (0, 17, 1), (0, 18, 1), (0, 19, 1), (0, 20, 1), (0, 21, 1), (0, 22, 1), (0, 23, 1), (0, 24, 1), (0, 24, 2), (0, 24, 3), (0, 24, 4), (0, 24, 5), (0, 24, 6), (0, 24, 7), (0, 24, 8), (0, 24, 9), (0, 24, 10), (0, 24, 11), (0, 24, 12), (0, 24, 13), (0, 24, 14), (0, 24, 15), (0, 24, 16), (0, 24, 17), (0, 23, 17), (0, 22, 17), (0, 21, 17), (0, 21, 18), (0, 21, 19), (0, 21, 20), (0, 21, 21), (0, 20, 22), (0, 19, 22), (0, 18, 23), (0, 18, 24), (0, 18, 23), (0, 19, 22), (0, 20, 22), (0, 21, 21), (0, 21, 20), (0, 21, 19), (0, 21, 18), (0, 22, 17), (0, 23, 17), (0, 24, 16), (0, 24, 15), (0, 24, 14), (0, 24, 13), (0, 24, 12), (0, 24, 11), (0, 24, 10), (0, 24, 9), (0, 24, 8), (0, 24, 7), (0, 24, 6), (0, 24, 5), (0, 24, 4), (0, 24, 3), (0, 24, 2), (0, 23, 1), (0, 22, 1), (0, 21, 1), (0, 20, 1), (0, 19, 1), (0, 18, 1), (0, 17, 1), (0, 16, 1), (0, 15, 1), (0, 14, 1), (0, 13, 1), (0, 12, 1), (0, 11, 1), (0, 10, 1), (0, 9, 1), (0, 8, 1), (0, 7, 1), (0, 6, 1), (0, 7, 2), (0, 8, 3), (0, 9, 4), (0, 10, 5), (0, 11, 6), (0, 12, 7), (0, 13, 7), (0, 14, 7), (0, 15, 7), (0, 16, 7), (0, 17, 7), (0, 18, 7), (0, 19, 7), (0, 20, 7), (0, 21, 7), (0, 21, 8), (0, 21, 9), (0, 21, 10), (0, 21, 11), (0, 21, 12), (0, 21, 13), (0, 21, 14), (0, 21, 15), (0, 21, 16), (0, 21, 17), (0, 21, 18), (0, 21, 19), (0, 21, 20)]
9
+    _assert_ant_move_history = [(0, 21, 20), (0, 21, 19), (0, 21, 18), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 14), (0, 22, 13), (0, 23, 12), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 24, 11), (0, 23, 11), (0, 22, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 21, 11), (0, 22, 12), (0, 23, 13), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 24, 14), (0, 23, 15), (0, 22, 16), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 13), (0, 21, 12), (0, 21, 11), (0, 21, 10), (0, 21, 9), (0, 21, 8), (0, 21, 7), (0, 21, 6), (0, 21, 5), (0, 21, 4), (0, 21, 3), (0, 22, 2), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 23, 1), (0, 22, 1), (0, 21, 1), (0, 20, 1), (0, 19, 1), (0, 18, 1), (0, 17, 1), (0, 16, 1), (0, 15, 1), (0, 14, 1), (0, 13, 1), (0, 12, 1), (0, 11, 1), (0, 10, 1), (0, 9, 1), (0, 8, 2), (0, 7, 2), (0, 6, 3), (0, 5, 4), (0, 4, 5), (0, 3, 5), (0, 2, 5), (0, 1, 5), (0, 2, 6), (0, 3, 7), (0, 4, 8), (0, 5, 9), (0, 6, 10), (0, 7, 11), (0, 8, 12), (0, 9, 13), (0, 10, 14), (0, 11, 15), (0, 12, 16), (0, 13, 17), (0, 14, 17), (0, 15, 17), (0, 16, 17), (0, 17, 17), (0, 18, 17), (0, 19, 17), (0, 19, 16), (0, 19, 15), (0, 19, 14), (0, 19, 13), (0, 19, 12), (0, 19, 11), (0, 19, 10), (0, 19, 9), (0, 18, 9), (0, 17, 9), (0, 16, 9), (0, 15, 9), (0, 14, 9), (0, 13, 9), (0, 13, 10), (0, 13, 11), (0, 13, 12), (0, 13, 13), (0, 14, 13), (0, 15, 13), (0, 16, 13), (0, 17, 13), (0, 17, 14), (0, 16, 15), (0, 15, 15), (0, 14, 15), (0, 13, 15), (0, 12, 15), (0, 11, 14), (0, 11, 13), (0, 11, 12), (0, 11, 11), (0, 11, 10), (0, 11, 9), (0, 11, 8), (0, 11, 7), (0, 12, 7), (0, 13, 7), (0, 14, 7), (0, 15, 7), (0, 16, 7), (0, 17, 7), (0, 18, 7), (0, 19, 7), (0, 20, 7), (0, 21, 7), (0, 21, 8), (0, 21, 9), (0, 21, 10), (0, 21, 11), (0, 21, 12), (0, 21, 13), (0, 21, 14), (0, 21, 15), (0, 21, 16), (0, 21, 17), (0, 21, 18), (0, 21, 19), (0, 21, 20), (0, 21, 21), (0, 20, 22), (0, 19, 22), (0, 18, 23), (0, 19, 24), (0, 18, 23), (0, 19, 22), (0, 20, 22), (0, 21, 21), (0, 21, 20), (0, 21, 19), (0, 21, 18), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 13), (0, 21, 12), (0, 21, 11), (0, 21, 10), (0, 21, 9), (0, 21, 8), (0, 20, 7), (0, 19, 7), (0, 18, 7), (0, 17, 7), (0, 16, 7), (0, 15, 7), (0, 14, 7), (0, 13, 7), (0, 12, 7), (0, 11, 8), (0, 11, 9), (0, 11, 10), (0, 11, 11), (0, 11, 12), (0, 11, 13), (0, 10, 14), (0, 9, 13), (0, 8, 12), (0, 7, 11), (0, 6, 10), (0, 5, 9), (0, 4, 8), (0, 3, 7), (0, 2, 6), (0, 1, 5), (0, 2, 6), (0, 3, 7), (0, 4, 8), (0, 5, 9), (0, 6, 10), (0, 7, 11), (0, 8, 12), (0, 9, 13), (0, 10, 14), (0, 11, 15), (0, 12, 16), (0, 13, 17), (0, 14, 17), (0, 15, 17), (0, 16, 17), (0, 17, 17), (0, 18, 17), (0, 19, 17), (0, 19, 16), (0, 19, 15), (0, 19, 14), (0, 19, 13), (0, 19, 12), (0, 19, 11), (0, 19, 10), (0, 19, 9), (0, 18, 9), (0, 17, 9), (0, 16, 9), (0, 15, 9), (0, 14, 9), (0, 13, 9), (0, 13, 10), (0, 13, 11), (0, 13, 12), (0, 13, 13), (0, 14, 13), (0, 15, 13), (0, 16, 13), (0, 17, 13), (0, 17, 14), (0, 16, 15), (0, 15, 15), (0, 14, 15), (0, 13, 15), (0, 12, 15), (0, 11, 14), (0, 11, 13), (0, 11, 12), (0, 11, 11), (0, 11, 10), (0, 11, 9), (0, 11, 8), (0, 11, 7), (0, 12, 7), (0, 13, 7), (0, 14, 7), (0, 15, 7), (0, 16, 7), (0, 17, 7), (0, 18, 7), (0, 19, 7), (0, 20, 7), (0, 21, 7), (0, 21, 8), (0, 21, 9), (0, 21, 10), (0, 21, 11), (0, 21, 12), (0, 21, 13), (0, 21, 14), (0, 21, 15), (0, 21, 16), (0, 21, 17), (0, 21, 18), (0, 21, 19), (0, 21, 20), (0, 21, 21), (0, 20, 22), (0, 19, 22), (0, 18, 23), (0, 18, 24), (0, 18, 23), (0, 19, 22), (0, 20, 22), (0, 21, 21), (0, 21, 20), (0, 21, 19), (0, 21, 18), (0, 21, 17), (0, 21, 16), (0, 21, 15), (0, 21, 14), (0, 21, 13), (0, 21, 12), (0, 21, 11), (0, 21, 10), (0, 21, 9), (0, 21, 8)]
10 10
 
11 11
     def setUp(self):
12 12
         super().setUp()

+ 5 - 0
intelligine/tests/src/simulation/SimpleTestWorld1.tmx View File

@@ -181,30 +181,35 @@
181 181
   <tile id="2">
182 182
    <properties>
183 183
     <property name="object" value="stocked_food"/>
184
+    <property name="callbacks" value="stocked_food"/>
184 185
    </properties>
185 186
   </tile>
186 187
   <tile id="3">
187 188
    <properties>
188 189
     <property name="actions" value="clone(),"/>
189 190
     <property name="object" value="stocked_food"/>
191
+    <property name="callbacks" value="stocked_food"/>
190 192
    </properties>
191 193
   </tile>
192 194
   <tile id="4">
193 195
    <properties>
194 196
     <property name="actions" value="clone(2),"/>
195 197
     <property name="object" value="stocked_food"/>
198
+    <property name="callbacks" value="stocked_food"/>
196 199
    </properties>
197 200
   </tile>
198 201
   <tile id="5">
199 202
    <properties>
200 203
     <property name="actions" value="clone(3),"/>
201 204
     <property name="object" value="stocked_food"/>
205
+    <property name="callbacks" value="stocked_food"/>
202 206
    </properties>
203 207
   </tile>
204 208
   <tile id="6">
205 209
    <properties>
206 210
     <property name="actions" value="clone(4),"/>
207 211
     <property name="object" value="stocked_food"/>
212
+    <property name="callbacks" value="stocked_food"/>
208 213
    </properties>
209 214
   </tile>
210 215
  </tileset>