Przeglądaj źródła

let a neuron get his name from the mother class

nico 8 lat temu
rodzic
commit
c0d61212af
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      core/NeuronModule.py

+ 7 - 1
core/NeuronModule.py

@@ -63,6 +63,7 @@ class NeuronModule(object):
         """
         # get the child who called the class
         child_name = self.__class__.__name__
+        self.neuron_name = child_name
         logger.debug("NeuronModule called from class %s with parameters: %s" % (child_name, str(kwargs)))
 
         sl = SettingLoader.Instance()
@@ -217,4 +218,9 @@ class NeuronModule(object):
         oa = OrderListener(callback=callback)
         oa.start()
 
-
+    def get_neuron_name(self):
+        """
+        Return the name of the neuron who call the mother class
+        :return:
+        """
+        return self.neuron_name