• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python moose.exists函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中moose.exists函数的典型用法代码示例。如果您正苦于以下问题:Python exists函数的具体用法?Python exists怎么用?Python exists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了exists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: newModelDialogSlot

    def newModelDialogSlot(self):
        if self.popup is not None:
            self.popup.close()
        newModelDialog = DialogWidget()
        if newModelDialog.exec_():
            modelPath = str(newModelDialog.modelPathEdit.text()).strip()
            if len(modelPath) == 0:
                raise mexception.ElementNameError('Model path cannot be empty')
            if re.search('[ /]',modelPath) is not None:
                raise mexception.ElementNameError('Model path should not containe / or whitespace')
            plugin = str(newModelDialog.getcurrentRadioButton())
            if moose.exists(modelPath+'/model'):
                moose.delete(modelPath)

            modelContainer = moose.Neutral('%s' %(modelPath))
            modelRoot = moose.Neutral('%s/%s' %(modelContainer.path,"model"))
            if not moose.exists(modelRoot.path+'/info'):
                moose.Annotator(modelRoot.path+'/info')
            
            modelAnno = moose.element(modelRoot.path+'/info')
            modelAnno.modeltype = "new_kkit"
            modelAnno.dirpath = " "
            self.loadedModelsAction(modelRoot.path,plugin)
            self.setPlugin(plugin, modelRoot.path)
            self.objectEditSlot('/', False)
开发者ID:dilawar,项目名称:moose-gui,代码行数:25,代码来源:MWindow.py


示例2: create_population

def create_population(container, netparams, name_soma):
    netpath = container.path
    proto=[]
    neurXclass={}
    locationlist=[]
    #determine total number of neurons
    size,numneurons,vol=count_neurons(netparams)
    pop_percent=[]
    for neurtype in netparams.pop_dict.keys():
        if moose.exists(neurtype):
            proto.append(moose.element(neurtype))
            neurXclass[neurtype]=[]
            pop_percent.append(netparams.pop_dict[neurtype].percent)
    #create cumulative array of probabilities for selecting neuron type
    choicearray=np.cumsum(pop_percent)
    if choicearray[-1]<1.0:
        log.info("Warning!!!! fractional populations sum to {}",choicearray[-1])
    #array of random numbers that will be used to select neuron type
    rannum = np.random.uniform(0,choicearray[-1],numneurons)
    #Error check for last element in choicearray equal to 1.0
    log.info("numneurons= {} {} choicarray={}", size, numneurons, choicearray)
    log.debug("rannum={}", rannum)
    for i,xloc in enumerate(np.linspace(netparams.grid[0]['xyzmin'], netparams.grid[0]['xyzmax'], size[0])):
        for j,yloc in enumerate(np.linspace(netparams.grid[1]['xyzmin'], netparams.grid[1]['xyzmax'], size[1])):
            for k,zloc in enumerate(np.linspace(netparams.grid[2]['xyzmin'], netparams.grid[2]['xyzmax'], size[2])):
                #for each location in grid, assign neuron type, update soma location, add in spike generator
                neurnumber=i*size[2]*size[1]+j*size[2]+k
                neurtypenum=np.min(np.where(rannum[neurnumber]<choicearray))
                log.debug("i,j,k {} {} {} neurnumber {} type {}", i,j,k, neurnumber, neurtypenum)
                typename = proto[neurtypenum].name
                tag = '{}_{}'.format(typename, neurnumber)
                new_neuron=moose.copy(proto[neurtypenum],netpath, tag)
                neurXclass[typename].append(container.path + '/' + tag)
                comp=moose.element(new_neuron.path + '/'+name_soma)
                comp.x=i*xloc
                comp.y=j*yloc
                comp.z=k*zloc
                log.debug("x,y,z={},{},{} {}", comp.x, comp.y, comp.z, new_neuron.path)
                locationlist.append([new_neuron.name,comp.x,comp.y,comp.z])
                #spike generator - can this be done to the neuron prototype?
                spikegen = moose.SpikeGen(comp.path + '/spikegen')
                #should these be parameters in netparams?
                spikegen.threshold = 0.0
                spikegen.refractT=1e-3
                m = moose.connect(comp, 'VmOut', spikegen, 'Vm')
    #Create variability in neurons of network
    for neurtype in netparams.chanvar.keys():
        for chan,var in netparams.chanvar[neurtype].items():
            #single multiplier for Gbar for all the channels compartments
            if var>0:
                log.debug('adding variability to {} soma {}, variance: {}', neurtype,chan, var)
                GbarArray=abs(np.random.normal(1.0, var, len(neurXclass[neurtype])))
                for ii,neurname in enumerate(neurXclass[neurtype]):
                    soma_chan_path=neurname+'/'+name_soma+'/'+chan
                    if moose.exists(soma_chan_path):
                        chancomp=moose.element(soma_chan_path)
                        chancomp.Gbar=chancomp.Gbar*GbarArray[ii]
    #
    return {'location': locationlist,
            'pop':neurXclass}
