Browse Source

remomve last pheromone point on ant

Bastien Sevajol 9 years ago
parent
commit
2a375ff221

+ 0 - 2
intelligine/cst.py View File

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

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

21
         # TODO: Ranger ca ? Truc plus dynamique/configurable ?
21
         # TODO: Ranger ca ? Truc plus dynamique/configurable ?
22
         if isinstance(take_object, Resource):
22
         if isinstance(take_object, Resource):
23
             obj.get_brain().switch_to_mode(MOVE_MODE_GOHOME)
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
             obj.get_movement_pheromone_gland().appose()
24
             obj.get_movement_pheromone_gland().appose()

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

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