[Pybrainsim-activity] SF.net SVN: pybrainsim:[98] trunk/src/HeadModel.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-13 08:34:52
|
Revision: 98 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=98&view=rev Author: rgoj Date: 2009-08-13 08:34:43 +0000 (Thu, 13 Aug 2009) Log Message: ----------- * Adding the HeadModel class to replace the corresponding code in Head.py Added Paths: ----------- trunk/src/HeadModel.py Added: trunk/src/HeadModel.py =================================================================== --- trunk/src/HeadModel.py (rev 0) +++ trunk/src/HeadModel.py 2009-08-13 08:34:43 UTC (rev 98) @@ -0,0 +1,39 @@ +# PyBrainSim Copyright 2009 Roman Goj +# +# This file is part of PyBrainSim. +# +# PyBrainSim is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free Software +# Foundation, either version 3 of the License, or (at your option) any later +# version. +# +# PyBrainSim is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# PyBrainSim. If not, see <http://www.gnu.org/licenses/>. + +from __future__ import division +from Numeric import arange +__metaclass__ = type # New style classes. Is this necessary? + +""" +The HeadModel class takes care of what happens to the generators' activity on +it's way to the registration sites - i.e. with impedance of the skull. +""" + +class HeadModel: + 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] + + return recording This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |