Exemple #1
0
def extract_and_add_capool(model, comp, pools):
    params = model.CaPlasticityParams
    shape = distance_mapping(params.ShapeConfig, comp)
    OuterShellThick = shape.OutershellThickness
    BufCapacity = distance_mapping(params.BufferCapacityDensity, comp)

    pool = addCaPool(model, OuterShellThick, BufCapacity, comp, pools)

    return pool
Exemple #2
0
def extract_and_add_difshell(model, shellMode, comp,spine):
    params = model.CaPlasticityParams

    Pumps = {}
    for pump in params.PumpVmaxDensities.keys():
        Pumps[pump] = distance_mapping(params.PumpVmaxDensities[pump], comp)

    Buffers = distance_mapping(params.BufferDensity,comp)
    shape = distance_mapping(params.ShapeConfig,comp)
    shellsparams = CalciumConfig(shellMode=shellMode,increase_mode=shape.ThicknessIncreaseMode,outershell_thickness=shape.OutershellThickness,thickness_increase=shape.ThicknessIncreaseFactor, min_thickness=shape.MinThickness)

    dshells_dend = addDifMachineryToComp(model,comp,Buffers,Pumps,shellsparams,spine)

    return dshells_dend
Exemple #3
0
def extract_and_add_capool(model,comp,pools):
    params = model.CaPlasticityParams
    shape = distance_mapping(params.ShapeConfig,comp)
    OuterShellThick = shape.OutershellThickness
    BufCapacity = distance_mapping(params.BufferCapacityDensity,comp)
    if hasattr(params,'Taus'):
        tau = distance_mapping(params.Taus,comp)
        tauScale = params.tauScale
    else:
        tau = params.CalciumParams.tau
        tauScale = None
    pool = addCaPool(model,OuterShellThick,BufCapacity,comp, pools,tau=tau,tauScale=tauScale)

    return pool
Exemple #4
0
def addCalcium(model,ntype):
    pools = CaProto(model)
    capool = []
    params = model.CaPlasticityParams
    for comp in moose.wildcardFind(ntype + '/#[TYPE=Compartment]'):
        if NAME_NECK not in comp.name and NAME_HEAD not in comp.name: #Look for spines connected to the dendrite
            shellMode = distance_mapping(params.CaShellModeDensity,comp)
            dshells_dend = add_calcium_to_compartment(model, shellMode, comp, pools,capool,spine=False)
            if dshells_dend == -1:
                return

            if model.spineYN:
                spines = []
                neighbors = list(comp.neighbors['raxial'])
                neighbors.extend(list(comp.neighbors['axial']))
                for neighbor in neighbors:
                    if NAME_NECK in neighbor.name:
                        spines.append(neighbor)
                    else:
                        'Could not find spines!!!'
                for sp in spines:

                    shellMode = distance_mapping(params.CaShellModeDensity,moose.element(sp))
                    dshells_neck = add_calcium_to_compartment(model,shellMode,moose.element(sp),pools,capool,spine=True)
                    if dshells_neck == -1:
                        return
                    if dshells_dend and dshells_neck: #diffusion between neck and dendrite
                        moose.connect(dshells_neck[-1],"outerDifSourceOut",dshells_dend[0],"fluxFromOut")
                        moose.connect(dshells_dend[0],"innerDifSourceOut",dshells_neck[-1],"fluxFromIn")
                    heads = []
                    neighbors = list(moose.element(sp).neighbors['raxial'])
                    neighbors.extend(list(moose.element(sp).neighbors['axial']))
                    for neighbor in neighbors:
                        if NAME_HEAD in neighbor.name:
                            heads.append(neighbor)

                    if not heads:
                        'Could not find heads!!!'
                    for head in heads:
                        shellMode =  distance_mapping(params.CaShellModeDensity,moose.element(head))
                        dshells_head = add_calcium_to_compartment(model,shellMode,moose.element(head),pools,capool,spine=True)
                        if dshells_head == -1:
                            return
                        if dshells_head and dshells_neck: #diffusion between neck and dendrite
                            moose.connect(dshells_head[-1],"outerDifSourceOut",dshells_neck[0],"fluxFromOut")
                            moose.connect(dshells_neck[0],"innerDifSourceOut",dshells_head[-1],"fluxFromIn")

    return capool
