/* In this experiment we want to compare the simulation speed of our model with other classical models of NMDA
*/
load_file("nrngui.hoc")
load_file("params.hoc")

//fully activates cache efficiency
cvode.cache_efficient(1)  

tstop = 4000
dt = .025
celsius = 23	//room temperature in Clarke08 experiment = ?
v_init = -65

// ------------------
create soma
access soma

//------------Voltage Clamp---------------------------	
objref vc

vc = new VClamp(.5)
	vc.dur[0] = tstop
	vc.amp[0] = 40
	
//---------------------------------------------------
objref sNMDA, stim, nc
{sNMDA = new Exp5NMDA(.5) SynWeight = 0.18532 } // Our Model 2012
//{sNMDA = new NMDA10_1(.5) SynWeight = 0.039071} // Kampa et al, 2004 model
//{sNMDA = new NMDA10_2(.5) SynWeight = 0.018831} // Vargas-Caballero & Robinson, 2004 model
//{sNMDA = new NMDA16(.5) SynWeight = 0.018831} // Vargas-Caballero & Robinson, 2004 model

stim = new NetStim(.5)
	stim.interval = 200		//ms (mean) time between spikes
	stim.number = 20		//(average) number of spikes
	stim.start 	= 1.53427 - 1	//ms (most likely) start time of first spike
	stim.noise 	= 0			//---- range 0 to 1. Fractional randomness.
	//0 deterministic, 1 intervals have negexp distribution.

nc = new NetCon(stim, sNMDA)

proc init_NMDA() {
	nc.weight = SynWeight
	nc.delay = 1
}
objref FinNMDA
FinNMDA = new FInitializeHandler(3,"init_NMDA()")

init()
//-------Graph----------------------	
// objref iNMDA, vSoma
// iNMDA = new Graph()
// iNMDA.size(0,tstop,-5.5,2.5)
// iNMDA.addvar("sNMDA.i",3,0)
// iNMDA.save_name("graphList[0].")
// graphList[0].append(iNMDA)

// vSoma = new Graph()
// vSoma.size(0,tstop,-100,50)
// vSoma.addvar("soma.v(.5)",3,0)
// vSoma.save_name("graphList[0].")
// graphList[0].append(vSoma)
//-------------------------------------

x = startsw()
for i=1, 10 {
	run()
}
print startsw() - x