Beispiel #1
0
 def __init__(self, maxsize=0):
     PriorityQueue.__init__(self, maxsize)
     self.queue_name = "QUEUE"
     self.lock = threading.Lock()
     self.currentItem = None
     self.min_priority = 0
     self.amActive = False
     self.stop = threading.Event()
Beispiel #2
0
 def __init__(self, G = None, from_list = False):
     PriorityQueue.__init__(self)
     self.counter = 0
     if not from_list and G:
         for node in G.getNodes():
             for neigh in G.getEdges(node):
                 #PriorityQueue.put(self, ((node, neigh), self.counter G.getWeight(node, neigh)))
                 PriorityQueue.put(self, ( (G.getWeight(node, neigh), self.counter, (node, neigh))))
     elif from_list:
         for edge in from_list:
             n1, n2, w = edge
             PriorityQueue.put(self, ( (w, self.counter, (n1, n2))))
Beispiel #3
0
	def __init__(self, maxsize = 0, batch_len = None):
		"""
		Initialize the queue
		@params:
			`maxsize`  : The maxsize of the queue
			`batch_len`: What's the length of a batch
		"""
		if not batch_len:
			raise ValueError('`batch_len` is required for PQueue.')
		PriorityQueue.__init__(self, maxsize)
		self.batch_len = batch_len
		self.lock      = Lock()
    def __init__(self, mysqlHost, mysqlUser, mysqlPasswd, mysqlDatabase, poolSize=10):
        PriorityQueue.__init__(self)
        self.isDestroying = False
        self.condition = threading.Condition()
        self.poolSize = poolSize

        if self.poolSize < 1:
            self.poolSize = 10

        self.pool = PooledDB(
            mysql.connector, self.poolSize, database=mysqlDatabase, user=mysqlUser, passwd=mysqlPasswd, host=mysqlHost
        )
        self.__buildFromDB()
 def __init__(self, G=None, from_list=False):
     PriorityQueue.__init__(self)
     self.counter = 0
     if not from_list and G:
         for node in G.getNodes():
             for neigh in G.getEdges(node):
                 #PriorityQueue.put(self, ((node, neigh), self.counter G.getWeight(node, neigh)))
                 PriorityQueue.put(self,
                                   ((G.getWeight(node, neigh), self.counter,
                                     (node, neigh))))
     elif from_list:
         for edge in from_list:
             n1, n2, w = edge
             PriorityQueue.put(self, ((w, self.counter, (n1, n2))))
Beispiel #6
0
    def __init__(self,
                 mysqlHost,
                 mysqlUser,
                 mysqlPasswd,
                 mysqlDatabase,
                 poolSize=10):
        PriorityQueue.__init__(self)
        self.isDestroying = False
        self.condition = threading.Condition()
        self.poolSize = poolSize

        if self.poolSize < 1:
            self.poolSize = 10

        self.pool = PooledDB(mysql.connector,
                             self.poolSize,
                             database=mysqlDatabase,
                             user=mysqlUser,
                             passwd=mysqlPasswd,
                             host=mysqlHost)
        self.__buildFromDB()
Beispiel #7
0
 def __init__(self, *args, **kargs):
     PriorityQueue.__init__(self, *args, **kargs)
 def __init__(self, size):
     """Initialize a priority queue of given size."""
     PriorityQueue.__init__(self, size)
     self.size = 0
 def __init__(self, node_manager):
     self._node_manager = node_manager
     PriorityQueue.__init__(self)
Beispiel #10
0
 def __init__(self):
     PriorityQueue.__init__(self)
Beispiel #11
0
    def __init__(self, limit = 0):
        PriorityQueue.__init__(self, limit)

	self.max_prio = 0
Beispiel #12
0
	def __init__(self):
		PriorityQueue.__init__(self)
		self.size = 0
		return
Beispiel #13
0
 def __init__(self):
     PriorityQueue.__init__(self)
     self.counter = 0
     self.put_counter = 0
     self.get_counter = 0
Beispiel #14
0
    def __init__(self, limit = 0):
        PriorityQueue.__init__(self, limit)

	self.max_prio = 0
	self.none_send = False
Beispiel #15
0
 def __init__(self, maxPQ=False):
     PriorityQueue.__init__(self)
     self.reverse = -1 if maxPQ else 1
 def __init__(self, comparableObj):
     PriorityQueue.__init__(self)
     self.comparableObj = comparableObj
     self.count = 0
Beispiel #17
0
 def __init__(self, *args, **kargs):
     PriorityQueue.__init__(self, *args, **kargs)
Beispiel #18
0
 def __init__(self):
     PriorityQueue.__init__(self)
Beispiel #19
0
 def __init__(self):
     PriorityQueue.__init__(self)
     self.first_element_changed = Condition(self.mutex)
 def __init__(self):
     PriorityQueue.__init__(self)
     #self.all_items = set()
     self.counter = 0
Beispiel #21
0
 def __init__(self, limit):
     PriorityQueue.__init__(self)
     self.counter = 0
     self.upperlimmit = limit
     self.lowesrscore = 0
Beispiel #22
0
    def __init__(self, limit=0):
        PriorityQueue.__init__(self, limit)

        self.max_prio = 0
Beispiel #23
0
    def __init__(self, limit=0):
        PriorityQueue.__init__(self, limit)

        self.max_prio = 0
        self.none_send = False
Beispiel #24
0
 def __init__(self):
     PriorityQueue.__init__(self)
     self.first_element_changed = Condition(self.mutex)
Beispiel #25
0
	def __init__(self):
		PriorityQueue.__init__(self)
		self.counter = 0
 def __init__(self):
     PriorityQueue.__init__(self)
     #self.all_items = set()
     self.counter = 0