开发者ID:neurord,项目名称:spspine,代码行数:60,代码来源:pop_funcs.py


示例3: mooseAddChemSolver

def mooseAddChemSolver(modelRoot, solver):
    """
    Add the solvers only if all are Chemical compartment
    """
    compts = moose.wildcardFind(modelRoot + '/##[ISA=ChemCompt]')
    if all(isinstance(x, (moose.CubeMesh,moose.CylMesh)) for x in compts):
        if not compts:
            return ("Atleast one compartment is required ")
        elif ( len(compts) > 3 ):
            return ("Warning: setSolverOnCompt Cannot handle " ,  len(compts) , " chemical compartments\n")

        else:
            comptinfo = moose.Annotator(moose.element(compts[0]).path + '/info')

            previousSolver = stdSolvertype(comptinfo.solver)
            currentSolver = stdSolvertype(solver)

            if previousSolver != currentSolver:
                comptinfo.solver = currentSolver
                if (moose.exists(compts[0].path + '/stoich')):
                    # "A: and stoich exists then delete the stoich add solver"
                    mooseDeleteChemSolver(modelRoot)
                setCompartmentSolver(modelRoot, currentSolver)
                return True
            else:
                if not moose.exists(compts[0].path + '/stoich'):
                    # " stoich exist, doing nothing"
                    setCompartmentSolver(modelRoot, currentSolver)
                    return True
    else:
        
        return ("mooseAddChemSolver is only for adding Chemical Model which has to be `CubeMesh` or `CylMesh` found ",list(set([x.className for x in compts]) - set(['CubeMesh',"CylMesh"])))
开发者ID:hrani,项目名称:moose-core,代码行数:32,代码来源:add_Delete_ChemicalSolver.py


示例4: createRecordingTable

    def createRecordingTable(self, element, field):
        """Create table to record `field` from element `element`

        Tables are created under `dataRoot`, the names are generally
        created by removing `/model` in the beginning of `elementPath`
        and replacing `/` with `_`. If this conflicts with an existing
        table, the id value of the target element (elementPath) is
        appended to the name.

        """
        if len(field) == 0 or ((element, field) in self._recordingDict):            
            return
        # The table path is not foolproof - conflict is
        # possible: e.g. /model/test_object and
        # /model/test/object will map to same table. So we
        # check for existing table without element field
        # path in recording dict.
        relativePath = element.path.partition('/model/')[-1]
        if relativePath.startswith('/'):
            relativePath = relativePath[1:]
        tablePath = self.dataRoot.path + '/' + relativePath.replace('/', '_') + '.' + field
        if moose.exists(tablePath):
            tablePath = '%s_%d' % (tablePath, element.id_.value)
        if not moose.exists(tablePath):            
            table = moose.Table(tablePath)
            print 'Created', table.path, 'for plotting', '%s.%s' % (element.path, field)
            target = element
            moose.connect(table, 'requestData', target, 'get_%s' % (field))
            self._recordingDict[(target, field)] = table
            self._reverseDict[table] = (target, field)
开发者ID:Vivek-sagar,项目名称:moose-1,代码行数:30,代码来源:default.py


示例5: 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


示例6: create_compartment

