[Pybrainsim-activity] SF.net SVN: pybrainsim:[99] trunk/src/Head.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-13 09:04:01
|
Revision: 99 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=99&view=rev Author: rgoj Date: 2009-08-13 09:03:49 +0000 (Thu, 13 Aug 2009) Log Message: ----------- * Removed the runHeadModel code * Added a setHeadModel method * Using the new HeadModel object in runSimulation Modified Paths: -------------- trunk/src/Head.py Modified: trunk/src/Head.py =================================================================== --- trunk/src/Head.py 2009-08-13 08:34:43 UTC (rev 98) +++ trunk/src/Head.py 2009-08-13 09:03:49 UTC (rev 99) @@ -32,6 +32,7 @@ self.generatorSiteList = [] self.connectionList = [] self.registrationSiteList = [] + self.headModel = None def setSamplingFrequency(self, samplingFrequency): self.samplingFrequency = samplingFrequency @@ -55,20 +56,9 @@ # brain/scalp region... self.registrationSiteList.append(position) - def runHeadModel(self, generatorOutput, recording): - # Filling all registration sites with the generators' output - for i in range(len(recording)): - recording[i].append(0) - for j in range(len(self.generatorList)): - # The Stimulus class may return a string variable, we can't add - # it to the recording, so we need to look out for it. - if isinstance(generatorOutput[j], str): - recording[i][-1] += 0 - else: - recording[i][-1] += generatorOutput[j] + def setHeadModel(self, headModel): + self.headModel = headModel - return recording - def runSimulation(self, duration=1): """Queries all generators, sends the generators' output to connections, to the head model and then to the specified registration sites""" @@ -100,6 +90,6 @@ self.connectionList[i].runConnection(generatorOutput[sourceGeneratorIndex]) # Passing the output of the generators through to the head model - recording = self.runHeadModel(generatorOutput, recording) + recording = self.headModel.runHeadModel(generatorOutput, recording) return recording This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |