Changeset 5177 for branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
- Timestamp:
- 12/26/10 03:51:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs
r4722 r5177 45 45 } 46 46 47 protected override PrinsEncoding Crossover(I Random random, PrinsEncoding parent1, PrinsEncoding parent2) {47 protected override PrinsEncoding Crossover(IExecutionContext context, IRandom random, PrinsEncoding parent1, PrinsEncoding parent2) { 48 48 //note - the inner crossover is called here and the result is converted to a prins representation 49 49 //some refactoring should be done here in the future - the crossover operation should be called directly 50 50 51 51 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 52 IAtomicOperation op = this.ExecutionContext.CreateOperation(53 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);52 IAtomicOperation op = context.CreateOperation( 53 InnerCrossoverParameter.ActualValue, context.Scope); 54 54 op.Operator.Execute((IExecutionContext)op); 55 55 56 56 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 57 if ( ExecutionContext.Scope.Variables.ContainsKey(childName)) {58 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation;59 ExecutionContext.Scope.Variables.Remove(childName);57 if (context.Scope.Variables.ContainsKey(childName)) { 58 Permutation permutation = context.Scope.Variables[childName].Value as Permutation; 59 context.Scope.Variables.Remove(childName); 60 60 61 61 return new PrinsEncoding(permutation, Cities,
Note: See TracChangeset
for help on using the changeset viewer.