def create_compartment(path):
    comp = moose.Compartment(path)
    comp.diameter = soma_dia
    comp.Em = EREST_ACT + 10.613e-3
    comp.initVm = EREST_ACT
    sarea = np.pi * soma_dia * soma_dia
    comp.Rm = 1/(0.3e-3 * 1e4 * sarea)
    comp.Cm = 1e-6 * 1e4 * sarea
    if moose.exists('/library/na'):
        nachan = moose.element(moose.copy('/library/na', comp, 'na'))
    else:
        nachan = create_na_chan(comp.path)
    nachan.Gbar = 120e-3 * sarea * 1e4
    moose.showfield(nachan)
    moose.connect(nachan, 'channel', comp, 'channel')
    if moose.exists('/library/k'):
        kchan = moose.element(moose.copy('/library/k', comp, 'k'))
    else:
        kchan = create_k_chan(comp.path)
    kchan.Gbar = 36e-3 * sarea * 1e4
    moose.connect(kchan, 'channel', comp, 'channel')
    synchan = moose.SynChan(comp.path + '/synchan')
    synchan.Gbar = 1e-8
    synchan.tau1 = 2e-3
    synchan.tau2 = 2e-3
    synchan.Ek = 0.0
    m = moose.connect(comp, 'channel', synchan, 'channel')
    spikegen = moose.SpikeGen(comp.path + '/spikegen')
    spikegen.threshold = 0.0
    m = moose.connect(comp, 'VmOut', spikegen, 'Vm')
    return comp
开发者ID:dilawar,项目名称:moose-examples,代码行数:31,代码来源:compartment_net_no_array.py


示例7: buildModel

    def buildModel( self, modelPath ):
        if not moose.exists( '/library' ):
            library = moose.Neutral( '/library' )
        if moose.exists( modelPath ):
            print "rdesigneur::buildModel: Build failed. Model '", \
                modelPath, "' already exists."
            return
        self.model = moose.Neutral( modelPath )
        try:
            self.buildCellProto()
            self.buildChanProto()
            self.buildSpineProto()
            self.buildChemProto()
            # Protos made. Now install the elec and chem protos on model.
            self.installCellFromProtos()
            # Now assign all the distributions
            self.buildPassiveDistrib()
            self.buildChanDistrib()
            self.buildSpineDistrib()
            self.buildChemDistrib()
            self._configureSolvers()
            self.buildAdaptors()
            self._configureClocks()
            self._printModelStats()

        except BuildError, msg:
            print "Error: rdesigneur: model build failed: ", msg
            moose.delete( self.model )
开发者ID:DineshDevPandey,项目名称:moose,代码行数:28,代码来源:rdesigneur.py


示例8: checkFile_Obj_str

def checkFile_Obj_str(file_Obj_str):
    model = moose.element('/')
    loaded = False
    found = False
    if isinstance(file_Obj_str, str):
        if os.path.isfile(file_Obj_str) == True:
            model,loaded = loadModels(file_Obj_str)
            found = True
        elif file_Obj_str.find('/') != -1 :
            if not isinstance(file_Obj_str,moose.Neutral):
                if moose.exists(file_Obj_str):
                    model = file_Obj_str
                    loaded = True
                    found = True
        elif isinstance(file_Obj_str, moose.Neutral):
            if moose.exists(file_Obj_str.path):
                model = file_Obj_str.path
                loaded = True
                found = True
    elif isinstance(file_Obj_str, moose.Neutral):
        if moose.exists(file_Obj_str.path):
            model = file_Obj_str.path
            loaded = True
            found = True
    if not found:
        print ("%s path or filename doesnot exist. " % (file_Obj_str))
    return model,loaded
开发者ID:pgleeson,项目名称:moose-core,代码行数:27,代码来源:merge.py


示例9: create_hhcomp

def create_hhcomp(parent='/library', name='hhcomp', diameter=-30e-6, length=0.0):
    """Create a compartment with Hodgkin-Huxley type ion channels (Na and
    K).

    Returns a 3-tuple: (compartment, nachannel, kchannel)

    """
    comp, sarea = create_passive_comp(parent, name, diameter, length)
    if moose.exists('/library/na'):
        moose.copy('/library/na', comp.path, 'na')
    else:
        create_na_chan(parent=comp.path)
    na = moose.element('%s/na' % (comp.path))
    # Na-conductance 120 mS/cm^2
    na.Gbar = 120e-3 * sarea * 1e4 
    na.Ek = 115e-3 + EREST_ACT
    moose.connect(comp, 'channel', na, 'channel')
    if moose.exists('/library/k'):
        moose.copy('/library/k', comp.path, 'k')
    else:
        create_k_chan(parent=comp.path)
    k = moose.element('%s/k' % (comp.path))
    # K-conductance 36 mS/cm^2
    k.Gbar = 36e-3 * sarea * 1e4 
    k.Ek = -12e-3 + EREST_ACT
    moose.connect(comp, 'channel', k, 'channel')
    return comp, na, k