Exemple #5
0
def fix_calcium(neurontypes, model):
    """kluge to fix buffer capacity in CaPool

    Initiating hsolve calculates CaConc.B from thickness, length,
    diameter; ignores buffer capacity.
    """

    comptype = 'ZombieCompartment'
    cacomptype = 'ZombieCaConc'
    ca_elem_suffix = model.CaPlasticityParams.CalciumParams.CaName
    buffer_capacity_density = model.CaPlasticityParams.BufferCapacityDensity

    log.info('Fixing calcium buffer capacity for {} elements'.format(comptype))

    for ntype in neurontypes:
        for comp in moose.wildcardFind('{}/#[TYPE={}]'.format(ntype, comptype)):
            cacomps = [m for m in moose.element(comp).children if m.className==cacomptype]
            for cacomp in cacomps:

                buf_capacity = distance_mapping(buffer_capacity_density, comp)
                radius = cacomp.diameter/2.
                if cacomp.thick > radius:
                    cacomp.thick = radius
                if cacomp.length:
                    vol = np.pi * cacomp.length * (radius**2 - (radius-cacomp.thick)**2)

                else:
                    vol = 4. / 3. * np.pi * ((cacomp.diameter / 2) ** 3 - (cacomp.diameter / 2 - cacomp.thick) ** 3)
                cacomp.B = 1. / (constants.Faraday * vol * 2) / buf_capacity # volume correction
Exemple #6
0
def create_neuron(model, ntype, ghkYN):
    p_file = find_morph_file(model,ntype)
    try:
        cellproto=moose.loadModel(p_file, ntype)
    except IOError:
        print('could not load model from {!r}'.format(p_file))
        raise
    #######channels
    Cond = model.Condset[ntype]
    for comp in moose.wildcardFind('{}/#[TYPE=Compartment]'.format(ntype)):
        #If we are using GHK, just create one GHK per compartment, connect it to comp
        #calcium concentration is connected in a different function
        if ghkYN:
            ghkproto=moose.element('/library/ghk')
            ghk=moose.copy(ghkproto,comp,'ghk')[0]
            moose.connect(ghk,'channel',comp,'channel')
        else:
            ghk=[]
        for channame in Cond.keys():
            c = _util.distance_mapping(Cond[channame], comp)
            if c > 0:
                log.debug('Testing Cond If {} {}', channame, c)
                calciumPermeable = model.Channels[channame].calciumPermeable
                add_channel.addOneChan(channame, c, comp, ghkYN, ghk, calciumPermeable=calciumPermeable)

        #Compensate for actual, experimentally estimated spine density.
        #This gives a model that can be simulated with no explicit spines or
        #any number of explicitly modeled spines up to the actual spine density:
        spines.compensate_for_spines(model,comp,model.param_cond.NAME_SOMA)

    return cellproto
Exemple #7
0
def create_synpath_array(allsyncomp_list,syntype,NumSyn,prob=None):
    #list of possible synapses with connection probability, which takes into account prior creation of synapses
    syncomps=[]
    totalsyns=0
    print('CONNECT: syntype:', syntype, 'prob',prob)
    for syncomp in allsyncomp_list:
        dist,nm=util.get_dist_name(syncomp.parent)
        if prob: #calculate dendritic distance dependent connection probability to store with table
            dist_prob=dendritic_distance_dep_connect_prob(prob,dist)
        else:
            dist_prob=1
        #print('syncomp',syncomp,'dist',dist,'prob',dist_prob)
        if dist_prob>0: #only add synchan to list if connection probability is non-zero
            sh=moose.element(syncomp.path+'/SH')
            # TODO: Fix for synapses on spines; there should only be 1 per spine
            if NAME_HEAD in nm:
                SynPerComp = 1 #- sh.numSynapses
            else:
                SynPerComp = util.distance_mapping(NumSyn[syntype], dist)#-sh.numSynapses
            for i in range(SynPerComp):
                totalsyns+=dist_prob #totalsyns=total synapses to connect
                if i < SynPerComp - sh.numSynapses:
                    syncomps.append([syncomp.path+'/SH',dist_prob])
                    #print('{} synapses already connected of {} total synapses, adding 1 synapse with {} dist_prob to list'.format(sh.numSynapses,SynPerComp,dist_prob))
                else:
                    syncomps.append([syncomp.path+'/SH',0])
                    #print('{} synapses already connected of {} total synapses, adding 1 synapse with 0 dist_prob to list'.format(sh.numSynapses,SynPerComp))

    #normalize probability to pdf
    syncomp_sum = sum([p[1] for p in syncomps])
    print('CONNECT: totsyns:',totalsyns,'syncomp_sum',syncomp_sum)
    for syn in syncomps:
        syn[1]=float(syn[1])/syncomp_sum
    avail_syns=np.int(np.round(syncomp_sum))
    return syncomps,totalsyns,avail_syns
