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


Python Manager.remove方法代码示例

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


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

示例1: KarnaughMap

# 需要导入模块: from multiprocessing import Manager [as 别名]
# 或者: from multiprocessing.Manager import remove [as 别名]

#.........这里部分代码省略.........
                    n.flag = False
                    for j in range(0, len(a.values) ):

                        if(j!=(x-1)):
                            n.values.append(a.values[j] )
                        else:
                            n.values.append( 2 )

                    #/* Mark that a node is part of a larger node */
                    a.flag=True
                    b.flag=True

                    #/* Check if that block already exists in the list */
                    exist=False
                    for c in self.blocks:
                        if(n.values==c.values):
                            exist=True

                    if(not exist):
                        self.blocks.append(n )
        def CleanProcess():
            for process in ProcessList:
                process.join()

            for process in ProcessList:
                jn = resultQueue.get()
                for n in jn.newblocks:
                    exist = False
                    for c in self.blocks:
                        if(n.values==c.values):
                            exist=True
                    if(not exist):
                        self.blocks.append(n )
                for b in jn.removeblocks:
                    for c in self.blocks:
                        if(b.values==c.values):
                            self.blocks.remove(c)

        """ Check for special case that all cells in the map are the same """
        a=1
        for i in range(0,self.height):
            if(a==0):
                break
            for j in range(0,self.width):
                if( self.kmap[(j, i)]!=self.kmap[(0, 0)] ):
                    a=0
                    break
        if(a==1):

            #/* Clear the list so that all those nodes with one item are deleted */
            #self.blocks=Manager().list()
            self.blocks=[]

            # If there are only zeros in the map there's nothing to solve
            if (self.kmap[(0, 0)]==0):
                 return
            else:

                # If there are only ones, solution is one element as big as the map
                n=KarnaughNode()
                n.numberOfItems = self.width*self.height
                for j in range(0,self.numberOfVariables):
                    n.values.append( 2 )
                self.blocks.append(n )
                return
开发者ID:trilomix,项目名称:kmappy,代码行数:69,代码来源:karnaughmap.py


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