Exemple #1
0
from colas import Queue, BoundedPriorityQueue

q1 = Queue()
q1.enqueue(3)
q1.enqueue(33)
q1.enqueue(23)
print(q1.to_string())

print("Pruebas 2 de Queue")
c1 = {"id": 1, "nombre": "Mario", "balance": 20.5}
c2 = {"id": 2, "nombre": "Diana", "balance": 3456.5}
c3 = {"id": 3, "nombre": "Bartolo", "balance": 100000.5}

atencion = Queue()
atencion.enqueue(c1)
atencion.enqueue(c2)
atencion.enqueue(c3)
print(atencion.to_string())
siguiente = atencion.dequeue()
print(
    f"Bienvenido sr. { siguiente['nombre'] }, en que podemos servirle el dia de hoy"
)
print(atencion.to_string())

print("Pruebas de las colas con priotidad acotada")

maestres = {
    "prioridad": 4,
    "descripcion": "Maestre",
    "personas": ["juan p", "diego h"]
}
Exemple #2
0
 def __init__(self, niveles):
     self.__data = [Queue() for x in range(niveles)]
     self.__size = 0
from colas import Queue, BoundedPriorityQueue, PriorityQueue
q1 = Queue()
q1.enqueue(3)
q1.enqueue(23)
q1.enqueue(23)
q1.enqueue(53)
q1.dequeue()
print(q1.length())
print(q1.to_string())

print("\nprueba 2 de Queue\n")

c1 = {"id": 1, "nombre": "Mario", "balance": 20.5}
c2 = {"id": 2, "nombre": "Diana", "balance": 3456.5}
c3 = {"id": 3, "nombre": "Bartolo", "balance": 100000.0}

atencion = Queue()
atencion.enqueue(c1)
atencion.enqueue(c2)
atencion.enqueue(c3)

print(atencion.to_string())
siguiente = atencion.dequeue()
print(
    f"Bienvenido sr. {siguiente['nombre']}, en que podemos servirle el dia de hoy"
)
print(atencion.to_string())
print("--------------------------------------------------")

print("\nPRUEBAS DE LAS COLAS CON PRIORIDAD NO ACOTADA\n")
barco = PriorityQueue()
Exemple #4
0
from colas import Queue, BoundedPriorityQueue, PriorityQueue

print(
    "..............................................................................."
)
print("Pruebas de las colas")
print(
    "..............................................................................."
)

q1 = Queue()
q1.enqueue(3)
q1.enqueue(33)
q1.enqueue(23)
print(q1.to_string())

print("Prueba 2 de Queue")
c1 = {"id": 1, "nombre": "Mario", "balance": 20.5}
c2 = {"id": 2, "nombre": "Diana", "balance": 3456.5}
c3 = {"id": 3, "nombre": "Bartolo", "balance": 1000000.0}

atencion = Queue()
atencion.enqueue(c1)
atencion.enqueue(c2)
atencion.enqueue(c3)
print(atencion.to_string())
siguiente = atencion.dequeue()
print(
    f"Bienvenido Sr.{siguiente['nombre']}, en que podemos servirle el dia de hoy"
)
print(atencion.to_string())