Old engine for Continuous Time Bayesian Networks. Superseded by reCTBN. 🐍
https://github.com/madlabunimib/PyCTBN
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
374 B
20 lines
374 B
4 years ago
|
|
||
|
|
||
|
class PriorityQueue():
|
||
|
"""
|
||
|
Rappresenta una semplice coda con priorità FIFO
|
||
|
:queue: lista che contiene i valori della coda
|
||
|
"""
|
||
|
|
||
|
def __init__(self):
|
||
|
self.queue = []
|
||
|
|
||
|
def enqueue(self, node):
|
||
|
self.queue.append(node)
|
||
|
|
||
|
def dequeue(self):
|
||
|
return self.queue.pop(0)
|
||
|
|
||
|
def is_empty(self):
|
||
|
return len(self.queue) == 0
|