Starts the TSP algorithm.
To stop before all generations are calculated, set
Halt to true.
Namespace: Tsp.GAAssembly: Tsp (in Tsp.exe) Versión: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public void Begin(
int populationSize,
int maxGenerations,
int groupSize,
int mutation,
int seed,
int chanceToUseCloseCity,
Cities cityList
) |
Visual C++ |
---|
public:
void Begin(
int populationSize,
int maxGenerations,
int groupSize,
int mutation,
int seed,
int chanceToUseCloseCity,
Cities^ cityList
) |
Parameters
- populationSize
- Type: System..::..Int32
Number of random tours to create before starting the algorithm.
- maxGenerations
- Type: System..::..Int32
Number of times to perform the crossover operation before stopping.
- groupSize
- Type: System..::..Int32
Number of tours to examine in each generation. Top 2 are chosen as the parent tours whose children replace the worst 2 tours in the group.
- mutation
- Type: System..::..Int32
Odds that a child tour will be mutated..
- seed
- Type: System..::..Int32
Seed for the random number generator.
- chanceToUseCloseCity
- Type: System..::..Int32
The odds (out of 100) that a city that is known to be close will be used in any given link.
- cityList
- Type: Tsp.GA..::..Cities
List of cities in the tour.
See Also