[Pybrainsim-activity] SF.net SVN: pybrainsim:[75] trunk/src
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-08-03 18:07:55
|
Revision: 75 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=75&view=rev Author: rgoj Date: 2009-08-03 18:07:46 +0000 (Mon, 03 Aug 2009) Log Message: ----------- * Proper column width of license and beginning commentary Modified Paths: -------------- trunk/src/GeneratorSine.py trunk/src/PyBrainSim.py Modified: trunk/src/GeneratorSine.py =================================================================== --- trunk/src/GeneratorSine.py 2009-08-03 17:57:45 UTC (rev 74) +++ trunk/src/GeneratorSine.py 2009-08-03 18:07:46 UTC (rev 75) @@ -3,23 +3,24 @@ # # 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 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. +# 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/>. +# 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 GeneratorSine class is an example generator that simply generates a single sine. +The GeneratorSine class is a reimplementation of the Generator class. It +provides a sine generator and allows the phase of the sine to be zeroed by a +stimulus. """ import math Modified: trunk/src/PyBrainSim.py =================================================================== --- trunk/src/PyBrainSim.py 2009-08-03 17:57:45 UTC (rev 74) +++ trunk/src/PyBrainSim.py 2009-08-03 18:07:46 UTC (rev 75) @@ -28,16 +28,14 @@ from Head import Head from Experiment import Experiment - from Stimulus import Stimulus from StimulusDummy import StimulusDummy from GeneratorDummy import GeneratorDummy from GeneratorNumberIncrementing import GeneratorNumberIncrementing +from GeneratorSine import GeneratorSine from Connection import Connection from ConnectionDummy import ConnectionDummy -#from GeneratorSine import GeneratorSine - welcomeMessage = "\n\ Welcome to this early version of PyBrainSim\n\n\ Choose the type of simulation you would like to perform:\n\ @@ -92,27 +90,18 @@ exampleExperiment = Experiment(exampleHead.runSimulation( 1 )) print("\nSimulations resulted in the following recording:") print exampleExperiment.getRecording() -#elif userChoice == 2: -# exampleExperiment = Experiment() -# exampleExperiment.addStimulusTime( 0.2341 ) -# -# exampleHead = Head() -# exampleHead.setSamplingFrequency( 10 ) -# exampleHead.addRegistrationSite([0, 0, 0]) -# -# exampleGenerator1 = GeneratorSine() -# exampleHead.addGenerator(exampleGenerator1) -# -# exampleStimulus = GeneratorStimulusPhaseReset() -# exampleStimulus.setStimulusTimes(exampleExperiment.getStimulusTimes()) -# exampleHead.addGenerator(exampleStimulus) -# -# exampleStimulusToGeneratorConnection = ConnectionSimple(exampleStimulus, exampleGenerator1) -# exampleGeneratorToStimulusConnection = ConnectionSimple(exampleGenerator1, exampleStimulus) -# exampleHead.addConnection(exampleGeneratorToStimulusConnection) -# exampleHead.addConnection(exampleStimulusToGeneratorConnection) -# -# exampleExperiment.setRecording(exampleHead.runSimulation( 1.1 )) -# print exampleExperiment.getRecording() +elif userChoice == 4: + exampleHead = Head() + exampleHead.setSamplingFrequency(128) + exampleHead.addRegistrationSite([0, 0, 0]) + + exampleStimulus = Stimulus('Stim', exampleHead) + exampleStimulus.setStimulusTimes([0.3, 0.6]) + exampleGenerator = GeneratorSine('Gen', exampleHead) + exampleConnection = Connection('Con', exampleHead, exampleStimulus, exampleGenerator) + + exampleExperiment = Experiment(exampleHead.runSimulation( 1 )) + print("\nSimulations resulted in the following recording:") + print exampleExperiment.getRecording() else: print("No such option unfortunately...") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |