# Path: intelligine/cst.py
# POINTS_SMELL = IncrementedNamedInt.get('intelligine.points_smell')
# 
# MOLECULES = IncrementedNamedInt.get('intelligine.molecules')
# 
# MOLECULES_DIRECTION = IncrementedNamedInt.get('intelligine.mol.direction')
# 
# Path: intelligine/core/exceptions.py
# class NoMolecule(MoleculeException):
#     pass
# 
# Path: intelligine/synergy/event/move/direction.py
# def get_direction_for_degrees(degrees):
#     if degrees < 0:
#         degrees = 360 - abs(degrees)
#     for plage in directions_degrees:
#         if plage[0] <= degrees <= plage[1]:
#             return directions_degrees[plage]
#     raise Exception("Unknow plage for degree \"" + str(degrees) + '"')


from intelligine.cst import POINTS_SMELL, MOLECULES, MOLECULES_DIRECTION
from intelligine.core.exceptions import NoMolecule
from random import shuffle
from synergine_xyz.geometry import get_degree_from_north
from intelligine.synergy.event.move.direction import get_direction_for_degrees
            reverse = True
        around_molecules_sorted_by_distance = sorted(around_molecules_max,
                                                      key=lambda x: x[1].get_distance(),
                                                      reverse=reverse)

        all_same_distance = True
        for mol in around_molecules_sorted_by_distance:
            mol_mol = mol[1]
            if mol_mol.get_distance() != distance:
                all_same_distance = False
                break

        if all_same_distance:
            raise NoMolecule()

        go_to_point = around_molecules_sorted_by_distance[0][0]

        direction_degrees = get_degree_from_north(point, go_to_point)
        direction = get_direction_for_degrees(direction_degrees)

        return direction

    @classmethod
    def _get_around_molecules(cls, context, reference_point, molecule_type,
                              molecule_filter=lambda around_molecule: True):
        around_points = context.get_around_points_of_point(reference_point)
        around_molecules_points = []
        for around_point in around_points:
            flavour = context.molecules().get_flavour(around_point)
            try:

# Path: intelligine/cst.py
# POINTS_SMELL = IncrementedNamedInt.get('intelligine.points_smell')
# 
# MOLECULES = IncrementedNamedInt.get('intelligine.molecules')
# 
# MOLECULES_DIRECTION = IncrementedNamedInt.get('intelligine.mol.direction')
# 
# Path: intelligine/core/exceptions.py
# class NoMolecule(MoleculeException):
#     pass
# 
# Path: intelligine/synergy/event/move/direction.py
# def get_direction_for_degrees(degrees):
#     if degrees < 0:
#         degrees = 360 - abs(degrees)
#     for plage in directions_degrees:
#         if plage[0] <= degrees <= plage[1]:
#             return directions_degrees[plage]
#     raise Exception("Unknow plage for degree \"" + str(degrees) + '"')


# Path: intelligine/simulation/molecule/DirectionMolecule.py
from intelligine.cst import POINTS_SMELL, MOLECULES, MOLECULES_DIRECTION
from intelligine.core.exceptions import NoMolecule
from random import shuffle
from synergine_xyz.geometry import get_degree_from_north
from intelligine.synergy.event.move.direction import get_direction_for_degrees

            reverse = True
        around_molecules_sorted_by_distance = sorted(around_molecules_max,
                                                      key=lambda x: x[1].get_distance(),
                                                      reverse=reverse)

        all_same_distance = True
        for mol in around_molecules_sorted_by_distance:
            mol_mol = mol[1]
            if mol_mol.get_distance() != distance:
                all_same_distance = False
                break

        if all_same_distance:
            raise NoMolecule()

        go_to_point = around_molecules_sorted_by_distance[0][0]

        direction_degrees = get_degree_from_north(point, go_to_point)
        direction = get_direction_for_degrees(direction_degrees)

        return direction

    @classmethod
    def _get_around_molecules(cls, context, reference_point, molecule_type,
                              molecule_filter=lambda around_molecule: True):
        around_points = context.get_around_points_of_point(reference_point)
        around_molecules_points = []
        for around_point in around_points:
            flavour = context.molecules().get_flavour(around_point)
            try:

                around_molecule = flavour.get_molecule(category=MOLECULES_DIRECTION, type=molecule_type)