Perform the crossover operation on 2 parent tours to create a new child tour.
This function should be called twice to make the 2 children.
In the second call, the parent parameters should be swapped.
Namespace: Tsp.GAAssembly: Tsp (in Tsp.exe) Versión: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public static Tour Crossover( Tour parent1, Tour parent2, Cities cityList, Random rand ) |
Visual Basic |
---|
Public Shared Function Crossover ( _ parent1 As Tour, _ parent2 As Tour, _ cityList As Cities, _ rand As Random _ ) As Tour |
Visual C++ |
---|
public: static Tour^ Crossover( Tour^ parent1, Tour^ parent2, Cities^ cityList, Random^ rand ) |
Parameters
- parent1
- Type: Tsp.GA..::..Tour
The first parent tour.
- parent2
- Type: Tsp.GA..::..Tour
The second parent tour.
- cityList
- Type: Tsp.GA..::..Cities
The list of cities in this tour.
- rand
- Type: System..::..Random
Random number generator. We pass around the same random number generator, so that results between runs are consistent.