Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (14 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/LambdaInterchange/AlbaExhaustiveLambdaInterchangeMoveGenerator.cs

    r4352 r4722  
    2121
    2222using System;
     23using System.Collections.Generic;
     24using HeuristicLab.Common;
    2325using HeuristicLab.Core;
    2426using HeuristicLab.Optimization;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    27 using HeuristicLab.Parameters;
    28 using System.Collections.Generic;
    2928
    3029namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
     
    3433    [StorableConstructor]
    3534    private AlbaExhaustiveLambdaInterchangeMoveGenerator(bool deserializing) : base(deserializing) { }
    36 
    37     public AlbaExhaustiveLambdaInterchangeMoveGenerator()
    38       : base() {
     35    private AlbaExhaustiveLambdaInterchangeMoveGenerator(AlbaExhaustiveLambdaInterchangeMoveGenerator original, Cloner cloner) : base(original, cloner) { }
     36    public AlbaExhaustiveLambdaInterchangeMoveGenerator() : base() { }
     37    public override IDeepCloneable Clone(Cloner cloner) {
     38      return new AlbaExhaustiveLambdaInterchangeMoveGenerator(this, cloner);
    3939    }
    4040
     
    5050
    5151          for (int length1 = 0; length1 <= Math.Min(lambda, tour1.Cities.Count); length1++) {
    52             for(int length2 = 0; length2 <= Math.Min(lambda, tour2.Cities.Count); length2++) {
    53               if(length1 != 0 || length2 != 0) {
    54                 for(int index1 = 0; index1 < tour1.Cities.Count - length1 + 1; index1++) {
    55                   for(int index2 = 0; index2 < tour2.Cities.Count - length2 + 1; index2++) {
    56                     moves.Add(new AlbaLambdaInterchangeMove(tour1Index, index1, length1, 
     52            for (int length2 = 0; length2 <= Math.Min(lambda, tour2.Cities.Count); length2++) {
     53              if (length1 != 0 || length2 != 0) {
     54                for (int index1 = 0; index1 < tour1.Cities.Count - length1 + 1; index1++) {
     55                  for (int index2 = 0; index2 < tour2.Cities.Count - length2 + 1; index2++) {
     56                    moves.Add(new AlbaLambdaInterchangeMove(tour1Index, index1, length1,
    5757                      tour2Index, index2, length2, individual));
    5858                  }
Note: See TracChangeset for help on using the changeset viewer.