|
|
|
|
4
|
from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
|
4
|
from intelligine.simulation.molecule.DirectionMolecule import DirectionMolecule
|
5
|
from intelligine.simulation.molecule.Evaporation import Evaporation
|
5
|
from intelligine.simulation.molecule.Evaporation import Evaporation
|
6
|
from intelligine.simulation.molecule.Molecule import Molecule
|
6
|
from intelligine.simulation.molecule.Molecule import Molecule
|
|
|
7
|
+from intelligine.synergy.event.move.MoveAction import MoveAction
|
7
|
from intelligine.synergy.event.smell.SmellEvent import SmellEvent
|
8
|
from intelligine.synergy.event.smell.SmellEvent import SmellEvent
|
8
|
from synergine.synergy.event.Action import Action
|
9
|
from synergine.synergy.event.Action import Action
|
9
|
|
10
|
|
|
|
|
|
11
|
class SmellAction(Action):
|
12
|
class SmellAction(Action):
|
12
|
|
13
|
|
13
|
_listen = SmellEvent
|
14
|
_listen = SmellEvent
|
|
|
15
|
+ _depend = [MoveAction]
|
14
|
|
16
|
|
15
|
@classmethod
|
17
|
@classmethod
|
16
|
def cycle_pre_run(cls, context, synergy_manager):
|
18
|
def cycle_pre_run(cls, context, synergy_manager):
|
|
|
|
|
29
|
try:
|
31
|
try:
|
30
|
DirectionMolecule.appose(context, smell_point, molecule)
|
32
|
DirectionMolecule.appose(context, smell_point, molecule)
|
31
|
except BestMoleculeHere:
|
33
|
except BestMoleculeHere:
|
32
|
- pass # TODO: Pas l'inverse ? A voir apres avoir fix la disparition.
|
|
|
33
|
-
|
|
|
34
|
- #
|
|
|
35
|
- # current_point_smell = points_distances[smell_point]
|
|
|
36
|
- # where_to_put_smells = context.metas.value.get(POINT_SMELL, smell_point, allow_empty=True, empty_value={})
|
|
|
37
|
- #
|
|
|
38
|
- #
|
|
|
39
|
- # if smell_type not in where_to_put_smells:
|
|
|
40
|
- # where_to_put_smells[smell_type] = current_point_smell
|
|
|
41
|
- # else:
|
|
|
42
|
- # where_to_put_smell = where_to_put_smells[smell_type]
|
|
|
43
|
- # if current_point_smell < where_to_put_smell:
|
|
|
44
|
- # where_to_put_smells[smell_type] = where_to_put_smell
|
|
|
45
|
- #
|
|
|
46
|
- # context.metas.value.set(POINT_SMELL, smell_point, where_to_put_smells)
|
|
|
47
|
- # context.metas.list.add(POINTS_SMELL, POINTS_SMELL, smell_point, assert_not_in=False)
|
|
|
|
|
34
|
+ pass
|