[Pybrainsim-activity] SF.net SVN: pybrainsim:[12] trunk/src/Stimulus.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-07-24 13:49:45
|
Revision: 12 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=12&view=rev Author: rgoj Date: 2009-07-24 13:49:33 +0000 (Fri, 24 Jul 2009) Log Message: ----------- * Changes to Stimulus.py so that it can zero the output of a connected generator Modified Paths: -------------- trunk/src/Stimulus.py Modified: trunk/src/Stimulus.py =================================================================== --- trunk/src/Stimulus.py 2009-07-24 13:20:10 UTC (rev 11) +++ trunk/src/Stimulus.py 2009-07-24 13:49:33 UTC (rev 12) @@ -28,19 +28,20 @@ class Stimulus(Generator): def __init__(self): + self.output = 0 self.connectedGeneratorOutput = 0 self.counter = 0 - def sendOutput(self): - return -self.connectedGeneratorOutput - def receiveInput(self, input): self.connectedGeneratorOutput = input def runGenerator(self): + print("Counter: " + str(self.counter) + " Output: " + str(self.output)) if self.counter == 10: - self.counter = 0; + self.output = -self.connectedGeneratorOutput + self.counter = 0 else: + self.output = 0 self.counter += 1 return 0 # This is necessary, because the output 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. |