|
@@ -11,7 +11,7 @@ from intelligine.tests.src.event.MoveAction import MoveAction as TestMoveAction
|
11
|
11
|
from synergine.synergy.collection.SynergyCollection import SynergyCollection
|
12
|
12
|
from synergine.synergy.collection.Configuration import Configuration
|
13
|
13
|
from intelligine.core.Context import Context
|
14
|
|
-from intelligine.cst import MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, MOVE_MODE, MOVE_MODE_HOME, PHEROMON_DIR_NONE
|
|
14
|
+from intelligine.cst import MODE_EXPLO, MODE_GOHOME, MODE, MODE_HOME, PHEROMON_DIR_NONE
|
15
|
15
|
from intelligine.cst import PHEROMON_DIR_EXPLO
|
16
|
16
|
|
17
|
17
|
|
|
@@ -25,8 +25,8 @@ class TestChangeMode(Base):
|
25
|
25
|
|
26
|
26
|
@staticmethod
|
27
|
27
|
def _force_move(self_move_action, object_id, context):
|
28
|
|
- object_movement_mode = context.metas.value.get(MOVE_MODE, object_id)
|
29
|
|
- if object_movement_mode == MOVE_MODE_GOHOME or object_movement_mode == MOVE_MODE_HOME:
|
|
28
|
+ object_movement_mode = context.metas.value.get(MODE, object_id)
|
|
29
|
+ if object_movement_mode == MODE_GOHOME or object_movement_mode == MODE_HOME:
|
30
|
30
|
return SOUTH
|
31
|
31
|
return NORTH
|
32
|
32
|
|
|
@@ -104,12 +104,12 @@ class TestChangeMode(Base):
|
104
|
104
|
def test_from_exploration_to_go_home(self):
|
105
|
105
|
self._run_and_get_core(0)
|
106
|
106
|
self.assertEquals((0, 0, 0), self.ant.get_position())
|
107
|
|
- self.assertEquals(MOVE_MODE_EXPLO, self.ant.get_brain().get_movement_mode())
|
|
107
|
+ self.assertEquals(MODE_EXPLO, self.ant.get_brain().get_movement_mode())
|
108
|
108
|
self.assertFalse(self.ant.is_carrying())
|
109
|
109
|
|
110
|
110
|
self._run_and_get_core(1)
|
111
|
111
|
self.assertEquals((0, 0, -1), self.ant.get_position())
|
112
|
|
- self.assertEquals(MOVE_MODE_EXPLO, self.ant.get_brain().get_movement_mode())
|
|
112
|
+ self.assertEquals(MODE_EXPLO, self.ant.get_brain().get_movement_mode())
|
113
|
113
|
self.assertFalse(self.ant.is_carrying())
|
114
|
114
|
|
115
|
115
|
# Ant has take Food piece
|
|
@@ -121,22 +121,22 @@ class TestChangeMode(Base):
|
121
|
121
|
molecule = self.ant.get_movement_molecule_gland().get_molecule()
|
122
|
122
|
# Now it appose exploration molecule
|
123
|
123
|
self.assertEquals((PHEROMON_DIR_EXPLO, 0), (molecule.get_type(), molecule.get_distance()))
|
124
|
|
- self.assertEquals(MOVE_MODE_GOHOME, self.ant.get_brain().get_movement_mode())
|
|
124
|
+ self.assertEquals(MODE_GOHOME, self.ant.get_brain().get_movement_mode())
|
125
|
125
|
self.assertEquals(PHEROMON_DIR_EXPLO, self.ant.get_movement_molecule_gland().get_molecule_type())
|
126
|
126
|
|
127
|
127
|
self._run_and_get_core(32)
|
128
|
128
|
self.assertEquals((0, 0, -6), self.ant.get_position())
|
129
|
129
|
self.assertTrue(self.ant.is_carrying())
|
130
|
|
- self.assertEquals(MOVE_MODE_HOME, self.ant.get_brain().get_movement_mode())
|
|
130
|
+ self.assertEquals(MODE_HOME, self.ant.get_brain().get_movement_mode())
|
131
|
131
|
|
132
|
132
|
self._run_and_get_core(33)
|
133
|
133
|
self.assertEquals((0, 0, -5), self.ant.get_position())
|
134
|
134
|
self.assertTrue(self.ant.is_carrying())
|
135
|
|
- self.assertEquals(MOVE_MODE_HOME, self.ant.get_brain().get_movement_mode())
|
|
135
|
+ self.assertEquals(MODE_HOME, self.ant.get_brain().get_movement_mode())
|
136
|
136
|
|
137
|
137
|
self._run_and_get_core(34)
|
138
|
138
|
self.assertEquals((0, 0, -4), self.ant.get_position())
|
139
|
|
- self.assertEquals(MOVE_MODE_HOME, self.ant.get_brain().get_movement_mode())
|
|
139
|
+ self.assertEquals(MODE_HOME, self.ant.get_brain().get_movement_mode())
|
140
|
140
|
|
141
|
141
|
self._run_and_get_core(37)
|
142
|
142
|
self.assertEquals((0, 0, -1), self.ant.get_position())
|