|
@@ -1,3 +1,4 @@
|
|
1
|
+from intelligine.core.exceptions import BestMoleculeHere
|
1
|
2
|
from intelligine.cst import POINT_SMELL, POINTS_SMELL, MOLECULES_INFOS, MOLECULES_DIRECTION, SMELL_FOOD, SMELL_EGG
|
2
|
3
|
from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
|
3
|
4
|
from intelligine.simulation.molecule.Molecule import Molecule
|
|
@@ -23,14 +24,18 @@ class SmellAction(Action):
|
23
|
24
|
context.metas.list.unset(POINTS_SMELL, POINTS_SMELL, allow_empty=True)
|
24
|
25
|
|
25
|
26
|
def run(self, obj, context, synergy_manager):
|
26
|
|
- # TODO: Utiliser molecule
|
|
27
|
+
|
27
|
28
|
points_distances = self._parameters['points_distances']
|
28
|
29
|
smell_type = obj.get_smell()
|
29
|
30
|
|
30
|
31
|
for smell_point in points_distances:
|
31
|
32
|
distance = points_distances[smell_point]
|
32
|
33
|
molecule = Molecule(MOLECULES_DIRECTION, smell_type, distance)
|
33
|
|
- DirectionMolecule.appose(context, smell_point, molecule)
|
|
34
|
+
|
|
35
|
+ try:
|
|
36
|
+ DirectionMolecule.appose(context, smell_point, molecule)
|
|
37
|
+ except BestMoleculeHere:
|
|
38
|
+ pass #
|
34
|
39
|
|
35
|
40
|
#
|
36
|
41
|
# current_point_smell = points_distances[smell_point]
|