开发者ID:csiki,项目名称:MOOSE,代码行数:27,代码来源:hhcomp.py


示例10: deleteSolver

def deleteSolver(modelRoot):
	compts = moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]')
	for compt in compts:
		if moose.exists(compt.path+'/stoich'):
			st = moose.element(compt.path+'/stoich')
			st_ksolve = st.ksolve
			moose.delete(st)
			if moose.exists((st_ksolve).path):
				moose.delete(st_ksolve)
开发者ID:asiaszmek,项目名称:moose,代码行数:9,代码来源:setsolver.py


示例11: deleteSolver

def deleteSolver(modelRoot):
	if moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]'):
		compt = moose.wildcardFind(modelRoot+'/##[ISA=ChemCompt]')
		if ( moose.exists( compt[0].path+'/stoich' ) ):
			st = moose.element(compt[0].path+'/stoich')
			if moose.exists((st.ksolve).path):
				moose.delete(st.ksolve)
			moose.delete( compt[0].path+'/stoich' )
	for x in moose.wildcardFind( modelRoot+'/data/graph#/#' ):
                x.tick = -1
开发者ID:NeuroArchive,项目名称:moose,代码行数:10,代码来源:setsolver.py


示例12: dump_cell

 def dump_cell(self, file_path):
     """Dump the cell information compartment by compartment for
     comparison with NEURON in csv format. All parameters are
     converted to SI units."""
     with open(file_path, 'w') as dump_file:
         fieldnames = ["comp", "len", "dia", "sarea", "xarea", "Em", "Cm","Rm","Ra"]
         for chtype in channel_types:
             if chtype != 'cad':
                 fieldnames += ['e_' + chtype, 'gbar_' + chtype]
             else:
                 fieldnames += ['tau_' + chtype, 'beta_' + chtype]
         # print fieldnames
         writer = csv.DictWriter(dump_file, fieldnames=fieldnames, delimiter=',')
         writer.writeheader()
         comps = moose.wildcardFind('%s/##[TYPE=Compartment]' % (self.path))
         comps = sorted(comps, key=lambda x: int(x.name[0].rpartition('_')[-1]))            
         for comp_e in comps:
             comp = moose.element(comp_e)
             row = {}
             row['comp'] = comp.name
             row['len'] = comp.length
             row['dia'] = comp.diameter
             row['sarea'] = comp.length * comp.diameter * np.pi
             row['xarea'] = comp.diameter * comp.diameter * np.pi/4
             row['Em'] = comp.Em
             row['Cm'] = comp.Cm
             row['Rm'] = comp.Rm
             row['Ra'] = comp.Ra
             if moose.exists(comp.path + '/CaPool'):
                 ca_pool = moose.CaConc(comp.path + '/CaPool')
             for chtype in channel_types:
                 found = False
                 for chname in channel_type_dict[chtype]:
                     chpath = comp.path + '/' + chname
                     if moose.exists(chpath):
                         found = True
                         channel = moose.element(chpath)
                         if channel.className == 'HHChannel':
                             row['e_'+chtype] = channel.Ek
                             row['gbar_'+chtype] = channel.Gbar                        
                         elif channel.className == 'CaConc':
                             row['tau_cad'] = channel.tau
                             row['beta_cad'] = channel.B
                         break
                 if not found:
                     if chtype != 'cad':
                         row['e_'+chtype] = 0.0
                         row['gbar_'+chtype] = 0.0
                     else:
                         row['tau_cad'] = 0.0
                         row['beta_cad'] = 0.0
             writer.writerow(row)
开发者ID:BhallaLab,项目名称:moose-examples,代码行数:52,代码来源:cells.py


示例13: getModelAnnotation

