Browse Source

remomve last pheromone point on ant

Bastien Sevajol 9 years ago
parent
commit
2a375ff221

+ 0 - 2
intelligine/cst.py View File

@@ -25,8 +25,6 @@ TYPE = IncrementedNamedInt.get('intelligine.object.type')
25 25
 TYPE_RESOURCE_TRANSFORMABLE = IncrementedNamedInt.get('intelligine.object.type.resource.transformable')
26 26
 TYPE_NURSERY = IncrementedNamedInt.get('intelligine.object.type.nursery')
27 27
 
28
-LAST_PHERMONES_POINTS = IncrementedNamedInt.get('intelligine.last_pheromones_points')
29
-
30 28
 PHEROMON_POSITIONS = IncrementedNamedInt.get('intelligine.phero.positions')
31 29
 PHEROMON_INFOS = IncrementedNamedInt.get('intelligine.phero.infos')
32 30
 PHEROMON_DIRECTION = IncrementedNamedInt.get('intelligine.phero.direction')

+ 0 - 2
intelligine/simulation/object/brain/part/transport/AntTakeBrainPart.py View File

@@ -21,6 +21,4 @@ class AntTakeBrainPart(TakeBrainPart):
21 21
         # TODO: Ranger ca ? Truc plus dynamique/configurable ?
22 22
         if isinstance(take_object, Resource):
23 23
             obj.get_brain().switch_to_mode(MOVE_MODE_GOHOME)
24
-            # TODO: set_last_pheromone_point ca devrait pas etre dans get_movement_pheromone_gland().appose() ?
25
-            obj.set_last_pheromone_point(PHEROMON_DIR_EXPLO, obj.get_position())
26 24
             obj.get_movement_pheromone_gland().appose()

+ 1 - 7
intelligine/synergy/object/ant/Ant.py View File

@@ -3,7 +3,7 @@ from intelligine.synergy.object.Bug import Bug
3 3
 from intelligine.cst import CARRYING, TRANSPORTER, ATTACKER, \
4 4
                             COL_TRANSPORTER, COL_TRANSPORTER_NOT_CARRYING, \
5 5
                             COL_FIGHTER, MOVE_MODE_EXPLO, MOVE_MODE_GOHOME, \
6
-                            PHEROMON_DIR_EXPLO, LAST_PHERMONES_POINTS, CARRIED
6
+                            PHEROMON_DIR_EXPLO, CARRIED
7 7
 from intelligine.synergy.object.Food import Food
8 8
 from intelligine.simulation.object.pheromone.MovementPheromoneGland import MovementPheromoneGland
9 9
 from intelligine.simulation.object.brain.AntBrain import AntBrain
@@ -18,7 +18,6 @@ class Ant(Bug):
18 18
                                                            COL_TRANSPORTER_NOT_CARRYING,
19 19
                                                            COL_FIGHTER])
20 20
         self._carried = []
21
-        self._last_pheromones_points = {}
22 21
         # TODO: Faire un body_part schema pour ces trucs la
23 22
         self._movement_pheromone_gland = MovementPheromoneGland(self, self._context)
24 23
         self._brain.switch_to_mode(MOVE_MODE_EXPLO)
@@ -48,7 +47,6 @@ class Ant(Bug):
48 47
         # TODO: pour le moment hardcode
49 48
         if isinstance(obj, Food):
50 49
             self.get_brain().switch_to_mode(MOVE_MODE_GOHOME)
51
-            self.set_last_pheromone_point(PHEROMON_DIR_EXPLO, obj.get_position())
52 50
             self.get_movement_pheromone_gland().appose()
53 51
 
54 52
     def is_carrying(self):
@@ -71,10 +69,6 @@ class Ant(Bug):
71 69
             return self._last_pheromones_points[pheromone_name]
72 70
         return self._start_position
73 71
 
74
-    def set_last_pheromone_point(self, pheromone_name, position):
75
-        self._last_pheromones_points[pheromone_name] = position
76
-        self._context.metas.value.set(LAST_PHERMONES_POINTS, self.get_id(), self._last_pheromones_points)
77
-
78 72
     def initialize(self):
79 73
         super().initialize()
80 74
         if self.get_movement_pheromone_gland().is_enabled():