Exemple #8
0
def fix_calcium(neurontypes, model):
    """kluge to fix buffer capacity in CaPool

    Initiating hsolve calculates CaConc.B from thickness, length,
    diameter; ignores buffer capacity.
    """

    comptype = 'ZombieCompartment'
    cacomptype = 'ZombieCaConc'
    ca_elem_suffix = model.CaPlasticityParams.CalciumParams.CaName
    buffer_capacity_density = model.CaPlasticityParams.BufferCapacityDensity

    log.info('Fixing calcium buffer capacity for {} elements'.format(comptype))

    for ntype in neurontypes:
        for comp in moose.wildcardFind('{}/#[TYPE={}]'.format(ntype,
                                                              comptype)):
            cacomps = [
                m for m in moose.element(comp).children
                if m.className == cacomptype
            ]
            for cacomp in cacomps:

                buf_capacity = distance_mapping(buffer_capacity_density, comp)
                if cacomp.length:
                    vol = np.pi * cacomp.diameter * cacomp.thick * cacomp.length
                else:
                    vol = 4. / 3. * np.pi * (
                        (cacomp.diameter / 2)**3 -
                        (cacomp.diameter / 2 - cacomp.thick)**3)
                cacomp.B = 1. / (constants.Faraday * vol *
                                 2) / buf_capacity  # volume correction
Exemple #9
0
def extract_and_add_difshell(model, shellMode, comp, spine):
    params = model.CaPlasticityParams

    Pumps = distance_mapping(params.PumpDensity, comp)

    Buffers = distance_mapping(params.BufferDensity, comp)
    shape = distance_mapping(params.ShapeConfig, comp)
    shellsparams = CalciumConfig(
        shellMode=shellMode,
        increase_mode=shape.ThicknessIncreaseMode,
        outershell_thickness=shape.OutershellThickness,
        thickness_increase=shape.ThicknessIncreaseFactor,
        min_thickness=shape.MinThickness)

    dshells_dend = addDifMachineryToComp(model, comp, Buffers, Pumps,
                                         shellsparams, spine)

    return dshells_dend
Exemple #10
0
def create_synpath_array(allsyncomp_list, syntype, NumSyn):
    syncomps = []
    totalsyn = 0
    for syncomp in allsyncomp_list:
        xloc = syncomp.parent.x
        yloc = syncomp.parent.y
        dist = np.sqrt(xloc * xloc + yloc * yloc)
        SynPerComp = util.distance_mapping(NumSyn[syntype], dist)
        syncomps.append([syncomp.path, SynPerComp])
        totalsyn += SynPerComp
    return syncomps, totalsyn
Exemple #11
0
def extract_and_add_capool(model, comp, pools):
    params = model.CaPlasticityParams
    shape = distance_mapping(params.ShapeConfig, comp)
    OuterShellThick = shape.OutershellThickness
    BufCapacity = distance_mapping(params.BufferCapacityDensity, comp)
    if hasattr(params, 'Taus'):
        tau = distance_mapping(params.Taus, comp)
        tauScale = params.tauScale
    else:
        tau = params.CalciumParams.tau
        tauScale = None
    pool = addCaPool(model,
                     OuterShellThick,
                     BufCapacity,
                     comp,
                     pools,
                     tau=tau,
                     tauScale=tauScale)

    return pool
Exemple #12
0
def create_synpath_array(allsyncomp_list,
                         syntype,
                         NumSyn,
                         prob=None,
                         soma_loc=[0, 0, 0]):
    #list of possible synapses with connection probability, which takes into account prior creation of synapses
    syncomps = []
    totalsyns = 0
    #print('    CREATE_SYNPATH_ARRAY: syntype:', syntype, 'prob',prob,'soma_loc',soma_loc)
    for syncomp in allsyncomp_list:
        dist, nm = util.get_dist_name(syncomp.parent, soma_loc)
        if prob:  #calculate dendritic distance dependent connection probability to store with table
            dist_prob = dendritic_distance_dep_connect_prob(prob, dist)
        else:
            dist_prob = 1
        #print('    syncomp',syncomp,'dist',dist,'prob',dist_prob)
        #length of syncomps is the number of synapses available for connections
        #this is the number of synchans * number of synapses per synchan
        #optionally multiply by probably of connecting to that synchan, e.g. based on distance dependence
        #since there may be multiple types of pre-synaptic neurons, reduce length of syncomps if synapses already made
        #
        if dist_prob > 0:  #only add synchan to list if connection probability is non-zero
            sh = moose.element(syncomp.path + '/SH')
            # TODO: Fix for synapses on spines; there should only be 1 per spine
            if NAME_HEAD in nm:
                SynPerComp = 1  #- sh.numSynapses
            else:
                SynPerComp = util.distance_mapping(NumSyn[syntype],
                                                   dist)  #-sh.numSynapses
            #print('   sh',sh.path,'numSynapses',sh.numSynapses,'synpercomp',SynPerComp,'NumSyn',NumSyn[syntype])
            for i in range(SynPerComp):
                totalsyns += dist_prob  #totalsyns=total synapses to connect
                if i < SynPerComp - sh.numSynapses:
                    syncomps.append([syncomp.path + '/SH', dist_prob])
                    #print('{} synapses already connected of {} total synapses, adding 1 synapse with {} dist_prob to list'.format(sh.numSynapses,SynPerComp,dist_prob))
                else:
                    syncomps.append([syncomp.path + '/SH', 0])
                    #print('   {} synapses already connected of {} total, adding 1 syn with 0 prob to list'.format(sh.numSynapses,SynPerComp))

    #normalize probability to pdf
    syncomp_sum = sum([p[1] for p in syncomps])
    #print('CONNECT: totsyns:',totalsyns,'syncomp_sum',syncomp_sum)
    if syncomp_sum > 0:
        for syn in syncomps:
            syn[1] = float(syn[1]) / syncomp_sum
    else:
        log.info(
            '&&&&&&&&& Un Oh, no synapes remaining on post-synaptic neurons, syncom_sum='
            .format(syncomp_sum))
    avail_syns = np.int(np.round(syncomp_sum))
    return syncomps, totalsyns, avail_syns
def test_distance_mapping_func():
    near = (0, 20)
    far = (20, 30)
    map = {near: (lambda x: 5 + x), far: (lambda x: 30 - x)}
    assert util.distance_mapping(map, 0) == 5
    assert util.distance_mapping(map, 10) == 15
    assert util.distance_mapping(map, 20) == 10
    assert util.distance_mapping(map, 25) == 5
    assert util.distance_mapping(map, 30) == 0
    assert util.distance_mapping(map, 35) == 0
def test_distance_mapping():
    near = (0, 20)
    far = (20, 30)
    map = {near: 5, far: 6}

    assert util.distance_mapping(map, 0) == 5
    assert util.distance_mapping(map, 10) == 5
    assert util.distance_mapping(map, 20) == 6
    assert util.distance_mapping(map, 25) == 6
    assert util.distance_mapping(map, 30) == 0
    assert util.distance_mapping(map, 35) == 0
def distanceWeighting(elementList, distanceMapping):
    '''Creates non-uniform, distance-dependent weighted probability.
    distanceMapping should be a callable or a dictionary of {(distanceMin,distanceMax):RelativeWeight}

    The distance mapping can be relative weights as a function of distance,
    and this function will normalize the sum to 1.

    Returns array of weights that can be passed to selectRandom for non-uniform
    distance-dependent selection of inputs
    '''
    weights = []
    for el in elementList:
        w = util.distance_mapping(distanceMapping, el)
        weights.append(w)
    # Normalize weights to sum to 1:
    weights = weights/np.sum(weights)
    return weights
