err fusion

fukurou

the supreme coder
ADMIN
Python:
    dictionary = {"string" : 5}
    neuron = Neuron()
    fusion = Fusion(dictionary)
    ds:DISkillUtils = DISkillUtils()
    alg1:Algorithm = ds.simpleVerbatimAlgorithm("test","hello")
    neuron.algParts.append(alg1)
    danger_alg:Algorithm = ds.simpleVerbatimAlgorithm("danger_test","hadoken")
    neuron.algParts.append(danger_alg)
    fusion.setAlgQueue(neuron)
    result:str = fusion.act("","","")
    print(result)
    result = fusion.act("", "", "")

Traceback (most recent call last):
File "C:\Users\Lenovo\PycharmProjects\ddos1\main.py", line 803, in <module>
fusion.setAlgQueue(neuron)
File "C:\Users\Lenovo\PycharmProjects\ddos1\main.py", line 674, in setAlgQueue
heapq.heappush(self.algQueue, algorithm.clone())
TypeError: '<' not supported between instances of 'Algorithm' and 'Algorithm'
 

fukurou

the supreme coder
ADMIN
Python:
    # A simple implementation of Priority Queue
    # using Queue.
    class PriorityQueue(object):
        def __init__(self):
            self.queue = []

        def __str__(self):
            return ' '.join([str(i) for i in self.queue])

        # for checking if the queue is empty
        def isEmpty(self):
            return len(self.queue) == 0

        # for inserting an element in the queue
        def insert(self, data):
            self.queue.append(data)

        # for popping an element based on Priority
        def delete(self) -> object:
            if not len(self.queue) == 0:
                result0 = self.queue[0]
                del self.queue[0]
                return result0
            return None
 

fukurou

the supreme coder
ADMIN
Python:
    # A simple implementation of Priority Queue
    # using Queue.
    class PriorityQueue(object):
        def __init__(self):
            self.queue = []

        def __str__(self):
            return ' '.join([str(i) for i in self.queue])

        # for checking if the queue is empty
        def isEmpty(self):
            return len(self.queue) == 0

        # for inserting an element in the queue
        def insert(self, data):
            self.queue.append(data)

        # for popping an element based on Priority
        def poll(self) -> object:
            if not len(self.queue) == 0:
                result0 = self.queue[0]
                del self.queue[0]
                return result0
            return None


    if __name__ == '__main__':
        myQueue = PriorityQueue()
        myQueue.insert(12)
        myQueue.insert(1)
        myQueue.insert(14)
        myQueue.insert(7)
        print(myQueue)
        while not myQueue.isEmpty():
            print(myQueue.poll())
 
Top