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/Encodings/General/Creators/DefaultRepresentationCreator.cs

    r4183 r4722  
    2020#endregion
    2121
     22using System.Collections.Generic;
     23using HeuristicLab.Common;
    2224using HeuristicLab.Core;
    23 using HeuristicLab.Data;
    24 using HeuristicLab.Operators;
    25 using HeuristicLab.Parameters;
    2625using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    27 using System.Collections.Generic;
    28 using HeuristicLab.Problems.VehicleRouting.Encodings;
    29 using HeuristicLab.Problems.VehicleRouting.Encodings.Alba;
    3026using HeuristicLab.Problems.VehicleRouting.Encodings.Potvin;
    3127
     
    3834    [StorableConstructor]
    3935    protected DefaultRepresentationCreator(bool deserializing) : base(deserializing) { }
     36    protected DefaultRepresentationCreator(DefaultRepresentationCreator original, Cloner cloner) : base(original, cloner) { }
    4037
    4138    public DefaultRepresentationCreator() : base() { }
     
    4643
    4744      return base.Apply();
    48     }   
     45    }
    4946  }
    5047}
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/MultiVRPSolutionCreator.cs

    r4352 r4722  
    2323using System.Linq;
    2424using HeuristicLab.Collections;
     25using HeuristicLab.Common;
    2526using HeuristicLab.Core;
     27using HeuristicLab.Data;
    2628using HeuristicLab.Operators;
    2729using HeuristicLab.Optimization;
     
    2931using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3032using HeuristicLab.PluginInfrastructure;
    31 using HeuristicLab.Data;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting.Encodings.General {
     
    7879
    7980    [StorableConstructor]
    80     private MultiVRPSolutionCreator(bool deserializing) : base(deserializing) { }
     81    protected MultiVRPSolutionCreator(bool deserializing) : base(deserializing) { }
     82    protected MultiVRPSolutionCreator(MultiVRPSolutionCreator original, Cloner cloner) : base(original, cloner) { }
     83    public override IDeepCloneable Clone(Cloner cloner) {
     84      return new MultiVRPSolutionCreator(this, cloner);
     85    }
     86
    8187    public MultiVRPSolutionCreator()
    8288      : base() {
    83         Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours."));
     89      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The new VRP tours."));
    8490
    85         Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count."));
    86         Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates of the cities."));
    87         Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
    88         Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false."));
    89         Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles."));
    90         Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle."));
    91         Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer."));
    92         Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer."));
    93         Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer."));
    94         Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
     91      Parameters.Add(new ValueLookupParameter<IntValue>("Cities", "The city count."));
     92      Parameters.Add(new LookupParameter<DoubleMatrix>("Coordinates", "The coordinates of the cities."));
     93      Parameters.Add(new LookupParameter<DoubleMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
     94      Parameters.Add(new LookupParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false."));
     95      Parameters.Add(new LookupParameter<IntValue>("Vehicles", "The number of vehicles."));
     96      Parameters.Add(new LookupParameter<DoubleValue>("Capacity", "The capacity of each vehicle."));
     97      Parameters.Add(new LookupParameter<DoubleArray>("Demand", "The demand of each customer."));
     98      Parameters.Add(new LookupParameter<DoubleArray>("ReadyTime", "The ready time of each customer."));
     99      Parameters.Add(new LookupParameter<DoubleArray>("DueTime", "The due time of each customer."));
     100      Parameters.Add(new LookupParameter<DoubleArray>("ServiceTime", "The service time of each customer."));
    95101
    96         foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(IVRPCreator)).OrderBy(op => op.Name)) {
    97           if (!typeof(MultiOperator<IVRPCreator>).IsAssignableFrom(type))
    98             Operators.Add((IVRPCreator)Activator.CreateInstance(type), true);
     102      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(IVRPCreator)).OrderBy(op => op.Name)) {
     103        if (!typeof(MultiOperator<IVRPCreator>).IsAssignableFrom(type))
     104          Operators.Add((IVRPCreator)Activator.CreateInstance(type), true);
    99105      }
    100106    }
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/PushForwardInsertionCreator.cs

    r4352 r4722  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526using HeuristicLab.Data;
    26 using HeuristicLab.Encodings.PermutationEncoding;
    2727using HeuristicLab.Optimization;
    2828using HeuristicLab.Parameters;
     
    6060    [StorableConstructor]
    6161    private PushForwardCreator(bool deserializing) : base(deserializing) { }
     62    private PushForwardCreator(PushForwardCreator original, Cloner cloner) : base(original, cloner) { }
     63    public override IDeepCloneable Clone(Cloner cloner) {
     64      return new PushForwardCreator(this, cloner);
     65    }
    6266
    6367    public PushForwardCreator()
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/General/Creators/RandomCreator.cs

    r4183 r4722  
    2020#endregion
    2121
    22 using System;
    2322using System.Collections.Generic;
     23using HeuristicLab.Common;
    2424using HeuristicLab.Core;
    25 using HeuristicLab.Data;
    26 using HeuristicLab.Encodings.PermutationEncoding;
    2725using HeuristicLab.Optimization;
    2826using HeuristicLab.Parameters;
     
    4139    [StorableConstructor]
    4240    private RandomCreator(bool deserializing) : base(deserializing) { }
     41    private RandomCreator(RandomCreator original, Cloner cloner) : base(original, cloner) { }
     42    public override IDeepCloneable Clone(Cloner cloner) {
     43      return new RandomCreator(this, cloner);
     44    }
    4345
    4446    public RandomCreator()
Note: See TracChangeset for help on using the changeset viewer.