Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/09/10 09:55:31 (14 years ago)
Author:
svonolfe
Message:

Merged relevant changes from the trunk into the branch (cloning,...) (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestAverageWorstVRPToursAnalyzer.cs

    r4374 r4752  
    178178    private BestAverageWorstVRPToursAnalyzer(bool deserializing) : base() { }
    179179
     180    public override IDeepCloneable Clone(Cloner cloner) {
     181      return new BestAverageWorstVRPToursAnalyzer(this, cloner);
     182    }
     183
     184    private BestAverageWorstVRPToursAnalyzer(BestAverageWorstVRPToursAnalyzer original, Cloner cloner)
     185      : base(original, cloner) {
     186        this.Initialize();
     187    }
     188
    180189    [StorableHook(HookType.AfterDeserialization)]
    181190    private void Initialize() {
     
    184193    }
    185194
    186     public override IDeepCloneable Clone(Cloner cloner) {
    187       BestAverageWorstVRPToursAnalyzer clone = (BestAverageWorstVRPToursAnalyzer)base.Clone(cloner);
    188       clone.Initialize();
    189       return clone;
    190     }
    191 
    192195    void DistanceParameter_DepthChanged(object sender, EventArgs e) {
    193196      BestAverageWorstCalculator.DistanceParameter.Depth = DistanceParameter.Depth;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestAverageWorstVRPToursCalculator.cs

    r4374 r4752  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting {
     
    6768      Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageVehiclesUtilized", "The average utilized vehicles value of all solutions."));
    6869      Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstVehiclesUtilized", "The worst utilized vehicles value of all solutions."));
     70    }
     71
     72    [StorableConstructor]
     73    private BestAverageWorstVRPToursCalculator(bool deserializing) : base(deserializing) { }
     74
     75    public override IDeepCloneable Clone(Cloner cloner) {
     76      return new BestAverageWorstVRPToursCalculator(this, cloner);
     77    }
     78
     79    private BestAverageWorstVRPToursCalculator(BestAverageWorstVRPToursCalculator original, Cloner cloner)
     80      : base(original, cloner) {
    6981    }
    7082
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/BestVRPToursMemorizer.cs

    r4374 r4752  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting {
     
    5556    }
    5657
     58    [StorableConstructor]
     59    protected BestVRPToursMemorizer(bool deserializing) : base(deserializing) { }
     60
     61    public override IDeepCloneable Clone(Cloner cloner) {
     62      return new BestVRPToursMemorizer(this, cloner);
     63    }
     64
     65    protected BestVRPToursMemorizer(BestVRPToursMemorizer original, Cloner cloner)
     66      : base(original, cloner) {
     67    }
     68
    5769    public override IOperation Apply() {
    5870      int i = DistanceParameter.ActualValue.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestAverageWorstCapacitatedVRPToursAnalyzer.cs

    r4376 r4752  
    137137
    138138    public override IDeepCloneable Clone(Cloner cloner) {
    139       BestAverageWorstCapaciatatedVRPToursAnalyzer clone = (BestAverageWorstCapaciatatedVRPToursAnalyzer)base.Clone(cloner);
    140       clone.Initialize();
    141       return clone;
     139      return new BestAverageWorstCapaciatatedVRPToursAnalyzer(this, cloner);
     140    }
     141
     142    private BestAverageWorstCapaciatatedVRPToursAnalyzer(BestAverageWorstCapaciatatedVRPToursAnalyzer original, Cloner cloner)
     143      : base(original, cloner) {
     144        this.Initialize();
    142145    }
    143146
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestAverageWorstCapacitatedVRPToursCalculator.cs

    r4374 r4752  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting {
     
    5051      Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstOverload", "The worst overload value of all solutions."));
    5152    }
     53
     54    public override IDeepCloneable Clone(Cloner cloner) {
     55      return new BestAverageWorstCapacitatedVRPToursCalculator(this, cloner);
     56    }
     57
     58    private BestAverageWorstCapacitatedVRPToursCalculator(BestAverageWorstCapacitatedVRPToursCalculator original, Cloner cloner)
     59      : base(original, cloner) {
     60    }
     61
     62    [StorableConstructor]
     63    private BestAverageWorstCapacitatedVRPToursCalculator(bool deserializing) : base(deserializing) { }
    5264
    5365    private void UpdateOverloads() {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/Capacitated/BestCapacitatedVRPToursMemorizer.cs

    r4374 r4752  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting {
     
    4647    }
    4748
     49    public override IDeepCloneable Clone(Cloner cloner) {
     50      return new BestCapacitatedVRPToursMemorizer(this, cloner);
     51    }
     52
     53    protected BestCapacitatedVRPToursMemorizer(BestCapacitatedVRPToursMemorizer original, Cloner cloner)
     54      : base(original, cloner) {
     55    }
     56
     57    [StorableConstructor]
     58    protected BestCapacitatedVRPToursMemorizer(bool deserializing) : base(deserializing) { }
     59
    4860    public override IOperation Apply() {
    4961      int i = OverloadParameter.ActualValue.Select((x, index) => new { index, x.Value }).OrderBy(x => x.Value).First().index;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestAverageWorstTimeWindowedVRPToursAnalyzer.cs

    r4374 r4752  
    185185
    186186    public override IDeepCloneable Clone(Cloner cloner) {
    187       BestAverageWorstTimeWindowedVRPToursAnalyzer clone = (BestAverageWorstTimeWindowedVRPToursAnalyzer)base.Clone(cloner);
    188       clone.Initialize();
    189       return clone;
     187      return new BestAverageWorstTimeWindowedVRPToursAnalyzer(this, cloner);
     188    }
     189
     190    private BestAverageWorstTimeWindowedVRPToursAnalyzer(BestAverageWorstTimeWindowedVRPToursAnalyzer original, Cloner cloner)
     191      : base(original, cloner) {
     192       this.Initialize();
    190193    }
    191194
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestAverageWorstTimeWindowedVRPToursCalculator.cs

    r4374 r4752  
    2525using HeuristicLab.Parameters;
    2626using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     27using HeuristicLab.Common;
    2728
    2829namespace HeuristicLab.Problems.VehicleRouting {
     
    6768      Parameters.Add(new ValueLookupParameter<DoubleValue>("AverageTravelTime", "The average travel time value of all solutions."));
    6869      Parameters.Add(new ValueLookupParameter<DoubleValue>("WorstTravelTime", "The worst travel time value of all solutions."));
     70    }
     71
     72    [StorableConstructor]
     73    private BestAverageWorstTimeWindowedVRPToursCalculator(bool deserializing) : base(deserializing) { }
     74
     75    public override IDeepCloneable Clone(Cloner cloner) {
     76      return new BestAverageWorstTimeWindowedVRPToursCalculator(this, cloner);
     77    }
     78
     79    private BestAverageWorstTimeWindowedVRPToursCalculator(BestAverageWorstTimeWindowedVRPToursCalculator original, Cloner cloner)
     80      : base(original, cloner) {
    6981    }
    7082
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestAverageWorstTours/TimeWindowed/BestTimeWindowedVRPToursMemorizer.cs

    r4374 r4752  
    2626using HeuristicLab.Parameters;
    2727using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2829
    2930namespace HeuristicLab.Problems.VehicleRouting {
     
    6970      return base.Apply();
    7071    }
     72
     73    [StorableConstructor]
     74    protected BestTimeWindowedVRPToursMemorizer(bool deserializing) : base(deserializing) { }
     75
     76    public override IDeepCloneable Clone(Cloner cloner) {
     77      return new BestTimeWindowedVRPToursMemorizer(this, cloner);
     78    }
     79
     80    protected BestTimeWindowedVRPToursMemorizer(BestTimeWindowedVRPToursMemorizer original, Cloner cloner)
     81      : base(original, cloner) {
     82    }
    7183  }
    7284}
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs

    r4374 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.Variants;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting {
     
    7778    }
    7879
     80    public override IDeepCloneable Clone(Cloner cloner) {
     81      return new BestVRPSolutionAnalyzer(this, cloner);
     82    }
     83
     84    private BestVRPSolutionAnalyzer(BestVRPSolutionAnalyzer original, Cloner cloner)
     85      : base(original, cloner) {
     86    }
     87
    7988    public override IOperation Apply() {
    8089      IVRPProblemInstance problemInstance = ProblemInstanceParameter.ActualValue;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/Capacitated/BestCapacitatedVRPSolutionAnalyzer.cs

    r4454 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.Variants;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting {
     
    7374    }
    7475
     76    public override IDeepCloneable Clone(Cloner cloner) {
     77      return new BestCapacitatedVRPSolutionAnalyzer(this, cloner);
     78    }
     79
     80    private BestCapacitatedVRPSolutionAnalyzer(BestCapacitatedVRPSolutionAnalyzer original, Cloner cloner)
     81      : base(original, cloner) {
     82    }
     83
    7584    public override IOperation Apply() {
    7685      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/TimeWindowed/BestTimeWindowedVRPSolutionAnalyzer.cs

    r4454 r4752  
    2929using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3030using HeuristicLab.Problems.VehicleRouting.Variants;
     31using HeuristicLab.Common;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting {
     
    7778    }
    7879
     80    public override IDeepCloneable Clone(Cloner cloner) {
     81      return new BestTimeWindowedVRPSolutionAnalyzer(this, cloner);
     82    }
     83
     84    private BestTimeWindowedVRPSolutionAnalyzer(BestTimeWindowedVRPSolutionAnalyzer original, Cloner cloner)
     85      : base(original, cloner) {
     86    }
     87
    7988    public override IOperation Apply() {
    8089      ItemArray<IVRPEncoding> solutions = VRPToursParameter.ActualValue;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/VRPSolution.cs

    r4374 r4752  
    9999    }
    100100
     101
    101102    public override IDeepCloneable Clone(Cloner cloner) {
    102       VRPSolution clone = new VRPSolution();
    103       cloner.RegisterClonedObject(this, clone);
    104       clone.problemInstance = (IVRPProblemInstance)cloner.Clone(problemInstance);
    105       clone.solution = (IVRPEncoding)cloner.Clone(solution);
    106       clone.quality = (DoubleValue)cloner.Clone(quality);
    107      
    108       clone.Initialize();
    109       return clone;
     103      return new VRPSolution(this, cloner);
     104    }
     105
     106    private VRPSolution(VRPSolution original, Cloner cloner)
     107      : base(original, cloner) {
     108      this.problemInstance = (IVRPProblemInstance)cloner.Clone(original.problemInstance);
     109      this.solution = (IVRPEncoding)cloner.Clone(original.solution);
     110      this.quality = (DoubleValue)cloner.Clone(original.quality);
     111
     112      this.Initialize();
    110113    }
    111114
Note: See TracChangeset for help on using the changeset viewer.