This directory contains the scripts for computer simulation 1 
(with weight-dependent RM-STDP rule) from 

	Legenstein R, Pecevski D, Maass W 2008 A Learning Theory 
    for Reward-Modulated Spike-Timing-Dependent Plasticity with 
    Application to Biofeedback. PLoS Computational Biology 4(10): e1000180, Oct, 2008 
    
The produced results are supplementary figures 3 and 4.

To create these figures you need to:

1. The computer simulation is setup to run as an MPI application
   on 16 computing nodes on a cluster, with 2 processes per computing node.
   To set the list of the names of machines you want to use edit the file start_simulation.py.
   
2. Start mpdboot on the cluster machines. See the mpich2 documentation on how to do this. 
   
3. Execute:

    start_simulation.py
    
    This is an executable file, you don't need to run 'python start_simulation.py'.
    
    Wait until the simulation finishes. The script will produce one hdf5 file in the current directory.

4. To create supplementary figure 3 run:
   
      ipython -pylab figure_draft_journal.py
      
5. The next script uses IPython parallel computing capabilities to parallelize execution 
   of some calculations. To setup on which machines the ipython cluster should run, 
   edit the clusterconf.py file.      
      
      
6. Then, to create supplementary figure 3 run:
   
      ipython -pylab figure_journal_ai_analysis.py
      

      