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:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Problems.VehicleRouting

  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestAverageWorstVRPToursAnalyzer.cs

    r4416 r4722  
    2121
    2222using System;
     23using HeuristicLab.Analysis;
    2324using HeuristicLab.Common;
    2425using HeuristicLab.Core;
     
    2930using HeuristicLab.Parameters;
    3031using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    31 using HeuristicLab.Analysis;
    3232
    3333namespace HeuristicLab.Problems.VehicleRouting {
     
    150150    public BestAverageWorstVRPToursAnalyzer()
    151151      : base() {
    152       #region Create parameters     
     152      #region Create parameters
    153153      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Overload", "The overloads of the VRP solutions which should be analyzed."));
    154154      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestOverload", "The best overload value."));
     
    157157      Parameters.Add(new ValueLookupParameter<DoubleValue>("CurrentWorstOverload", "The current worst overload value of all solutions."));
    158158      Parameters.Add(new ValueLookupParameter<DataTable>("Overloads", "The data table to store the current best, current average, current worst, best and best known overload value."));
    159  
     159
    160160      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Tardiness", "The tardiness of the VRP solutions which should be analyzed."));
    161161      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestTardiness", "The best tardiness value."));
     
    311311    [StorableConstructor]
    312312    private BestAverageWorstVRPToursAnalyzer(bool deserializing) : base() { }
     313    private BestAverageWorstVRPToursAnalyzer(BestAverageWorstVRPToursAnalyzer original, Cloner cloner)
     314      : base(original, cloner) {
     315      Initialize();
     316    }
     317    public override IDeepCloneable Clone(Cloner cloner) {
     318      return new BestAverageWorstVRPToursAnalyzer(this, cloner);
     319    }
    313320
    314321    [StorableHook(HookType.AfterDeserialization)]
     322    private void AfterDeserialization() {
     323      Initialize();
     324    }
    315325    private void Initialize() {
    316326      OverloadParameter.DepthChanged += new EventHandler(OverloadParameter_DepthChanged);
     
    321331    }
    322332
    323     public override IDeepCloneable Clone(Cloner cloner) {
    324       BestAverageWorstVRPToursAnalyzer clone = (BestAverageWorstVRPToursAnalyzer)base.Clone(cloner);
    325       clone.Initialize();
    326       return clone;
    327     }
    328333
    329334    void OverloadParameter_DepthChanged(object sender, EventArgs e) {
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestAverageWorstVRPToursCalculator.cs

    r4352 r4722  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324using HeuristicLab.Data;
     
    9596    }
    9697
     98    [StorableConstructor]
     99    private BestAverageWorstVRPToursCalculator(bool deserializing) : base(deserializing) { }
     100    private BestAverageWorstVRPToursCalculator(BestAverageWorstVRPToursCalculator original, Cloner cloner)
     101      : base(original, cloner) {
     102    }
    97103    public BestAverageWorstVRPToursCalculator()
    98104      : base() {
     
    123129    }
    124130
     131    public override IDeepCloneable Clone(Cloner cloner) {
     132      return new BestAverageWorstVRPToursCalculator(this, cloner);
     133    }
     134
    125135    private void UpdateOverloads() {
    126136      ItemArray<DoubleValue> overloads = OverloadParameter.ActualValue;
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPSolutionAnalyzer.cs

    r4513 r4722  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    8384    [StorableConstructor]
    8485    private BestVRPSolutionAnalyzer(bool deserializing) : base(deserializing) { }
    85 
     86    private BestVRPSolutionAnalyzer(BestVRPSolutionAnalyzer original, Cloner cloner)
     87      : base(original, cloner) {
     88    }
    8689    public BestVRPSolutionAnalyzer()
    8790      : base() {
     
    102105      Parameters.Add(new LookupParameter<VRPSolution>("BestSolution", "The best VRP solution."));
    103106      Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best VRP solution should be stored."));
     107    }
     108
     109    public override IDeepCloneable Clone(Cloner cloner) {
     110      return new BestVRPSolutionAnalyzer(this, cloner);
    104111    }
    105112
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Analyzers/BestVRPToursMemorizer.cs

    r4352 r4722  
    2121
    2222using System.Linq;
     23using HeuristicLab.Common;
    2324using HeuristicLab.Core;
    2425using HeuristicLab.Data;
     
    6364    }
    6465
     66    [StorableConstructor]
     67    protected BestVRPToursMemorizer(bool deserializing) : base(deserializing) { }
     68    protected BestVRPToursMemorizer(BestVRPToursMemorizer original, Cloner cloner)
     69      : base(original, cloner) {
     70    }
    6571    public BestVRPToursMemorizer()
    6672      : base() {
     
    7783      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestVehiclesUtilized", "The best vehicles utilized found so far."));
    7884 
     85    }
     86
     87    public override IDeepCloneable Clone(Cloner cloner) {
     88      return new BestVRPToursMemorizer(this, cloner);
    7989    }
    8090
Note: See TracChangeset for help on using the changeset viewer.