| 107 | |
| 108 | == Creating an algorithm without loading it from a file == |
| 109 | HeuristicLab algorithms and problems can of course also be used without loading them from a file. If you replace the above shown Main method with the following code, a Genetic Algorithm with standard parameterization and a traveling salesman problem with it's default problem instance is created and executed: |
| 110 | |
| 111 | {{{#!csharp |
| 112 | GeneticAlgorithm ga = new GeneticAlgorithm(); |
| 113 | SequentialEngine engine = new SequentialEngine(); |
| 114 | TravelingSalesmanProblem problem = new TravelingSalesmanProblem(); |
| 115 | ga.Engine = engine; |
| 116 | ga.Problem = problem; |
| 117 | |
| 118 | RegisterAlgorithmEventHandlers(ga); |
| 119 | ga.Start(); |
| 120 | }}} |
| 121 | |
| 122 | |
| 123 | |
| 124 | |