Changeset 5177 for branches/ParallelEngine/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.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/Alba/Crossovers/AlbaPermutationCrossover.cs
r4722 r5177 47 47 } 48 48 49 protected override AlbaEncoding Crossover(I Random random, AlbaEncoding parent1, AlbaEncoding parent2) {49 protected override AlbaEncoding Crossover(IExecutionContext context, IRandom random, AlbaEncoding parent1, AlbaEncoding parent2) { 50 50 //note - the inner crossover is called here and the result is converted to an alba representation 51 51 //some refactoring should be done here in the future - the crossover operation should be called directly 52 52 53 53 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 54 IAtomicOperation op = this.ExecutionContext.CreateOperation(55 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);54 IAtomicOperation op = context.CreateOperation( 55 InnerCrossoverParameter.ActualValue, context.Scope); 56 56 op.Operator.Execute((IExecutionContext)op); 57 57 58 58 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 59 if ( ExecutionContext.Scope.Variables.ContainsKey(childName)) {60 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation;61 ExecutionContext.Scope.Variables.Remove(childName);59 if (context.Scope.Variables.ContainsKey(childName)) { 60 Permutation permutation = context.Scope.Variables[childName].Value as Permutation; 61 context.Scope.Variables.Remove(childName); 62 62 63 63 return new AlbaEncoding(permutation, Cities);
Note: See TracChangeset
for help on using the changeset viewer.