소스 검색

let a neuron get his name from the mother class

nico 8 년 전
부모
커밋
c0d61212af
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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