Glouton.py
def createMetaGraph(self, cheeses_list):
        """
        Create the pattern of the metagraph(distance between cheeses
        :param nodes_list: List of currents cheeses
        :return:
        """
        cheeses_list = cheeses_list.copy()
        dij = Dijkstra(self)

        while cheeses_list:
            n1 = cheeses_list[0]
            # Calculate path and distance with Dijkstra
            dij.setOrigin(n1)
            dij.setGoal(cheeses_list)
            dij.process()

            for n2 in cheeses_list:
                d, p = dij.getResult(n2)
                self.coupleNodesInMetagraph(n1, n2, d, p)

            cheeses_list.remove(n1) # On supprime le node en cours, pour accelerer le programme
            cheeses_list.remove(self.getOpposite(n1)) if self.getOpposite(n1) != n1 else ()

        Create the pattern of the metagraph(distance between cheeses
        :param nodes_list: List of currents cheeses
        :return:
        
Create the pattern of the metagraph(distance between cheeses
Create the pattern of the metagraph ( distance between cheeses
def createMetaGraph(self, cheeses_list):
        cheeses_list = cheeses_list.copy()
        dij = Dijkstra(self)
        while cheeses_list:
            n1 = cheeses_list[0]
            dij.setOrigin(n1)
            dij.setGoal(cheeses_list)
            dij.process()
            for n2 in cheeses_list:
                d, p = dij.getResult(n2)
                self.coupleNodesInMetagraph(n1, n2, d, p)
            cheeses_list.remove(n1) 
            cheeses_list.remove(self.getOpposite(n1)) if self.getOpposite(n1) != n1 else ()
def createMetaGraph ( self , cheeses_list ) : cheeses_list = cheeses_list . copy ( ) dij = Dijkstra ( self ) while cheeses_list : n1 = cheeses_list [ 0 ] dij . setOrigin ( n1 ) dij . setGoal ( cheeses_list ) dij . process ( ) for n2 in cheeses_list : d , p = dij . getResult ( n2 ) self . coupleNodesInMetagraph ( n1 , n2 , d , p ) cheeses_list . remove ( n1 ) cheeses_list . remove ( self . getOpposite ( n1 ) ) if self . getOpposite ( n1 ) != n1 else ( )
Create the pattern of the metagraph(distance between cheeses
Create the pattern of the metagraph ( distance between cheeses
"""
        Create the pattern of the metagraph(distance between cheeses
        :param nodes_list: List of currents cheeses
        :return:
        """ # Calculate path and distance with Dijkstra # On supprime le node en cours, pour accelerer le programme
None
self
cheeses_list
nodes_list
List of currents cheeses
List of currents cheeses