本文整理汇总了Python中moose.connect函数的典型用法代码示例。如果您正苦于以下问题:Python connect函数的具体用法?Python connect怎么用?Python connect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了connect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: createFunction
def createFunction(fb,setpool,objB,objA):
fapath1 = fb.path.replace(objB,objA)
fapath = fapath1.replace('[0]','')
if not moose.exists(fapath):
# if fb.parent.className in ['CubeMesh','CyclMesh']:
# des = moose.Function('/'+objA+'/'+fb.parent.name+'/'+fb.name)
# elif fb.parent.className in ['Pool','ZombiePool','BufPool','ZombieBufPool']:
# for akey in list(poolListina[findCompartment(fb).name]):
# if fb.parent.name == akey.name:
# des = moose.Function(akey.path+'/'+fb.name)
des = moose.Function(fapath)
else:
des = moose.element(fapath)
inputB = moose.element(fb.path+'/x').neighbors["input"]
moose.connect(des, 'valueOut', moose.element(setpool),'setN' )
inputA = []
inputA = moose.element(fapath+'/x').neighbors["input"]
if not inputA:
for src in inputB:
pool = ((src.path).replace(objB,objA)).replace('[0]','')
numVariables = des.numVars
expr = ""
expr = (des.expr+'+'+'x'+str(numVariables))
expr = expr.lstrip("0 +")
expr = expr.replace(" ","")
des.expr = expr
moose.connect( pool, 'nOut', des.x[numVariables], 'input' )
开发者ID:pgleeson,项目名称:moose-core,代码行数:28,代码来源:merge.py
示例2: create_cell
def create_cell():
"""Create a single-compartment Hodgking-Huxley neuron with a
synaptic channel.
This uses the :func:`ionchannel.create_1comp_neuron` function for
model creation.
Returns a dict containing the neuron, the synchan and the
synhandler for accessing the synapse,
"""
neuron = create_1comp_neuron('/neuron')
#: SynChan for post synaptic neuron
synchan = moose.SynChan('/neuron/synchan')
synchan.Gbar = 1e-8
synchan.tau1 = 2e-3
synchan.tau2 = 2e-3
msg = moose.connect(neuron, 'channel', synchan, 'channel')
#: Create SynHandler to handle spike event input and set the
#: activation input of synchan
synhandler = moose.SimpleSynHandler('/neuron/synhandler')
synhandler.synapse.num = 1
synhandler.synapse[0].delay = 5e-3
moose.connect(synhandler, 'activationOut', synchan, 'activation')
return {'neuron': neuron,
'synchan': synchan,
'synhandler': synhandler}
开发者ID:2pysarthak,项目名称:moose-examples,代码行数:26,代码来源:randomspike.py
示例3: run
def run(nogui):
reader = NML2Reader(verbose=True)
filename = 'test_files/NML2_SingleCompHHCell.nml'
print('Loading: %s'%filename)
reader.read(filename, symmetric=True)
msoma = reader.getComp(reader.doc.networks[0].populations[0].id,0,0)
print(msoma)
data = moose.Neutral('/data')
pg = reader.getInput('pulseGen1')
inj = moose.Table('%s/pulse' % (data.path))
moose.connect(inj, 'requestOut', pg, 'getOutputValue')
vm = moose.Table('%s/Vm' % (data.path))
moose.connect(vm, 'requestOut', msoma, 'getVm')
simdt = 1e-6
plotdt = 1e-4
simtime = 300e-3
#moose.showmsg( '/clock' )
for i in range(8):
moose.setClock( i, simdt )
moose.setClock( 8, plotdt )
moose.reinit()
moose.start(simtime)
print("Finished simulation!")
t = np.linspace(0, simtime, len(vm.vector))
if not nogui:
import matplotlib.pyplot as plt
vfile = open('moose_v_hh.dat','w')
for i in range(len(t)):
vfile.write('%s\t%s\n'%(t[i],vm.vector[i]))
vfile.close()
plt.subplot(211)
plt.plot(t, vm.vector * 1e3, label='Vm (mV)')
plt.legend()
plt.title('Vm')
plt.subplot(212)
plt.title('Input')
plt.plot(t, inj.vector * 1e9, label='injected (nA)')
#plt.plot(t, gK.vector * 1e6, label='K')
#plt.plot(t, gNa.vector * 1e6, label='Na')
plt.legend()
plt.figure()
test_channel_gates()
plt.show()
plt.close()
开发者ID:hrani,项目名称:moose-core,代码行数:60,代码来源:run_hhcell.py
示例4: singleCompt
def singleCompt( name, params ):
mod = moose.copy( '/library/' + name + '/' + name, '/model' )
A = moose.element( mod.path + '/A' )
Z = moose.element( mod.path + '/Z' )
Z.nInit = 1
Ca = moose.element( mod.path + '/Ca' )
CaStim = moose.element( Ca.path + '/CaStim' )
runtime = params['preStimTime'] + params['stimWidth'] + params['postStimTime']
steptime = 100
CaStim.expr += ' + x2 * (t > ' + str( runtime ) + ' ) * ( t < ' + str( runtime + steptime ) + ' )'
print(CaStim.expr)
tab = moose.Table2( '/model/' + name + '/Atab' )
#for i in range( 10, 19 ):
#moose.setClock( i, 0.01 )
ampl = moose.element( mod.path + '/ampl' )
phase = moose.element( mod.path + '/phase' )
moose.connect( tab, 'requestOut', A, 'getN' )
ampl.nInit = params['stimAmplitude'] * 1
phase.nInit = params['preStimTime']
ksolve = moose.Ksolve( mod.path + '/ksolve' )
stoich = moose.Stoich( mod.path + '/stoich' )
stoich.compartment = mod
stoich.ksolve = ksolve
stoich.path = mod.path + '/##'
runtime += 2 * steptime
moose.reinit()
moose.start( runtime )
t = np.arange( 0, runtime + 1e-9, tab.dt )
return name, t, tab.vector
开发者ID:dilawar,项目名称:moose-examples,代码行数:32,代码来源:Fig2_v4.py
示例5: main
def main( runTime ):
try:
moose.delete('/acc92')
print("Deleted old model")
except Exception as e:
print("Could not clean. model not loaded yet")
moose.loadModel('acc92_caBuff.g',loadpath,'gsl')
ca = moose.element(loadpath+'/kinetics/Ca')
pr = moose.element(loadpath+'/kinetics/protein')
clockdt = moose.Clock('/clock').dts
moose.setClock(8, 0.1)#simdt
moose.setClock(18, 0.1)#plotdt
print clockdt
print " \t \t simdt ", moose.Clock('/clock').dts[8],"plotdt ",moose.Clock('/clock').dts[18]
ori = ca.concInit
tablepath = loadpath+'/kinetics/Ca'
tableele = moose.element(tablepath)
table = moose.Table2(tablepath+'.con')
x = moose.connect(table, 'requestOut', tablepath, 'getConc')
tablepath1 = loadpath+'/kinetics/protein'
tableele1 = moose.element(tablepath1)
table1 = moose.Table2(tablepath1+'.con')
x1 = moose.connect(table1, 'requestOut', tablepath1, 'getConc')
ca.concInit = ori
print("[INFO] Running for 4000 with Ca.conc %s " % ca.conc)
moose.start(4000)
ca.concInit = 5e-03
print("[INFO] Running for 20 with Ca.conc %s " % ca.conc)
moose.start(20)
ca.concInit = ori
moose.start( runTime ) #here give the interval time
ca.concInit = 5e-03
print("[INFO] Running for 20 with Ca.conc %s " % ca.conc)
moose.start(20)
ca.concInit = ori
print("[INFO] Running for 2000 with Ca.conc %s " % ca.conc)
moose.start(2000)
pylab.figure()
pylab.subplot(2, 1, 1)
t = numpy.linspace(0.0, moose.element("/clock").runTime, len(table.vector)) # sec
pylab.plot( t, table.vector, label="Ca Conc (interval- 8000s)" )
pylab.legend()
pylab.subplot(2, 1, 2)
t1 = numpy.linspace(0.0, moose.element("/clock").runTime, len(table1.vector)) # sec
pylab.plot( t1, table1.vector, label="Protein Conc (interval- 8000s)" )
pylab.legend()
pylab.savefig( os.path.join( dataDir, '%s_%s.png' % (table1.name, runTime) ) )
print('[INFO] Saving data to csv files in %s' % dataDir)
tabPath1 = os.path.join( dataDir, '%s_%s.csv' % (table.name, runTime))
numpy.savetxt(tabPath1, numpy.matrix([t, table.vector]).T, newline='\n')
tabPath2 = os.path.join( dataDir, '%s_%s.csv' % (table1.name, runTime) )
numpy.savetxt(tabPath2, numpy.matrix([t1, table1.vector]).T, newline='\n')
开发者ID:Ainurrohmah,项目名称:Scripts,代码行数:60,代码来源:run92_simple.py
示例6: main
def main():
""" This example illustrates loading, running of an SBML model defined in XML format.\n
The model 00001-sbml-l3v1.xml is taken from l3v1 SBML testcase.\n
Plots are setup.\n
Model is run for 20sec.\n
As a general rule we created model under '/path/model' and plots under '/path/graphs'.\n
"""
mfile = os.path.join( script_dir, 'chem_models/00001-sbml-l3v1.xml')
runtime = 20.0
# Loading the sbml file into MOOSE, models are loaded in path/model
sbmlId = moose.readSBML(mfile,'sbml')
s1 = moose.element('/sbml/model/compartment/S1')
s2= moose.element('/sbml/model/compartment/S2')
# Creating MOOSE Table, Table2 is for the chemical model
graphs = moose.Neutral( '/sbml/graphs' )
outputs1 = moose.Table2 ( '/sbml/graphs/concS1')
outputs2 = moose.Table2 ( '/sbml/graphs/concS2')
# connect up the tables
moose.connect( outputs1,'requestOut', s1, 'getConc' );
moose.connect( outputs2,'requestOut', s2, 'getConc' );
# Reset and Run
moose.reinit()
moose.start(runtime)
开发者ID:2pysarthak,项目名称:moose-core-personal,代码行数:31,代码来源:test_sbml_support.py
示例7: setup_model
def setup_model(model_path, synapse_locations, passive=False, solver='hsolve'):
"""Set up a single cell model under `model_path` with synapses
created in the compartments listed in `synapse_locations`.
`model_path` - location where the model should be created.
`synapse_locations`: compartment names for the synapses.
"""
cell = moose.copy(make_prototype(passive), model_path)
if solver.lower() == 'hsolve':
hsolve = moose.HSolve( '%s/solve' % (cell.path))
hsolve.dt = simdt
hsolve.target = cell.path
syninfo_list = []
for compname in synapse_locations:
comppath = '%s/%s' % (cell.path, compname)
print('1111 Creating synapse in', comppath)
compartment = moose.element(comppath)
syninfo = make_synapse(compartment)
syninfo_list.append(syninfo)
# connect pulse stimulus
stim_path = '%s/%s/stim' % (cell.path, compname)
print('2222 Creating stimuls in', stim_path)
stim = moose.PulseGen(stim_path)
moose.connect(stim, 'output', syninfo['spike'], 'Vm')
syninfo['stimulus'] = stim
return {'neuron': cell,
'syninfo': syninfo_list}
开发者ID:hrani,项目名称:moose-core,代码行数:30,代码来源:rc19.py
示例8: make_synapse
def make_synapse(path):
"""Create a synapse with two time constants."""
syn = moose.SynChan(path)
syn.tau1 = 5.0 # ms
syn.tau2 = 1.0 # ms
syn.Gbar = 1.0 # mS
syn.Ek = 0.0
synsh = moose.SimpleSynHandler( path + '/sh' )
synsh.synapse.num = 1
# syn.bufferTime = 1.0 # ms
synsh.synapse.delay = 1.0
synsh.synapse.weight = 1.0
print(('Synapses:', len(synsh.synapse), 'w=', synsh.synapse[0].weight))
spikegen = moose.SpikeGen('%s/spike' % (syn.parent.path))
spikegen.edgeTriggered = False # Make it fire continuously when input is high
spikegen.refractT = 10.0 # With this setting it will fire at 1 s / 10 ms = 100 Hz
spikegen.threshold = 0.5
# This will send alternatind -1 and +1 to SpikeGen to make it fire
spike_stim = moose.PulseGen('%s/spike_stim' % (syn.parent.path))
spike_stim.delay[0] = 50.0
spike_stim.level[0] = 1.0
spike_stim.width[0] = 100.0
moose.connect(spike_stim, 'output', spikegen, 'Vm')
m = moose.connect(spikegen, 'spikeOut', synsh.synapse[0], 'addSpike')
return syn, spikegen
开发者ID:dilawar,项目名称:moose-examples,代码行数:25,代码来源:Izhikevich_with_synapse.py
示例9: main
def main():
######## Put your favourite cell model here ######
##This one is from PMID 22730554: Suo et al J. Mol Cell Biol 2012
filename = 'cells/ko20x-07.CNG.swc'
moose.Neutral( '/library' )
rdes = rd.rdesigneur( \
cellProto = [[ filename, 'elec' ] ],\
passiveDistrib = passiveDistrib_,
chanProto = chanProto_,
chanDistrib = chanDistrib_
)
rdes.buildModel( '/model' )
moose.reinit()
################## Now we store plots ########################
somaVm = moose.Table( '/somaVm' )
moose.connect( somaVm, 'requestOut', rdes.soma, 'getVm' )
################## Now we set up the display ########################
compts = moose.wildcardFind( "/model/elec/#[ISA=CompartmentBase]" )
compts[0].inject = inject
print("Setting Up 3D Display")
app = QtGui.QApplication(sys.argv)
vm_viewer = create_vm_viewer(rdes, somaVm)
vm_viewer.show()
vm_viewer.start()
return app.exec_()
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:27,代码来源:Fig2E.py
示例10: _addSpine
def _addSpine( self, parent, spineProto, pos, angle, x, y, z, size, k ):
spine = moose.copy( spineProto, parent.parent, 'spine' + str(k) )
kids = spine[0].children
coords = []
ppos = np.array( [parent.x0, parent.y0, parent.z0] )
for i in kids:
#print i.name, k
j = i[0]
j.name += str(k)
#print 'j = ', j
coords.append( [j.x0, j.y0, j.z0] )
coords.append( [j.x, j.y, j.z] )
self._scaleSpineCompt( j, size )
moose.move( i, self.elecid )
origin = coords[0]
#print 'coords = ', coords
# Offset it so shaft starts from surface of parent cylinder
origin[0] -= parent.diameter / 2.0
coords = np.array( coords )
coords -= origin # place spine shaft base at origin.
rot = np.array( [x, [0,0,0], [0,0,0]] )
coords = np.dot( coords, rot )
moose.delete( spine )
moose.connect( parent, "raxial", kids[0], "axial" )
self._reorientSpine( kids, coords, ppos, pos, size, angle, x, y, z )
开发者ID:DineshDevPandey,项目名称:moose,代码行数:25,代码来源:rdesigneur.py
示例11: create_squid
def create_squid():
"""Create a single compartment squid model."""
parent = moose.Neutral ('/n' )
compt = moose.Compartment( '/n/compt' )
Em = EREST_ACT + 10.613e-3
compt.Em = Em
compt.initVm = EREST_ACT
compt.Cm = 7.85e-9
compt.Rm = 4.2e5
compt.Ra = 7639.44e3
nachan = moose.HHChannel( '/n/compt/Na' )
nachan.Xpower = 3
xGate = moose.HHGate(nachan.path + '/gateX')
xGate.setupAlpha(Na_m_params +
[VDIVS, VMIN, VMAX])
nachan.Ypower = 1
yGate = moose.HHGate(nachan.path + '/gateY')
yGate.setupAlpha(Na_h_params +
[VDIVS, VMIN, VMAX])
nachan.Gbar = 0.942e-3
nachan.Ek = 115e-3+EREST_ACT
moose.connect(nachan, 'channel', compt, 'channel', 'OneToOne')
kchan = moose.HHChannel( '/n/compt/K' )
kchan.Xpower = 4.0
xGate = moose.HHGate(kchan.path + '/gateX')
xGate.setupAlpha(K_n_params +
[VDIVS, VMIN, VMAX])
kchan.Gbar = 0.2836e-3
kchan.Ek = -12e-3+EREST_ACT
moose.connect(kchan, 'channel', compt, 'channel', 'OneToOne')
return compt
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:32,代码来源:HsolveInstability.py
示例12: make_spiny_compt
def make_spiny_compt(root_path, number,synInput):
comptLength = 100e-6
comptDia = 4e-6
numSpines = Number_Of_Spines
cell = moose.Neutral (root_path+"/cell"+str(number))
compt = create_squid(cell)
compt.inject = INJECT_CURRENT
compt.x0 = 0
compt.y0 = 0
compt.z0 = 0
compt.x = comptLength
compt.y = 0
compt.z = 0
compt.length = comptLength
compt.diameter = comptDia
for i in range( numSpines ):
r = create_spine_with_receptor( compt, cell, i, i/float(numSpines) )
r.synapse.num = 1
syn = moose.element( r.path + '/synapse' )
moose.connect( synInput, 'spikeOut', syn, 'addSpike', 'Single' )
syn.weight = 0.2
syn.delay = i * 1.0e-4
"""
开发者ID:saeedsh,项目名称:PN2S,代码行数:25,代码来源:testSpike.py
示例13: test_crossing_single
def test_crossing_single():
"""This function creates an ematrix of two PulseGen elements and
another ematrix of two Table elements.
The two pulsegen elements have same amplitude but opposite phase.
Table[0] is connected to PulseGen[1] and Table[1] to Pulsegen[0].
In the plot you should see two square pulses of opposite phase.
"""
size = 2
pg = moose.PulseGen('pulsegen', size)
for ix, ii in enumerate(pg.vec):
pulse = moose.element(ii)
pulse.delay[0] = 1.0
pulse.width[0] = 2.0
pulse.level[0] = (-1)**ix
tab = moose.Table('table', size)
moose.connect(tab.vec[0], 'requestOut', pg.vec[1], 'getOutputValue', 'Single')
moose.connect(tab.vec[1], 'requestOut', pg.vec[0], 'getOutputValue', 'Single')
print 'Neighbors:'
for t in tab.vec:
print t.path
for n in moose.element(t).neighbors['requestOut']:
print 'requestOut <-', n.path
moose.setClock(0, 0.1)
moose.useClock(0, '/##', 'process')
moose.start(5)
for ii in tab.vec:
t = moose.Table(ii).vector
print len(t)
pylab.plot(t)
pylab.show()
开发者ID:csiki,项目名称:MOOSE,代码行数:34,代码来源:singlemsgcross.py
示例14: create_population
def create_population(container, size):
"""Create a population of `size` single compartmental neurons with Na+
and K+ channels. Also create SpikeGen objects and SynChan objects
connected to these which can act as plug points for setting up
synapses later.
This uses ..ref::`ionchannel.create_1comp_neuron`.
"""
path = container.path
print path, size, type(path)
comps = create_1comp_neuron("{}/neuron".format(path), number=size)
synpath = path + "/synchan"
print synpath, size, type(size)
synchan = moose.vec(synpath, n=size, dtype="SynChan")
synchan.Gbar = 1e-8
synchan.tau1 = 2e-3
synchan.tau2 = 2e-3
m = moose.connect(comps, "channel", synchan, "channel", "OneToOne")
synhandler = moose.vec("{}/synhandler".format(path), n=size, dtype="SimpleSynHandler")
moose.connect(synhandler, "activationOut", synchan, "activation", "OneToOne")
spikegen = moose.vec("{}/spikegen".format(path), n=size, dtype="SpikeGen")
spikegen.threshold = 0.0
m = moose.connect(comps, "VmOut", spikegen, "Vm", "OneToOne")
return {"compartment": comps, "spikegen": spikegen, "synchan": synchan, "synhandler": synhandler}
开发者ID:BhallaLab,项目名称:moose,代码行数:25,代码来源:compartment_net.py
示例15: make_spiny_compt
def make_spiny_compt():
comptLength = 100e-6
comptDia = 4e-6
numSpines = 5
compt = create_squid()
compt.inject = 1e-7
compt.x0 = 0
compt.y0 = 0
compt.z0 = 0
compt.x = comptLength
compt.y = 0
compt.z = 0
compt.length = comptLength
compt.diameter = comptDia
synInput = moose.SpikeGen( '/n/compt/synInput' )
synInput.refractT = 47e-3
synInput.threshold = -1.0
synInput.edgeTriggered = 0
synInput.Vm( 0 )
cell = moose.element( '/n' )
for i in range( numSpines ):
r = create_spine_with_receptor( compt, cell, i, i/float(numSpines) )
r.synapse.num = 1
syn = moose.element( r.path + '/synapse' )
moose.connect( synInput, 'spikeOut', syn, 'addSpike', 'Single' )
syn.weight = 0.2
syn.delay = i * 1.0e-4
"""
开发者ID:csiki,项目名称:MOOSE,代码行数:28,代码来源:testHsolve.py
示例16: creaetHHComp
def creaetHHComp(parent='/library', name='hhcomp', diameter=1e-6, length=1e-6):
"""Create a compartment with Hodgkin-Huxley type ion channels (Na and
K).
Returns a 3-tuple: (compartment, nachannel, kchannel)
"""
compPath = '{}/{}'.format(parent, name)
mc = MooseCompartment( compPath, length, diameter, {})
c = mc.mc_
sarea = mc.surfaceArea
if moose.exists('/library/na'):
moose.copy('/library/na', c.path, 'na')
else:
create_na_chan(parent = c.path)
na = moose.element('%s/na' % (c.path))
# Na-conductance 120 mS/cm^2
na.Gbar = 120e-3 * sarea * 1e4
na.Ek = 115e-3 + EREST_ACT
moose.connect(c, 'channel', na, 'channel')
if moose.exists('/library/k'):
moose.copy('/library/k', c.path, 'k')
else:
create_k_chan(parent = c.path)
k = moose.element('%s/k' % (c.path))
# K-conductance 36 mS/cm^2
k.Gbar = 36e-3 * sarea * 1e4
k.Ek = -12e-3 + EREST_ACT
moose.connect(c, 'channel', k, 'channel')
return (c, na, k)
开发者ID:hrani,项目名称:moose-core,代码行数:35,代码来源:moose_sim.py
示例17: create_squid
def create_squid(parent):
"""Create a single compartment squid model."""
soma = moose.SymCompartment(parent.path + '/soma')
Em = EREST_ACT + 10.613e-3
soma.Em = Em
soma.initVm = EREST_ACT
soma.Cm = 7.85e-9 * 0.5
soma.Rm = 4.2e5 * 5.0
soma.Ra = 7639.44e3
nachan = moose.HHChannel(parent.path + '/soma/Na')
nachan.Xpower = 3
xGate = moose.HHGate(nachan.path + '/gateX')
xGate.setupAlpha(Na_m_params + [VDIVS, VMIN, VMAX])
# This is important: one can run without it but the output will diverge.
xGate.useInterpolation = 1
nachan.Ypower = 1
yGate = moose.HHGate(nachan.path + '/gateY')
yGate.setupAlpha(Na_h_params + [VDIVS, VMIN, VMAX])
yGate.useInterpolation = 1
nachan.Gbar = 0.942e-3
nachan.Ek = 115e-3 + EREST_ACT
moose.connect(nachan, 'channel', soma, 'channel', 'OneToOne')
kchan = moose.HHChannel(parent.path + '/soma/K')
kchan.Xpower = 4.0
xGate = moose.HHGate(kchan.path + '/gateX')
xGate.setupAlpha(K_n_params + [VDIVS, VMIN, VMAX])
xGate.useInterpolation = 1
kchan.Gbar = 0.2836e-3
kchan.Ek = -12e-3 + EREST_ACT
moose.connect(kchan, 'channel', soma, 'channel', 'OneToOne')
return soma
开发者ID:saeedsh,项目名称:PN2S,代码行数:32,代码来源:network.py
示例18: createSquid
def createSquid():
"""Create a single compartment squid model."""
parent = moose.Neutral ('/n' )
elec = moose.Neutral ('/n/elec' )
compt = moose.SymCompartment( '/n/elec/compt' )
Em = EREST_ACT + 10.613e-3
compt.Em = Em
compt.initVm = EREST_ACT
compt.Cm = 7.85e-9 * 0.5
compt.Rm = 4.2e5 * 5.0
compt.Ra = 7639.44e3
compt.length = 100e-6
compt.diameter = 4e-6
nachan = moose.HHChannel( '/n/elec/compt/Na' )
nachan.Xpower = 3
xGate = moose.HHGate(nachan.path + '/gateX')
xGate.setupAlpha(Na_m_params + [VDIVS, VMIN, VMAX])
xGate.useInterpolation = 1
nachan.Ypower = 1
yGate = moose.HHGate(nachan.path + '/gateY')
yGate.setupAlpha(Na_h_params + [VDIVS, VMIN, VMAX])
yGate.useInterpolation = 1
nachan.Gbar = 0.942e-3
nachan.Ek = 115e-3+EREST_ACT
moose.connect(nachan, 'channel', compt, 'channel', 'OneToOne')
kchan = moose.HHChannel( '/n/elec/compt/K' )
kchan.Xpower = 4.0
xGate = moose.HHGate(kchan.path + '/gateX')
xGate.setupAlpha(K_n_params + [VDIVS, VMIN, VMAX])
xGate.useInterpolation = 1
kchan.Gbar = 0.2836e-3
kchan.Ek = -12e-3+EREST_ACT
moose.connect(kchan, 'channel', compt, 'channel', 'OneToOne')
return compt
开发者ID:asiaszmek,项目名称:moose,代码行数:35,代码来源:cubeMeshSigNeur.py
示例19: loadModel
def loadModel(filename, chanProto, chanDistrib, passiveDistrib):
"""Load the model and insert channels """
global modelName
global nchans, ncompts
# Load in the swc file.
modelName = "elec"
cellProto = [ ( filename, modelName ) ]
rdes = rd.rdesigneur( cellProto = cellProto
, combineSegments = True
, passiveDistrib = passiveDistrib
, chanProto = chanProto
, chanDistrib = chanDistrib
)
rdes.buildModel('/model')
compts = moose.wildcardFind( "/model/%s/#[ISA=CompartmentBase]"%modelName )
setupStimuls( compts[0] )
for compt in compts:
vtab = moose.Table( '%s/vm' % compt.path )
moose.connect( vtab, 'requestOut', compt, 'getVm' )
_records[compt.path] = vtab
nchans = len(set([x.path for x in
moose.wildcardFind('/model/elec/##[TYPE=ZombieHHChannel]')])
)
_logger.info("Total channels: %s" % nchans)
return _records
开发者ID:BhallaLab,项目名称:benchmarks,代码行数:30,代码来源:loader_moose.py
示例20: make_synapses
def make_synapses(spikegen, synchan, delay=5e-3):
"""
Create synapses from spikegens to synchans in a manner similar to
OneToAll connection.
spikegen: list of spikegen objects
These are sources of synaptic event messages.
synchan: list of synchan objects
These are the targets of the synaptic event messages.
delay: mean delay of synaptic transmission.
Individual delays are normally distributed with sd=0.1*mean.
"""
scount = len(spikegen)
for ii, sid in enumerate(synchan):
s = moose.SynChan(sid)
sh = moose.SimpleSynHandler( sid.path + "/synh" )
moose.connect( sh, "activationOut", s, "activation" )
sh.synapse.num = scount
delay_list = np.random.normal(delay, delay*0.1, scount)
# print delay_list
for jj in range(scount):
sh.synapse[jj].delay = delay_list[jj]
# Connect all spikegens to this synchan except that from
# same compartment - we assume if parents are same the two belong to the same compartment
if s.parent.path != spikegen[jj].parent.path:
m = moose.connect(spikegen[jj], 'spikeOut', moose.element(sh.path + '/synapse'), 'addSpike')
开发者ID:dilawar,项目名称:moose-examples,代码行数:29,代码来源:compartment_net_no_array.py
注:本文中的moose.connect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论