[Pybrainsim-activity] SF.net SVN: pybrainsim:[49] trunk/src/GeneratorStimulusActivationZeroing.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-03 10:31:24
|
Revision: 49 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=49&view=rev Author: rgoj Date: 2009-08-03 10:31:15 +0000 (Mon, 03 Aug 2009) Log Message: ----------- * Removing old stimulus class, which won't be used any more. Removed Paths: ------------- trunk/src/GeneratorStimulusActivationZeroing.py Deleted: trunk/src/GeneratorStimulusActivationZeroing.py =================================================================== --- trunk/src/GeneratorStimulusActivationZeroing.py 2009-08-03 10:20:38 UTC (rev 48) +++ trunk/src/GeneratorStimulusActivationZeroing.py 2009-08-03 10:31:15 UTC (rev 49) @@ -1,46 +0,0 @@ -# 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 GeneratorStimulusActivationZeroing class is a child class of the Generator class. It reimplements the runGenerator method, so that a stimulus can be periodically sent to all connected generators. - -Currently the GeneratorStimulusActivationZeroing class only keeps a counter to remember the number of times it was called. -""" - -from GeneratorDummy import GeneratorDummy - -class GeneratorStimulusActivationZeroing(GeneratorDummy): - def __init__(self): - self.activation = 0 - self.connectedGeneratorOutput = 0 - self.counter = 0 - - def receiveInput(self, input): - self.connectedGeneratorOutput = input - - def runGenerator(self, time): - if self.counter == 10: - self.activation = -self.connectedGeneratorOutput - self.counter = 0 - else: - self.activation = 0 - self.counter += 1 - - return 0 # This is necessary, because the activation of this function is added to the recording in Head.py This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |