"""
example0 for snnet

Single cell integration.

Robert A McDougal, 2011
"""

from snnet import *

# define the simulation
def simulation():
    # create one Hodgkin-Huxley cell
    h_cell = neurons('hh.snnet')

    # run until t=50 ms    
    run_to(50)
    
    # apply a current,run for another 20 ms, remove the current
    h_cell.iapp = 5
    advance(20)
    h_cell.iapp = 0
    
    # advance to t=200 ms
    run_to(200)

# run the simulation
run(simulation, 'example0', integrator=xpp_integrator, save_type=full)  

# display a message explaining how to view the results
print 'Simulation complete. Use either example0_matplotlib or'
print 'example0_gnuplot to make a pdf of the results.'
