genome.py
def order_units(self, units):
        """
        Implements a directed graph topological sort algorithm
        Requires an acyclic graph - see _is_valid_connection method
        :return: A sorted stack of NodeGene instances
        """

        nodes = [u.ref_node for u in units]
        visited = set()
        ordered = []

        for n in nodes:
            if n not in visited:
                self._order_units(n, nodes, ordered, visited)

        ordered_units = []
        for n in ordered:
            for u in units:
                if u.ref_node == n:
                    ordered_units.append(u)
                    break

        return ordered_units

        Implements a directed graph topological sort algorithm
        Requires an acyclic graph - see _is_valid_connection method
        :return: A sorted stack of NodeGene instances
        
Implements a directed graph topological sort algorithm
Requires an acyclic graph - see _is_valid_connection method
Implements a directed graph topological sort algorithm Requires an acyclic graph - see _is_valid_connection method
def order_units(self, units):
        nodes = [u.ref_node for u in units]
        visited = set()
        ordered = []
        for n in nodes:
            if n not in visited:
                self._order_units(n, nodes, ordered, visited)
        ordered_units = []
        for n in ordered:
            for u in units:
                if u.ref_node == n:
                    ordered_units.append(u)
                    break
        return ordered_units
def order_units ( self , units ) : nodes = [ u . ref_node for u in units ] visited = set ( ) ordered = [ ] for n in nodes : if n not in visited : self . _order_units ( n , nodes , ordered , visited ) ordered_units = [ ] for n in ordered : for u in units : if u . ref_node == n : ordered_units . append ( u ) break return ordered_units
Implements a directed graph topological sort algorithm
Requires an acyclic graph - see _is_valid_connection method
Implements a directed graph topological sort algorithm Requires an acyclic graph - see _is_valid_connection method
"""
        Implements a directed graph topological sort algorithm
        Requires an acyclic graph - see _is_valid_connection method
        :return: A sorted stack of NodeGene instances
        """
A sorted stack of NodeGene instances
A sorted stack of NodeGene instances
self
units