def getModelAnnotation(obj, baseId, basepath):
    annotationNode = obj.getAnnotation()
    if annotationNode is not None:
        numchild = annotationNode.getNumChildren()
        for child_no in range(0, numchild):
            childNode = annotationNode.getChild(child_no)
            if (childNode.getPrefix() ==
                    "moose" and childNode.getName() == "ModelAnnotation"):
                num_gchildren = childNode.getNumChildren()
                for gchild_no in range(0, num_gchildren):
                    grandChildNode = childNode.getChild(gchild_no)
                    nodeName = grandChildNode.getName()
                    if (grandChildNode.getNumChildren() == 1):
                        baseinfo = moose.Annotator(baseId.path + '/info')
                        baseinfo.modeltype = "xml"
                        if nodeName == "runTime":
                            runtime = float(
                                (grandChildNode.getChild(0).toXMLString()))
                            baseinfo.runtime = runtime
                        if nodeName == "solver":
                            solver = (grandChildNode.getChild(0).toXMLString())
                            baseinfo.solver = solver
                        if(nodeName == "plots"):
                            plotValue = (
                                grandChildNode.getChild(0).toXMLString())
                            p = moose.element(baseId)
                            datapath = moose.element(baseId).path + "/data"
                            if not moose.exists(datapath):
                                datapath = moose.Neutral(baseId.path + "/data")
                                graph = moose.Neutral(
                                    datapath.path + "/graph_0")
                                plotlist = plotValue.split(";")
                                tablelistname = []
                                for plots in plotlist:
                                    plots = plots.replace(" ", "")
                                    plotorg = plots
                                    if( moose.exists(basepath.path + plotorg) and isinstance(moose.element(basepath.path+plotorg),moose.PoolBase)) :
                                        plotSId = moose.element(
                                            basepath.path + plotorg)
                                        # plotorg = convertSpecialChar(plotorg)
                                        plot2 = plots.replace('/', '_')
                                        plot3 = plot2.replace('[', '_')
                                        plotClean = plot3.replace(']', '_')
                                        plotName = plotClean + ".conc"
                                        fullPath = graph.path + '/' + \
                                            plotName.replace(" ", "")
                                        # If table exist with same name then
                                        # its not created
                                        if not fullPath in tablelistname:
                                            tab = moose.Table2(fullPath)
                                            tablelistname.append(fullPath)
                                            moose.connect(tab, "requestOut", plotSId, "getConc")
开发者ID:asiaszmek,项目名称:moose,代码行数:52,代码来源:readSBML.py


示例14: moosedeleteChemSolver

def moosedeleteChemSolver(modelRoot):
    """Delete solvers from Chemical Compartment

    """
    compts = moose.wildcardFind(modelRoot + '/##[ISA=ChemCompt]')
    for compt in compts:
        if moose.exists(compt.path + '/stoich'):
            st = moose.element(compt.path + '/stoich')
            st_ksolve = st.ksolve
            moose.delete(st)
            if moose.exists((st_ksolve).path):
                moose.delete(st_ksolve)
                print("Solver is deleted for modelpath %s " % modelRoot)
开发者ID:pgleeson,项目名称:moose-core,代码行数:13,代码来源:add_Delete_ChemicalSolver.py


示例15: addSpineProto

