[Pybrainsim-activity] SF.net SVN: pybrainsim:[77] trunk/src/GeneratorSine.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-03 18:14:49
|
Revision: 77 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=77&view=rev Author: rgoj Date: 2009-08-03 18:14:42 +0000 (Mon, 03 Aug 2009) Log Message: ----------- * Removed the obsolete sendOutput() method * Wrote a proper receiveInput() method, so that a stimulus will reset the phase of the generated sine Modified Paths: -------------- trunk/src/GeneratorSine.py Modified: trunk/src/GeneratorSine.py =================================================================== --- trunk/src/GeneratorSine.py 2009-08-03 18:10:19 UTC (rev 76) +++ trunk/src/GeneratorSine.py 2009-08-03 18:14:42 UTC (rev 77) @@ -32,12 +32,11 @@ self.frequency = frequency self.phaseShift = phaseShift - def sendOutput(self): - print("Sending output: " + str(self.phase)) - return self.phase - - def receiveInput(self, newPhaseShift): - self.phaseShift = newPhaseShift + def receiveInput(self, input): + if input == 'Stimulus': + self.phaseShift = -self.activation + else: + self.activation += input def runGenerator(self, time): self.phase = (2 * math.pi * self.frequency * time + 2 * math.pi * self.phaseShift) % (2 * math.pi / self.frequency) / (2 * math.pi) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |