- Timestamp:
- 07/17/11 22:51:11 (13 years ago)
- Location:
- branches/QAPAlgorithms
- Files:
-
- 5 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/QAPAlgorithms
- Property svn:ignore
-
old new 12 12 *.psess 13 13 *.vsp 14 *.docstates
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting merged: 6441,6448-6450,6455,6459,6491,6522-6523,6548
- Property svn:mergeinfo changed
-
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs
r5445 r6569 48 48 49 49 protected override AlbaEncoding Crossover(IRandom random, AlbaEncoding parent1, AlbaEncoding parent2) { 50 //note - the inner crossover is called here and the resultis converted to an alba representation50 //note - the inner crossover is called here and the solution 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 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 54 IAtomicOperation op = this.ExecutionContext.CreateOperation( 55 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 56 op.Operator.Execute((IExecutionContext)op, CancellationToken); 53 if (parent1.Length == parent2.Length) { 54 InnerCrossoverParameter.ActualValue.ParentsParameter.ActualName = ParentsParameter.ActualName; 55 IAtomicOperation op = this.ExecutionContext.CreateOperation( 56 InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope); 57 op.Operator.Execute((IExecutionContext)op, CancellationToken); 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 string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName; 60 if (ExecutionContext.Scope.Variables.ContainsKey(childName)) { 61 Permutation permutation = ExecutionContext.Scope.Variables[childName].Value as Permutation; 62 ExecutionContext.Scope.Variables.Remove(childName); 62 63 63 return new AlbaEncoding(permutation, Cities); 64 } else 65 return null; 64 return new AlbaEncoding(permutation, Cities); 65 } else 66 return null; 67 } else { 68 return parent1.Clone() as AlbaEncoding; 69 } 66 70 } 67 71 } -
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaExhaustiveLambdaInterchangeMoveGenerator.cs
r5445 r6569 39 39 } 40 40 41 p rotected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, int lambda) {41 public static AlbaLambdaInterchangeMove[] GenerateAllMoves(AlbaEncoding individual, int lambda) { 42 42 List<AlbaLambdaInterchangeMove> moves = new List<AlbaLambdaInterchangeMove>(); 43 43 … … 66 66 return moves.ToArray(); 67 67 } 68 69 protected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, int lambda) { 70 return GenerateAllMoves(individual, lambda); 71 } 68 72 } 69 73 } -
branches/QAPAlgorithms/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs
r5445 r6569 50 50 return new AlbaStochasticLambdaInterchangeMultiMoveGenerator(this, cloner); 51 51 } 52 protected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, int lambda) {53 int sampleSize = SampleSizeParameter.ActualValue.Value;54 52 53 public static AlbaLambdaInterchangeMove[] GenerateAllMoves(AlbaEncoding individual, int lambda, int sampleSize, IRandom random) { 55 54 AlbaLambdaInterchangeMove[] moves = new AlbaLambdaInterchangeMove[sampleSize]; 56 55 for (int i = 0; i < sampleSize; i++) { 57 56 moves[i] = AlbaStochasticLambdaInterchangeSingleMoveGenerator.Apply( 58 individual, Cities, lambda, RandomParameter.ActualValue);57 individual, individual.Cities, lambda, random); 59 58 } 60 59 61 60 return moves; 62 61 } 62 63 protected override AlbaLambdaInterchangeMove[] GenerateMoves(AlbaEncoding individual, int lambda) { 64 int sampleSize = SampleSizeParameter.ActualValue.Value; 65 66 return GenerateAllMoves(individual, lambda, sampleSize, RandomParameter.ActualValue); 67 } 63 68 } 64 69 }
Note: See TracChangeset
for help on using the changeset viewer.