def addSpineProto(
    name="spine",
    parent="/library",
    RM=1.0,
    RA=1.0,
    CM=0.01,
    shaftLen=1.0e-6,
    shaftDia=0.2e-6,
    headLen=0.5e-6,
    headDia=0.5e-6,
    synList=(),
    chanList=(),
    caTau=0.0,
):
    assert moose.exists(parent), "%s must exist" % parent
    spine = moose.Neutral(parent + "/" + name)
    shaft = buildComptWrapper(spine, "shaft", shaftLen, shaftDia, 0.0, RM, RA, CM)
    head = buildComptWrapper(spine, "head", headLen, headDia, shaftLen, RM, RA, CM)
    moose.connect(shaft, "axial", head, "raxial")

    if caTau > 0.0:
        conc = moose.CaConc(head.path + "/Ca_conc")
        conc.tau = caTau
        conc.length = head.length
        conc.diameter = head.diameter
        conc.thick = 0.0
        # The 'B' field is deprecated.
        # B = 1/(ion_charge * Faraday * volume)
        # vol = head.length * head.diameter * head.diameter * PI / 4.0
        # conc.B = 1.0 / ( 2.0 * FaradayConst * vol )
        conc.Ca_base = 0.0
    for i in synList:
        syn = buildSyn(i[0], head, i[1], i[2], i[3], i[4], CM)
        if i[5] and caTau > 0.0:
            moose.connect(syn, "IkOut", conc, "current")
    for i in chanList:
        if moose.exists(parent + "/" + i[0]):
            chan = moose.copy(parent + "/" + i[0], head)
        else:
            moose.setCwe(head)
            chan = make_LCa()
            chan.name = i[0]
            moose.setCwe("/")
        chan.Gbar = i[1] * head.Cm / CM
        # print "CHAN = ", chan, chan.tick, chan.Gbar
        moose.connect(head, "channel", chan, "channel")
        if i[2] and caTau > 0.0:
            moose.connect(chan, "IkOut", conc, "current")
    transformNMDAR(parent + "/" + name)
    return spine
开发者ID:BhallaLab,项目名称:moose,代码行数:50,代码来源:rdesigneurProtos.py


示例16: _buildAdaptor

 def _buildAdaptor( self, meshName, elecRelPath, elecField, \
         chemRelPath, isElecToChem, offset, scale ):
     mesh = moose.element( '/model/chem/' + meshName )
     elecComptList = mesh.elecComptList
     if len( elecComptList ) == 0:
         raise BuildError( \
             "buildAdaptor: no elec compts in elecComptList on: " + \
             mesh.path )
     startVoxelInCompt = mesh.startVoxelInCompt
     endVoxelInCompt = mesh.endVoxelInCompt
     capField = elecField[0].capitalize() + elecField[1:]
     chemPath = mesh.path + '/' + chemRelPath
     if not( moose.exists( chemPath ) ):
         raise BuildError( \
             "Error: buildAdaptor: no chem obj in " + chemPath )
     chemObj = moose.element( chemPath )
     assert( chemObj.numData >= len( elecComptList ) )
     adName = '/adapt'
     for i in range( 1, len( elecRelPath ) ):
         if ( elecRelPath[-i] == '/' ):
             adName += elecRelPath[1-i]
             break
     ad = moose.Adaptor( chemObj.path + adName, len( elecComptList ) )
     print 'building ', len( elecComptList ), 'adaptors ', adName, \
            ' for: ', mesh.name, elecRelPath, elecField, chemRelPath
     av = ad.vec
     chemVec = moose.element( mesh.path + '/' + chemRelPath ).vec
 
     for i in zip( elecComptList, startVoxelInCompt, endVoxelInCompt, av ):
         i[3].inputOffset = 0.0
         i[3].outputOffset = offset
         i[3].scale = scale
         ePath = i[0].path + '/' + elecRelPath
         if not( moose.exists( ePath ) ):
             raise BuildError( \
                     "Error: buildAdaptor: no elec obj in " + ePath )
         elObj = moose.element( i[0].path + '/' + elecRelPath )
         if ( isElecToChem ):
             elecFieldSrc = 'get' + capField
             #print ePath, elecFieldSrc, scale
             moose.connect( i[3], 'requestOut', elObj, elecFieldSrc )
             for j in range( i[1], i[2] ):
                 moose.connect( i[3], 'output', chemVec[j], 'setConc')
         else:
             elecFieldDest = 'set' + capField
             for j in range( i[1], i[2] ):
                 moose.connect( i[3], 'requestOut', chemVec[j], 'getConc')
             moose.connect( i[3], 'output', elObj, elecFieldDest )
开发者ID:DineshDevPandey,项目名称:moose,代码行数:48,代码来源:rdesigneur.py


示例17: make_Na

