[Pybrainsim-activity] SF.net SVN: pybrainsim:[51] trunk/src/Stimulus.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-03 10:41:54
|
Revision: 51 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=51&view=rev Author: rgoj Date: 2009-08-03 10:41:45 +0000 (Mon, 03 Aug 2009) Log Message: ----------- * The Stimulus class now also implements stimulusTimes from the phase resetting stimulus class, which will now be removed. Modified Paths: -------------- trunk/src/Stimulus.py Modified: trunk/src/Stimulus.py =================================================================== --- trunk/src/Stimulus.py 2009-08-03 10:32:34 UTC (rev 50) +++ trunk/src/Stimulus.py 2009-08-03 10:41:45 UTC (rev 51) @@ -27,15 +27,22 @@ class Stimulus(Generator): def __init__(self): self.activation = None - self.counter = 0 + self.stimulusTimes = [] + + def setStimulusTimes(self, stimulusTimes): + self.stimulusTimes = stimulusTimes def runGenerator(self, time): - if self.counter == 5: - self.activation = 'Stimulus' - self.counter = 0 - else: - self.activation = None - self.counter += 1 + if self.currentStimulus < len(self.stimulusTimes): + if self.stimulusTimes[self.currentStimulus] < time: + print("Stimulus now: BEEEEEEEP! ... Time is: " + str(time) + ", Stimulus list is: " + str(self.stimulusTimes) + " Connected generator phase should have been: " + str(self.connectedGeneratorPhase)) + + self.currentStimulus += 1 + + self.activation = 'Stimulus' + else: + self.activation = None + # The runGenerator method must return a value return 0 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |