[Pybrainsim-activity] SF.net SVN: pybrainsim:[30] trunk/src/PyBrainSim.py
Status: Planning
Brought to you by:
rgoj
From: <rg...@us...> - 2009-07-31 09:16:21
|
Revision: 30 http://pybrainsim.svn.sourceforge.net/pybrainsim/?rev=30&view=rev Author: rgoj Date: 2009-07-31 09:16:05 +0000 (Fri, 31 Jul 2009) Log Message: ----------- * Reformat file so that it has correct column width for documentation Modified Paths: -------------- trunk/src/PyBrainSim.py Modified: trunk/src/PyBrainSim.py =================================================================== --- trunk/src/PyBrainSim.py 2009-07-29 15:11:03 UTC (rev 29) +++ trunk/src/PyBrainSim.py 2009-07-31 09:16:05 UTC (rev 30) @@ -3,23 +3,25 @@ # # 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/>. """ -PyBrainSim is an interactive tool for the simulation and visualization of the electromagnetic activity of the brain, currently under development. +PyBrainSim is an interactive tool for the simulation and visualization of the +electromagnetic activity of the brain, currently under development. -This script can be executed to run an example simulation, using the Head and GeneratorDummy classes. Currently it only generates a list of integer numbers... but work is under way to make it simulate the brain... Have fun! +This script can be executed to run an example simulation, using the Head and +GeneratorDummy classes. Currently it only generates a list of integer +numbers... but work is under way to make it simulate the brain... Have fun! pybrainsim.sourceforge.net """ @@ -29,7 +31,7 @@ from GeneratorDummy import GeneratorDummy from GeneratorSine import GeneratorSine from ConnectionSimple import ConnectionSimple -from GeneratorStimulusActivationZeroing import GeneratorStimulusActivationZeroing +from GeneratorStimulusActivationZeroing import GeneratorStimulusActivationZeroing from GeneratorStimulusPhaseReset import GeneratorStimulusPhaseReset welcomeMessage = "\n\ @@ -47,46 +49,46 @@ exampleHead.setSamplingFrequency(32) exampleHead.addRegistrationSite([0, 0, 0]) exampleHead.addRegistrationSite([0, 0, 0]) - + exampleGenerator1 = GeneratorDummy() exampleGenerator2 = GeneratorDummy() exampleHead.addGenerator(exampleGenerator1) exampleHead.addGenerator(exampleGenerator2) - + exampleConnection = ConnectionSimple(exampleGenerator1, exampleGenerator2) exampleHead.addConnection(exampleConnection) - + exampleStimulus = GeneratorStimulusActivationZeroing() exampleHead.addGenerator(exampleStimulus) - + exampleStimulusToGeneratorConnection = ConnectionSimple(exampleStimulus, exampleGenerator1) exampleGeneratorToStimulusConnection = ConnectionSimple(exampleGenerator1, exampleStimulus) exampleHead.addConnection(exampleStimulusToGeneratorConnection) exampleHead.addConnection(exampleGeneratorToStimulusConnection) - - exampleExperiment = Experiment(exampleHead.runSimulation(1)) + + exampleExperiment = Experiment(exampleHead.runSimulation( 1 )) print exampleExperiment.getRecording() elif userChoice == 2: exampleExperiment = Experiment() - exampleExperiment.addStimulusTime(0.2341) - + exampleExperiment.addStimulusTime( 0.2341 ) + exampleHead = Head() - exampleHead.setSamplingFrequency(10) + 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)) + + exampleExperiment.setRecording(exampleHead.runSimulation( 1.1 )) 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. |