pyrallelsa/examples/tsp/__init__.py
def move(self, state=None):
        """Swaps two cities in the route.

        :type state: TSPState
        """
        state = self.state if state is None else state
        route = state
        a = random.randint(self.locked_range, len(route) - 1)
        b = random.randint(self.locked_range, len(route) - 1)
        route[a], route[b] = route[b], route[a]
def move(self, state=None):
        state = self.state if state is None else state
        route = state
        a = random.randint(self.locked_range, len(route) - 1)
        b = random.randint(self.locked_range, len(route) - 1)
        route[a], route[b] = route[b], route[a]
def move ( self , state = None ) : state = self . state if state is None else state route = state a = random . randint ( self . locked_range , len ( route ) - 1 ) b = random . randint ( self . locked_range , len ( route ) - 1 ) route [ a ] , route [ b ] = route [ b ] , route [ a ]
Swaps two cities in the route.

        :type state: TSPState
Swaps two cities in the route .