[Pybrainsim-activity] SF.net SVN: pybrainsim:[37] trunk/src/Generator.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-02 16:26:46
|
Revision: 37 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=37&view=rev Author: rgoj Date: 2009-08-02 16:26:39 +0000 (Sun, 02 Aug 2009) Log Message: ----------- * Adding the Generator class, which will be the new class that all generator classes should inherit from Added Paths: ----------- trunk/src/Generator.py Added: trunk/src/Generator.py =================================================================== --- trunk/src/Generator.py (rev 0) +++ trunk/src/Generator.py 2009-08-02 16:26:39 UTC (rev 37) @@ -0,0 +1,40 @@ +# 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/>. + +__metaclass__ = type # New style classes. Is this necessary? + +""" +The Generator class serves as a starting point for creating complex classes +simulating populations of neurons. +""" + +class Generator: + def __init__(self, name): + self.name = name + self.activation = 0 + + def printInfo(self): + print(self.name + ": A Generator object") + + def getName(self): + return self.name + + def receiveInput(self, input): + self.activation += input + + def runGenerator(self, time): + return self.activation + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |