当前位置: 首页>>代码示例>>Python>>正文


Python Layer.Y[i]方法代码示例

本文整理汇总了Python中layer.Layer.Y[i]方法的典型用法代码示例。如果您正苦于以下问题:Python Layer.Y[i]方法的具体用法?Python Layer.Y[i]怎么用?Python Layer.Y[i]使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在layer.Layer的用法示例。


在下文中一共展示了Layer.Y[i]方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: rimap

# 需要导入模块: from layer import Layer [as 别名]
# 或者: from layer.Layer import Y[i] [as 别名]
def rimap(n, N = 30, alpha = [0.01,0.3], sigma = [1.1,1.4], dt = 0.1,
            pg = 0.01, pu = 0.05, su = 0.315, boundary = ""):
    """Creates an irregular maps

        :param n: number of areas 
        :type n: integer
        :param N: number of points sampled from each irregular polygon (MR-Polygon) 
        :type N: integer
        :param alpha: min and max value to sampled alpha; default is (0.1,0.5)
        :type alpha: List
        :param sigma: min and max value to sampled sigma; default is (1.2,1.5)
        :type sigma: List
        :param dt: time delta to be used to create irregular polygons (MR-Polygons)
        :type dt: Float
        :param pg: parameter to define the scaling factor of each polygon before being introduced as part of the irregular map
        :type pg: Float
        :param pu: parameter to define the probability of increase the number of areas of each polygon before being introduced into the irregular map
        :type pu: Float
        :param su: parameter to define how much is increased the number of areas of each polygon before being introduced into the irregular map
        :type su: Float
        :param boundary: Initial irregular boundary to be used into the recursive irregular map algorithm
        :type boundary: Layer

        :rtype: Layer
        :return: RI-Map instance 

        **Examples** ::

            import clusterpy
            lay = clusterpy.rimap(1000)
            lay.exportArcData("rimap_1000")
    """

    rm = rim(n, N, alpha, sigma, dt, pg, pu, su, boundary)
    areas = rm.carteAreas
    areas = fixIntersections(areas)
    Wqueen,Wrook, = weightsFromAreas(areas)
    layer = Layer()
    layer.areas = areas
    layer.Wqueen = Wqueen
    layer.Wrook = Wrook
    layer.shpType = 'polygon'
    layer.name = "rimap_" + str(len(areas))
    layer.fieldNames = ["Id","nw"]
    layer.Y = {}
    for i in Wrook:
        layer.Y[i] = [i,len(Wrook[i])]
    return layer
开发者ID:1990q828j,项目名称:clusterpy,代码行数:50,代码来源:inputs.py


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