# Path: intelligine/cst.py
# OBJ_SMELL = IncrementedNamedInt.get('intelligine.obj_smell')
# 
# INSTANCE_CLASS = IncrementedNamedInt.get('intelligine.instance_class')
# 
# Path: intelligine/synergy/Simulation.py
# class Simulation(BaseSimulation):
# 
#     _smells = []
# 
#     @classmethod
#     def add_smell(cls, smell):
#         if smell not in cls._smells:
#             cls._smells.append(smell)
# 
#     @classmethod
#     def get_smells(cls):
#         return cls._smells
# 
#     def end_cycle(self, context):
#         clean_each_cycle = Core.get_configuration_manager().get('engine.clean_each_cycle', 100)
#         evaporate_each_cycle = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_each_cycle', 100)
# 
#         if context.get_cycle() % clean_each_cycle is 0:
#             context.metas.list.clean(POSITIONS)
# 
#         if context.get_cycle() % evaporate_each_cycle is 0:
#             self._evaporate(context)
# 
#     def _evaporate(self, context):
#         evaporation_increment = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_decrement', 5)
#         evaporation_min_age = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_min_age', 100)
#         evaporation = Evaporation(context,
#                                   evaporation_increment,
#                                   molecules_exclude_types=self.get_smells(),
#                                   molecule_minimum_age=evaporation_min_age)
#         evaporation.evaporate()


from intelligine.cst import OBJ_SMELL, INSTANCE_CLASS
from intelligine.synergy.Simulation import Simulation
from synergine_xyz.SynergyObject import SynergyObject as XyzSynergyObject


class SynergyObject(XyzSynergyObject):

    def __init__(self, collection, context):
        super().__init__(collection, context)
        self._smell = None
        context.metas.value.set(INSTANCE_CLASS, self.get_id(), self.__class__)

    def _set_smell(self, smell_type):
        self._smell = smell_type
        self._context.metas.value.set(OBJ_SMELL, self.get_id(), smell_type)

# Path: intelligine/cst.py
# OBJ_SMELL = IncrementedNamedInt.get('intelligine.obj_smell')
# 
# INSTANCE_CLASS = IncrementedNamedInt.get('intelligine.instance_class')
# 
# Path: intelligine/synergy/Simulation.py
# class Simulation(BaseSimulation):
# 
#     _smells = []
# 
#     @classmethod
#     def add_smell(cls, smell):
#         if smell not in cls._smells:
#             cls._smells.append(smell)
# 
#     @classmethod
#     def get_smells(cls):
#         return cls._smells
# 
#     def end_cycle(self, context):
#         clean_each_cycle = Core.get_configuration_manager().get('engine.clean_each_cycle', 100)
#         evaporate_each_cycle = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_each_cycle', 100)
# 
#         if context.get_cycle() % clean_each_cycle is 0:
#             context.metas.list.clean(POSITIONS)
# 
#         if context.get_cycle() % evaporate_each_cycle is 0:
#             self._evaporate(context)
# 
#     def _evaporate(self, context):
#         evaporation_increment = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_decrement', 5)
#         evaporation_min_age = Core.get_configuration_manager().get('stigmergy.molecule.evaporate_min_age', 100)
#         evaporation = Evaporation(context,
#                                   evaporation_increment,
#                                   molecules_exclude_types=self.get_smells(),
#                                   molecule_minimum_age=evaporation_min_age)
#         evaporation.evaporate()


# Path: intelligine/synergy/object/SynergyObject.py
from intelligine.cst import OBJ_SMELL, INSTANCE_CLASS
from intelligine.synergy.Simulation import Simulation
from synergine_xyz.SynergyObject import SynergyObject as XyzSynergyObject



class SynergyObject(XyzSynergyObject):

    def __init__(self, collection, context):
        super().__init__(collection, context)
        self._smell = None
        context.metas.value.set(INSTANCE_CLASS, self.get_id(), self.__class__)

    def _set_smell(self, smell_type):
        self._smell = smell_type
        self._context.metas.value.set(OBJ_SMELL, self.get_id(), smell_type)

        Simulation.add_smell(smell_type)