Explorar el Código

around molecules: no molecule if just reference position

Bastien Sevajol hace 8 años
padre
commit
46e0e970a8
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      intelligine/simulation/molecule/DirectionMolecule.py

+ 2 - 1
intelligine/simulation/molecule/DirectionMolecule.py Ver fichero

@@ -83,7 +83,8 @@ class DirectionMolecule():
83 83
             except NoMolecule:
84 84
                 pass  # Ok, no molecule, continue to sniff around
85 85
 
86
-        if not around_molecules_points:
86
+        if not around_molecules_points \
87
+           or (len(around_molecules_points) == 1 and around_molecules_points[0][0] == reference_point):
87 88
             raise NoMolecule()
88 89
 
89 90
         shuffle(around_molecules_points)