Exemple #16
0
def distanceWeighting(elementList, distanceMapping):
    '''Creates non-uniform, distance-dependent weighted probability.
    distanceMapping should be a callable or a dictionary of {(distanceMin,distanceMax):RelativeWeight}

    The distance mapping can be relative weights as a function of distance,
    and this function will normalize the sum to 1.

    Returns array of weights that can be passed to selectRandom for non-uniform
    distance-dependent selection of inputs
    '''
    weights = []
    for el in elementList:
        w = util.distance_mapping(distanceMapping, el)
        weights.append(w)
    # Normalize weights to sum to 1:
    weights = weights / np.sum(weights)
    return weights
Exemple #17
0
def fix_calcium(neurontypes, model, buf_cap=None):
    """kluge to fix buffer capacity in CaPool

    Initiating hsolve calculates CaConc.B from thickness, length,
    diameter; ignores buffer capacity.
    """

    comptype = 'ZombieCompartment'
    cacomptype = 'ZombieCaConc'

    for ntype in neurontypes:
        ### if neurons come from different packages, they may have different buffer_capacity_densities
        ### if so, use the dictionary of those values in this function
        if buf_cap:
            buffer_density = buf_cap[ntype]
            log.info(
                'Fixing calcium buffer capacity for {} elements, using {}'.
                format(comptype, list(buffer_density.values())))
        else:
            buffer_density = model.CaPlasticityParams.BufferCapacityDensity
            log.info('Fixing calcium buffer capacity for {} elements'.format(
                comptype))

        for comp in moose.wildcardFind('{}/#[TYPE={}]'.format(ntype,
                                                              comptype)):
            cacomps = [
                m for m in moose.element(comp).children
                if m.className == cacomptype
            ]
            for cacomp in cacomps:

                buf_capacity = distance_mapping(buffer_density, comp)
                radius = cacomp.diameter / 2.
                if cacomp.thick > radius:
                    cacomp.thick = radius
                if cacomp.length:
                    vol = np.pi * cacomp.length * (radius**2 -
                                                   (radius - cacomp.thick)**2)

                else:
                    vol = 4. / 3. * np.pi * (
                        (cacomp.diameter / 2)**3 -
                        (cacomp.diameter / 2 - cacomp.thick)**3)
                cacomp.B = 1. / (constants.Faraday * vol *
                                 2) / buf_capacity  # volume correction
Exemple #18
0
def create_synpath_array(allsyncomp_list, syntype, NumSyn, prob=None):
    # list of possible synapses with connection probability, which takes into account prior creation of synapses
    syncomps = []
    totalsyns = 0
    print('CONNECT: syntype:', syntype, 'prob', prob)
    for syncomp in allsyncomp_list:
        dist, nm = util.get_dist_name(syncomp.parent)
        if prob:  # calculate dendritic distance dependent connection probability to store with table
            dist_prob = dendritic_distance_dep_connect_prob(prob, dist)
        else:
            dist_prob = 1
        # print('syncomp',syncomp,'dist',dist,'prob',dist_prob)
        if dist_prob > 0:  # only add synchan to list if connection probability is non-zero
            sh = moose.element(syncomp.path + '/SH')
            # TODO: Fix for synapses on spines; there should only be 1 per spine
            if NAME_HEAD in nm:
                SynPerComp = 1  # - sh.numSynapses
            else:
                SynPerComp = util.distance_mapping(NumSyn[syntype],
                                                   dist)  # -sh.numSynapses
            for i in range(SynPerComp):
                totalsyns += dist_prob  # totalsyns=total synapses to connect
                if i < SynPerComp - sh.numSynapses:
                    syncomps.append([syncomp.path + '/SH', dist_prob])
                    # print('{} synapses already connected of {} total synapses, adding 1 synapse with {} dist_prob to list'.format(sh.numSynapses,SynPerComp,dist_prob))
                else:
                    syncomps.append([syncomp.path + '/SH', 0])
                    # print('{} synapses already connected of {} total synapses, adding 1 synapse with 0 dist_prob to list'.format(sh.numSynapses,SynPerComp))

    # normalize probability to pdf
    syncomp_sum = sum([p[1] for p in syncomps])
    print('CONNECT: totsyns:', totalsyns, 'syncomp_sum', syncomp_sum)
    for syn in syncomps:
        syn[1] = float(syn[1]) / syncomp_sum
    avail_syns = np.int(np.round(syncomp_sum))
    return syncomps, totalsyns, avail_syns
