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/IntraRouteInversion/AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs

    r4352 r4722  
    2020#endregion
    2121
    22 using System;
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Optimization;
     26using HeuristicLab.Parameters;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    26 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    27 using HeuristicLab.Parameters;
    28 using System.Collections.Generic;
    2928using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3029
     
    4140
    4241    #endregion
    43    
     42
    4443    public ILookupParameter<IRandom> RandomParameter {
    4544      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
    4645    }
    47    
     46
    4847    [StorableConstructor]
    4948    private AlbaStochasticIntraRouteInversionSingleMoveGenerator(bool deserializing) : base(deserializing) { }
    50 
     49    private AlbaStochasticIntraRouteInversionSingleMoveGenerator(AlbaStochasticIntraRouteInversionSingleMoveGenerator original, Cloner cloner) : base(original, cloner) { }
    5150    public AlbaStochasticIntraRouteInversionSingleMoveGenerator()
    5251      : base() {
    53         Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     52      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator."));
     53    }
     54
     55    public override IDeepCloneable Clone(Cloner cloner) {
     56      return new AlbaStochasticIntraRouteInversionSingleMoveGenerator(this, cloner);
    5457    }
    5558
     
    7578
    7679        int currentTourEnd = currentTourStart;
    77         while (currentTourEnd < individual.Length && 
     80        while (currentTourEnd < individual.Length &&
    7881          individual[currentTourEnd] < individual.Cities) {
    7982          currentTourEnd++;
     
    9396
    9497      AlbaIntraRouteInversionMove move = Apply(individual, Cities, RandomParameter.ActualValue);
    95       if(move != null)
     98      if (move != null)
    9699        moves.Add(move);
    97100
Note: See TracChangeset for help on using the changeset viewer.