begintemplate Local_Interneuron


public is_art
public init, topol, geom, biophys
public synlist_P, syn_ctrl, x, y, z, position, connect2target
public nclist_P

public soma

objref synlist_P          // list of INPUT synapses from various populations
objref nclist_P           // list of netcon's associated with above synapse lists
objref syn_ctrl           // synapse to control forced (evoked) and stochastic activations

create soma

proc init() {
    topol()
    geom()
    biophys()
    synlist_P = new List()
		nclist_P  = new List()
    synapses()  
    x = y = z = 0 // only change via position
}

proc topol() { local i
    soma {pt3dclear() pt3dadd(0, 0, 0, 1) pt3dadd(1, 0, 0, 1)}
}

proc geom() {
    soma {  
        L    = 20
        diam = 20
        nseg = 1 
    }
}

proc biophys() {
      
    soma {
        //HH channels: iNat and iK
        insert HH2 {
            gnabar_HH2 = 0.08
            gkbar_HH2  = 0.02
            vtraub_HH2 = -50.0
        }
        Ra = 150
        cm = 1         
        ek = -70.0
        insert pas {
            g_pas = 4.5e-5
            e_pas = -65.0
        } 
    }
}

proc position() { local i
    soma for i = 0, n3d()-1 {
        pt3dchange(i, $1-x+x3d(i), $2-y+y3d(i), $3-z+z3d(i), diam3d(i))
    }
    x = $1  y = $2  z = $3
}

obfunc connect2target() { localobj nc //$o1 target point process, optional $o2 returned NetCon
    soma nc = new NetCon(&v(1), $o1)
    nc.threshold = 0
    if (numarg() == 2) { $o2 = nc } // for backward compatibility
    return nc
}

objref syn_
proc synapses() {
		// P
    soma syn_ = new ComboSyn(0.5)
    syn_.ca_ratio = 0
		synlist_P.append(syn_)
		// Control
		soma syn_ctrl = new ExpSyn(0.5)
		syn_ctrl.e   = 0.0
		syn_ctrl.tau = 1.0}

func is_art() { return 0 }


endtemplate Local_Interneuron