Exemple #19
0
def create_neuron(model, ntype, ghkYN):
    p_file = find_morph_file(model, ntype)
    try:
        cellproto = moose.loadModel(p_file, ntype)
    except IOError:
        print('could not load model from {!r}'.format(p_file))
        raise
    #######channels
    Cond = model.Condset[ntype]
    for comp in moose.wildcardFind('{}/#[TYPE=Compartment]'.format(ntype)):
        xloc = moose.Compartment(comp).x
        yloc = moose.Compartment(comp).y
        #Possibly this should be replaced by pathlength
        dist = np.sqrt(xloc * xloc + yloc * yloc)
        log.debug('comp {.path} dist {}', comp, dist)
        #
        #If we are using GHK, just create one GHK per compartment, connect it to comp
        #calcium concentration is connected in a different function
        if ghkYN:
            ghkproto = moose.element('/library/ghk')
            ghk = moose.copy(ghkproto, comp, 'ghk')[0]
            moose.connect(ghk, 'channel', comp, 'channel')
        else:
            ghk = []
        for channame, chanparams in model.Channels.items():
            c = _util.distance_mapping(Cond[channame], comp)
            if c > 0:
                log.debug('Testing Cond If {} {}', channame, c)
                calciumPermeable = chanparams.calciumPermeable
                add_channel.addOneChan(channame,
                                       c,
                                       comp,
                                       ghkYN,
                                       ghk,
                                       calciumPermeable=calciumPermeable)
    return cellproto
Exemple #20
0
def addCalcium(model, ntype):
    pools = CaProto(model)
    capool = []
    params = model.CaPlasticityParams
    for comp in moose.wildcardFind(ntype + '/#[TYPE=Compartment]'):
        if NAME_NECK not in comp.name and NAME_HEAD not in comp.name:  # Look for spines connected to the dendrite
            shellMode = distance_mapping(params.CaShellModeDensity, comp)
            dshells_dend = add_calcium_to_compartment(model,
                                                      shellMode,
                                                      comp,
                                                      pools,
                                                      capool,
                                                      spine=False)
            if dshells_dend == -1:
                return

            if model.spineYN:
                spines = []
                neighbors = list(comp.neighbors['raxial'])
                neighbors.extend(list(comp.neighbors['axial']))
                for neighbor in neighbors:
                    if NAME_NECK in neighbor.name:
                        spines.append(neighbor)
                    else:
                        'Could not find spines!!!'
                for sp in spines:

                    shellMode = distance_mapping(params.CaShellModeDensity,
                                                 moose.element(sp))
                    dshells_neck = add_calcium_to_compartment(
                        model,
                        shellMode,
                        moose.element(sp),
                        pools,
                        capool,
                        spine=True)
                    if dshells_neck == -1:
                        return
                    if dshells_dend and dshells_neck:  # diffusion between neck and dendrite
                        moose.connect(dshells_neck[-1], "outerDifSourceOut",
                                      dshells_dend[0], "fluxFromOut")
                        moose.connect(dshells_dend[0], "innerDifSourceOut",
                                      dshells_neck[-1], "fluxFromIn")
                    heads = []
                    neighbors = list(moose.element(sp).neighbors['raxial'])
                    neighbors.extend(list(
                        moose.element(sp).neighbors['axial']))
                    for neighbor in neighbors:
                        if NAME_HEAD in neighbor.name:
                            heads.append(neighbor)

                    if not heads:
                        'Could not find heads!!!'
                    for head in heads:
                        shellMode = distance_mapping(params.CaShellModeDensity,
                                                     moose.element(head))
                        dshells_head = add_calcium_to_compartment(
                            model,
                            shellMode,
                            moose.element(head),
                            pools,
                            capool,
                            spine=True)
                        if dshells_head == -1:
                            return
                        if dshells_head and dshells_neck:  # diffusion between neck and dendrite
                            moose.connect(dshells_head[-1],
                                          "outerDifSourceOut", dshells_neck[0],
                                          "fluxFromOut")
                            moose.connect(dshells_neck[0], "innerDifSourceOut",
                                          dshells_head[-1], "fluxFromIn")

    return capool
def test_distance_mapping_inf():
    map = {(0, np.inf): (lambda x: 3 * np.exp(-x / 5))}
    assert_close(util.distance_mapping(map, 0), 3)
    assert_close(util.distance_mapping(map, 5), 1.103638323514327)
    assert_close(util.distance_mapping(map, 1e5), 0)