def make_Na( name ):
    if moose.exists( '/library/' + name ):
        return
    Na = moose.HHChannel( '/library/' + name )
    Na.Ek = 0.055             #    V
    Na.Gbar = 300 * SOMA_A    #    S
    Na.Gk = 0                 #    S
    Na.Xpower = 2
    Na.Ypower = 1
    Na.Zpower = 0

    xgate = moose.element( Na.path + '/gateX' )
    xA = np.array( [ 320e3 * (0.0131 + EREST_ACT),
        -320e3, -1.0, -1.0 * (0.0131 + EREST_ACT), -0.004, 
        -280e3 * (0.0401 + EREST_ACT), 280e3, -1.0, 
        -1.0 * (0.0401 + EREST_ACT), 5.0e-3, 
        3000, -0.1, 0.05 ] )
    xgate.alphaParms = xA

    ygate = moose.element( Na.path + '/gateY' )
    yA = np.array( [ 128.0, 0.0, 0.0, -1.0 * (0.017 + EREST_ACT), 0.018,
        4.0e3, 0.0, 1.0, -1.0 * (0.040 + EREST_ACT), -5.0e-3, 
        3000, -0.1, 0.05 ] )
    ygate.alphaParms = yA
    return Na
开发者ID:hrani,项目名称:moose-core,代码行数:25,代码来源:rdesigneurProtos.py


示例18: main

def main():
    global synSpineList 
    global synDendList 
    numpy.random.seed( 1234 )
    rdes = buildRdesigneur( )
    for i in elecFileNames:
        print(i)
        rdes.cellProtoList = [ ['./cells/' + i, 'elec'] ]
        rdes.buildModel( )
        assert( moose.exists( '/model' ) )
        synSpineList = moose.wildcardFind( "/model/elec/#head#/glu,/model/elec/#head#/NMDA" )
        temp = set( moose.wildcardFind( "/model/elec/#/glu,/model/elec/#/NMDA" ) )

        synDendList = list( temp - set( synSpineList ) )
        moose.reinit()
        buildPlots( rdes )
        # Run for baseline, tetanus, and post-tetanic settling time 
        t1 = time.time()
        probeStimulus( baselineTime )
        tetanicStimulus( tetTime )
        probeStimulus( postTetTime )
        print(('real time = ', time.time() - t1))

        printPsd( i + ".fig5" )
        saveAndClearPlots( i + ".fig5" )
        moose.delete( '/model' )
        rdes.elecid = moose.element( '/' )
开发者ID:dilawar,项目名称:moose-examples,代码行数:27,代码来源:Fig5BCD.py


示例19: make_NMDA_Ca_conc

def make_NMDA_Ca_conc():
	if moose.exists( 'NMDA_Ca_conc' ):
		return
	NMDA_Ca_conc = moose.CaConc( 'NMDA_Ca_conc' )
	NMDA_Ca_conc.tau = 0.004   	# sec. Faster in spine than dend
	NMDA_Ca_conc.B = 17.402e12	# overridden by cellreader.
	NMDA_Ca_conc.Ca_base = 0.0
开发者ID:2pysarthak,项目名称:moose-examples,代码行数:7,代码来源:proto18.py


示例20: make_NMDA

def make_NMDA():
	if moose.exists( 'NMDA' ):
		return
	NMDA = moose.SynChan( 'NMDA' )
	NMDA.Ek = 0.0
	NMDA.tau1 = 20.0e-3
	NMDA.tau2 = 20.0e-3
	NMDA.Gbar = 5 * SOMA_A

	block = moose.MgBlock( '/library/NMDA/block' )
	block.CMg = 1.2		#	[Mg] in mM
	block.Zk = 2
	block.KMg_A = 1.0/0.28
	block.KMg_B = 1.0/62

	moose.connect( NMDA, 'channelOut', block, 'origChannel', 'OneToOne' )
	addmsg1 = moose.Mstring( '/library/NMDA/addmsg1' )
	addmsg1.value = '.. channel	./block	channel'
	#Here we want to also tell the cell reader to _remove_ the original
	#Gk, Ek term going from the channel to the compartment, as this is
	# now handled by the MgBlock.
	#addmsg2 = moose.Mstring( 'NMDA/addmsg2'
	#addmsg2.value = 'DropMsg	..	channel'
	addmsg3 = moose.Mstring( '/library/NMDA/addmsg3' )
	addmsg3.value = '.. VmOut	.	Vm'
开发者ID:2pysarthak,项目名称:moose-examples,代码行数:25,代码来源:proto18.py



注:本文中的moose.exists函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python moose.le函数代码示例发布时间:2022-05-27
下一篇:
Python moose.element函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap