Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/29/11 15:40:01 (14 years ago)
Author:
svonolfe
Message:

Merged changes from trunk into branch (#1177)

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

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/BestSolution/BestVRPSolutionAnalyzer.cs

    r5202 r5867  
    149149          validSolution = new VRPSolution(problemInstance, best.Clone() as IVRPEncoding, new DoubleValue(qualities[i].Value));
    150150          BestValidSolutionParameter.ActualValue = validSolution;
    151           results.Add(new Result("Best valid VRP Solution", validSolution));
     151          if (results.ContainsKey("Best valid VRP Solution"))
     152            results["Best valid VRP Solution"].Value = validSolution;
     153          else
     154            results.Add(new Result("Best valid VRP Solution", validSolution));
    152155        }
    153156      } else {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Analyzer/VRPSolution.cs

    r5127 r5867  
    3636  public sealed class VRPSolution : Item {
    3737    public override Image ItemImage {
    38       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Image; }
     38      get { return HeuristicLab.Common.Resources.VSImageLibrary.Image; }
    3939    }
    4040
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Crossovers/AlbaPermutationCrossover.cs

    r4752 r5867  
    5858      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5959        InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);
    60       op.Operator.Execute((IExecutionContext)op);
     60      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    6161
    6262      string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Manipulators/AlbaPermutationManipulator.cs

    r4752 r5867  
    5656      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5757        InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope);
    58       op.Operator.Execute((IExecutionContext)op);
     58      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    5959    }
    6060  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaIntraRouteInversionMove.cs

    r4752 r5867  
    3333  public class AlbaIntraRouteInversionMove : TwoIndexMove, IVRPMove {
    3434    public IVRPEncoding Individual { get { return Permutation as AlbaEncoding; } }
    35    
     35
     36    [StorableConstructor]
     37    protected AlbaIntraRouteInversionMove(bool deserializing) : base(deserializing) { }
     38
     39    protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner)
     40      : base(original, cloner) {
     41    }
     42
    3643    public AlbaIntraRouteInversionMove()
    3744      : base() {
     
    4350
    4451    public AlbaIntraRouteInversionMove(int index1, int index2, AlbaEncoding permutation)
    45       : base(index1, index2, permutation.Clone() as AlbaEncoding) {
     52      : base(index1, index2, null) {
     53        this.Permutation = permutation.Clone() as AlbaEncoding;
    4654     }
    4755
    4856    public override IDeepCloneable Clone(Cloner cloner) {
    4957      return new AlbaIntraRouteInversionMove(this, cloner);
    50     }
    51 
    52     protected AlbaIntraRouteInversionMove(AlbaIntraRouteInversionMove original, Cloner cloner)
    53       : base(original, cloner) {
    54         if (Permutation != null)
    55           this.Permutation = cloner.Clone(original.Permutation);
    5658    }
    5759
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionMutliMoveGenerator.cs

    r4752 r5867  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Common;
     32using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    3435  [Item("AlbaStochasticIntraRouteInversionMultiMoveGenerator", "Generates multiple random intra route inversion moves from a given VRP encoding.  It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")]
    3536  [StorableClass]
    36   public sealed class AlbaStochasticIntraRouteInversionMultiMoveGenerator : AlbaIntraRouteInversionMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaIntraRouteInversionMoveOperator {
     37  public sealed class AlbaStochasticIntraRouteInversionMultiMoveGenerator : AlbaIntraRouteInversionMoveGenerator, IStochasticOperator,
     38    IMultiMoveGenerator, IAlbaIntraRouteInversionMoveOperator, IMultiVRPMoveGenerator {
    3739    public ILookupParameter<IRandom> RandomParameter {
    3840      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/IntraRouteInversion/AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs

    r4752 r5867  
    3535  [StorableClass]
    3636  public sealed class AlbaStochasticIntraRouteInversionSingleMoveGenerator : AlbaIntraRouteInversionMoveGenerator,
    37     IStochasticOperator, ISingleMoveGenerator, IAlbaIntraRouteInversionMoveOperator, IMultiVRPMoveGenerator {
     37    IStochasticOperator, ISingleMoveGenerator, IAlbaIntraRouteInversionMoveOperator {
    3838    #region IMultiVRPMoveOperator Members
    3939
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs

    r4752 r5867  
    3030using HeuristicLab.Problems.VehicleRouting.Interfaces;
    3131using HeuristicLab.Common;
     32using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3233
    3334namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    3435  [Item("AlbaStochasticLambdaInterchangeMultiMoveGenerator", "Generates multiple random lambda interchange moves from a given VRP encoding.  It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")]
    3536  [StorableClass]
    36   public sealed class AlbaStochasticLambdaInterchangeMultiMoveGenerator : AlbaLambdaInterchangeMoveGenerator, IStochasticOperator, IMultiMoveGenerator, IAlbaLambdaInterchangeMoveOperator {
     37  public sealed class AlbaStochasticLambdaInterchangeMultiMoveGenerator : AlbaLambdaInterchangeMoveGenerator, IStochasticOperator,
     38    IMultiMoveGenerator, IAlbaLambdaInterchangeMoveOperator, IMultiVRPMoveGenerator {
    3739    public ILookupParameter<IRandom> RandomParameter {
    3840      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/LambdaInterchange/AlbaStochasticLambdaInterchangeSingleMoveGenerator.cs

    r5201 r5867  
    3535  [StorableClass]
    3636  public sealed class AlbaStochasticLambdaInterchangeSingleMoveGenerator : AlbaLambdaInterchangeMoveGenerator,
    37     IStochasticOperator, ISingleMoveGenerator, IAlbaLambdaInterchangeMoveOperator, IMultiVRPMoveGenerator {
     37    IStochasticOperator, ISingleMoveGenerator, IAlbaLambdaInterchangeMoveOperator {
    3838    #region IMultiVRPMoveOperator Members
    3939
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaStochasticTranslocationSingleMoveGenerator.cs

    r5130 r5867  
    3434  [Item("AlbaStochasticTranslocationSingleMoveGenerator", "An operator which generates a single translocation move for a VRP representation.  It is implemented as described in Alba, E. and Dorronsoro, B. (2004). Solving the Vehicle Routing Problem by Using Cellular Genetic Algorithms.")]
    3535  [StorableClass]
    36   public sealed class AlbaStochasticTranslocationSingleMoveGenerator : AlbaMoveGenerator, IAlbaTranslocationMoveOperator, IMultiVRPMoveGenerator {
     36  public sealed class AlbaStochasticTranslocationSingleMoveGenerator : AlbaMoveGenerator, IAlbaTranslocationMoveOperator {
    3737    [Storable]
    3838    private TranslocationMoveGenerator generator = new StochasticTranslocationSingleMoveGenerator();
     
    8080      generator.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    8181      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(generator);
    82       op.Operator.Execute((IExecutionContext)op);
     82      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    8383
    8484      foreach (IScope scope in this.ExecutionContext.Scope.SubScopes) {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r4752 r5867  
    101101      PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    102102      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter);
    103       op.Operator.Execute((IExecutionContext)op);
     103      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    104104
    105105      return next;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveHardTabuCriterion.cs

    r5130 r5867  
    7878    private AlbaTranslocationMoveHardTabuCriterion(AlbaTranslocationMoveHardTabuCriterion original, Cloner cloner)
    7979      : base(original, cloner) {
     80      tabuChecker = cloner.Clone(original.tabuChecker);
    8081    }
    8182
     
    8788      PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    8889      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter);
    89       op.Operator.Execute((IExecutionContext)op);
     90      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    9091
    9192      return next;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs

    r5130 r5867  
    6161    private AlbaTranslocationMoveMaker(AlbaTranslocationMoveMaker original, Cloner cloner)
    6262      : base(original, cloner) {
     63        moveMaker = cloner.Clone(original.moveMaker);
    6364    }
    6465
     
    7172      moveMaker.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    7273      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(moveMaker);
    73       op.Operator.Execute((IExecutionContext)op);
     74      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    7475    }
    7576  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveSoftTabuCriterion.cs

    r5130 r5867  
    7878    private AlbaTranslocationMoveSoftTabuCriterion(AlbaTranslocationMoveSoftTabuCriterion original, Cloner cloner)
    7979      : base(original, cloner) {
     80        tabuChecker = cloner.Clone(original.tabuChecker);
    8081    }
    8182
     
    8788      PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    8889      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter);
    89       op.Operator.Execute((IExecutionContext)op);
     90      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    9091
    9192      return next;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveTabuMaker.cs

    r5130 r5867  
    7878    private AlbaTranslocationMoveTabuMaker(AlbaTranslocationMoveTabuMaker original, Cloner cloner)
    7979      : base(original, cloner) {
     80        moveTabuMaker = cloner.Clone(original.moveTabuMaker);
    8081    }
    8182
     
    8788      PermutationMoveOperatorParameter.PermutationParameter.ActualName = VRPToursParameter.ActualName;
    8889      IAtomicOperation op = this.ExecutionContext.CreateChildOperation(PermutationMoveOperatorParameter);
    89       op.Operator.Execute((IExecutionContext)op);
     90      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    9091
    9192      return next;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveEvaluator.cs

    r4752 r5867  
    5858      moveEvaluator.VRPMoveParameter.ActualName = VRPMoveParameter.Name;
    5959      IAtomicOperation op = this.ExecutionContext.CreateOperation(moveEvaluator);
    60       op.Operator.Execute((IExecutionContext)op);
     60      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    6161    }
    6262  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/MultiVRPMoveOperator/MultiVRPMoveMaker.cs

    r4752 r5867  
    6060      moveMaker.VRPMoveParameter.ActualName = VRPMoveParameter.Name;
    6161      IAtomicOperation op = this.ExecutionContext.CreateOperation(moveMaker);
    62       op.Operator.Execute((IExecutionContext)op);
     62      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    6363    }
    6464  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveEvaluator.cs

    r5127 r5867  
    6464    //helper method to evaluate an updated individual
    6565    protected void UpdateEvaluation(IVRPEncoding updatedTours) {
    66       IVRPEvaluator evaluator = ProblemInstance.EvaluatorParameter.Value.Clone() as IVRPEvaluator;
    67 
    68       Dictionary<IParameter, string> originalName =
    69         new Dictionary<IParameter, string>();
    70 
    71       foreach (IParameter parameter in evaluator.Parameters) {
    72         if (parameter is ILookupParameter
    73           && parameter != evaluator.ProblemInstanceParameter
    74           && parameter != evaluator.VRPToursParameter) {
    75             originalName[parameter] = (parameter as ILookupParameter).ActualName;
    76 
    77             (parameter as ILookupParameter).ActualName =
    78               MovePrefix +
    79               (parameter as ILookupParameter).ActualName;
    80         }
    81       }
     66      IVRPEvaluator evaluator = ProblemInstance.MoveEvaluator;
    8267
    8368      try {
     
    8671
    8772        IAtomicOperation op = this.ExecutionContext.CreateChildOperation(evaluator);
    88         op.Operator.Execute((IExecutionContext)op);
     73        op.Operator.Execute((IExecutionContext)op, CancellationToken);
    8974      }
    9075      finally {
    91         foreach (IParameter parameter in originalName.Keys) {
    92           (parameter as ILookupParameter).ActualName = originalName[parameter];
    93         }
    94 
    9576        this.ExecutionContext.Scope.Variables.Remove(evaluator.VRPToursParameter.ActualName);
    9677      }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/TourEncoding.cs

    r5127 r5867  
    3434  public abstract class TourEncoding : Item, IVRPEncoding {
    3535    public override Image ItemImage {
    36       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Class; }
     36      get { return HeuristicLab.Common.Resources.VSImageLibrary.Class; }
    3737    }
    3838   
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Manipulators/PotvinTwoLevelExchangeManipulator.cs

    r4752 r5867  
    4444      : base(original, cloner) {
    4545    }
    46    
     46
    4747    protected override void Manipulate(IRandom random, PotvinEncoding individual) {
    4848      int selectedIndex = SelectRandomTourBiasedByLength(random, individual);
    49       Tour route1 =
    50         individual.Tours[selectedIndex];
     49      Tour route1 = individual.Tours[selectedIndex];
    5150
    52       for (int customer1Position = 0; customer1Position < route1.Stops.Count; customer1Position++) {
     51      bool performed = false;
     52      int customer1Position = 0;
     53      while (customer1Position < route1.Stops.Count) {
     54        performed = false;
     55
    5356        foreach (Tour tour in individual.Tours) {
    5457          if (tour != route1) {
     
    6063              tour.Stops[customer2Position] = customer1;
    6164              if (ProblemInstance.Feasible(tour)) {
    62                 int route, place;
     65                int routeIdx, place;
    6366                if (FindInsertionPlace(individual,
    64                   customer2, selectedIndex, out route, out place)) {
    65                     individual.Tours[route].Stops.Insert(place, customer2);
    66                     route1.Stops.RemoveAt(customer1Position);
     67                  customer2, selectedIndex, out routeIdx, out place)) {
     68                  individual.Tours[routeIdx].Stops.Insert(place, customer2);
     69                  route1.Stops.RemoveAt(customer1Position);
    6770
    68                     if (route1.Stops.Count == 0)
     71                  if (route1.Stops.Count == 0)
    6972                    individual.Tours.Remove(route1);
    7073
    7174                  //two-level exchange has been performed
    72                   return;
     75                  performed = true;
     76                  break;
    7377                } else {
    7478                  tour.Stops[customer2Position] = customer2;
     
    7983            }
    8084          }
     85
     86          if (performed)
     87            break;
    8188        }
     89
     90        if (!performed)
     91          customer1Position++;
    8292      }
    8393    }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveEvaluator.cs

    r5202 r5867  
    8585        string key = AdditionFrequencyMemoryKeyParameter.Value.Value;
    8686
    87         if (memory.ContainsKey(key)) {
     87        if (memory != null && memory.ContainsKey(key)) {
    8888          ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency =
    8989               memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMoveMaker.cs

    r5202 r5867  
    101101      PotvinCustomerRelocationMove move = CustomerRelocationMoveParameter.ActualValue;
    102102
    103       PotvinEncoding newSolution = move.Individual as PotvinEncoding;
     103      PotvinEncoding newSolution = move.Individual.Clone() as PotvinEncoding;
    104104      Apply(newSolution, move);
    105105      VRPToursParameter.ActualValue = newSolution;
     
    125125      string key = AdditionFrequencyMemoryKeyParameter.Value.Value;
    126126
    127       if (!memory.ContainsKey(key)) {
    128         memory.Add(new Variable(key,
    129             new ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>()));
     127      if (memory != null) {
     128        if (!memory.ContainsKey(key)) {
     129          memory.Add(new Variable(key,
     130              new ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>()));
     131        }
     132        ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency =
     133          memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>;
     134
     135        PotvinCustomerRelocationMoveAttribute attr = new PotvinCustomerRelocationMoveAttribute(0, move.Tour, move.City);
     136        if (!additionFrequency.ContainsKey(attr))
     137          additionFrequency[attr] = new IntValue(0);
     138
     139        additionFrequency[attr].Value++;
    130140      }
    131       ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue> additionFrequency =
    132         memory[key].Value as ItemDictionary<PotvinCustomerRelocationMoveAttribute, IntValue>;
    133 
    134       PotvinCustomerRelocationMoveAttribute attr = new PotvinCustomerRelocationMoveAttribute(0, move.Tour, move.City);
    135       if (!additionFrequency.ContainsKey(attr))
    136         additionFrequency[attr] = new IntValue(0);
    137 
    138       additionFrequency[attr].Value++;
    139141    }
    140142  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationMultiMoveGenerator.cs

    r5127 r5867  
    2929using HeuristicLab.Common;
    3030using HeuristicLab.Data;
     31using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Potvin {
    3334  [Item("PotvinCustomerRelocationMultiMoveGenerator", "Generates customer relocation moves from a given VRP encoding.")]
    3435  [StorableClass]
    35   public sealed class PotvinCustomerRelocationMultiMoveGenerator : PotvinCustomerRelocationMoveGenerator, IMultiMoveGenerator {
     36  public sealed class PotvinCustomerRelocationMultiMoveGenerator : PotvinCustomerRelocationMoveGenerator, IMultiMoveGenerator, IMultiVRPMoveGenerator {
    3637    public ILookupParameter<IRandom> RandomParameter {
    3738      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Potvin/Moves/CustomerRelocation/PotvinCustomerRelocationSingleMoveGenerator.cs

    r5127 r5867  
    3535  [StorableClass]
    3636  public sealed class PotvinCustomerRelocationSingleMoveGenerator : PotvinCustomerRelocationMoveGenerator,
    37     ISingleMoveGenerator, IMultiVRPMoveGenerator {
     37    ISingleMoveGenerator {
    3838    #region IMultiVRPMoveOperator Members
    3939
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Crossovers/PrinsPermutationCrossover.cs

    r4752 r5867  
    5858      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5959        InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);
    60       op.Operator.Execute((IExecutionContext)op);
     60      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    6161
    6262      string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsPermutationManipulator.cs

    r4752 r5867  
    5656      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5757        InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope);
    58       op.Operator.Execute((IExecutionContext)op);
     58      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    5959    }
    6060  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Crossovers/ZhuPermutationCrossover.cs

    r4752 r5867  
    5858      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5959        InnerCrossoverParameter.ActualValue, this.ExecutionContext.Scope);
    60       op.Operator.Execute((IExecutionContext)op);
     60      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    6161
    6262      string childName = InnerCrossoverParameter.ActualValue.ChildParameter.ActualName;
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Zhu/Manipulators/ZhuPermutationManipulator.cs

    r4752 r5867  
    5656      IAtomicOperation op = this.ExecutionContext.CreateOperation(
    5757        InnerManipulatorParameter.ActualValue, this.ExecutionContext.Scope);
    58       op.Operator.Execute((IExecutionContext)op);
     58      op.Operator.Execute((IExecutionContext)op, CancellationToken);
    5959    }
    6060  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r5127 r5867  
    1818    <UpgradeBackupLocation>
    1919    </UpgradeBackupLocation>
    20     <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
     20    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    2121    <PublishUrl>publish\</PublishUrl>
    2222    <Install>true</Install>
     
    3434    <UseApplicationTrust>false</UseApplicationTrust>
    3535    <BootstrapperEnabled>true</BootstrapperEnabled>
     36    <TargetFrameworkProfile />
    3637  </PropertyGroup>
    3738  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs

    r4860 r5867  
    3131  public interface IVRPProblemInstance: IItem {
    3232    IValueParameter<IVRPEvaluator> EvaluatorParameter { get; }
     33    IVRPEvaluator MoveEvaluator { get; }
    3334    IValueParameter<IVRPCreator> SolutionCreatorParameter { get; }
    3435    IValueParameter<DoubleValue> BestKnownQualityParameter { get; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r5127 r5867  
    3232using HeuristicLab.PluginInfrastructure;
    3333using HeuristicLab.Common;
     34using HeuristicLab.Problems.VehicleRouting.Encodings.General;
    3435
    3536namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
     
    3940    public IValueParameter<IVRPEvaluator> EvaluatorParameter {
    4041      get { return (ValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; }
     42    }
     43
     44    IVRPEvaluator moveEvaluator;
     45
     46    public IVRPEvaluator MoveEvaluator {
     47      get {
     48        if (EvaluatorParameter.Value == null)
     49          return null;
     50        else {
     51          if (moveEvaluator == null) {
     52            moveEvaluator = EvaluatorParameter.Value.Clone() as IVRPEvaluator;
     53
     54            foreach (IParameter parameter in moveEvaluator.Parameters) {
     55              if (parameter is ILookupParameter
     56                && parameter != moveEvaluator.ProblemInstanceParameter
     57                && parameter != moveEvaluator.VRPToursParameter) {
     58                (parameter as ILookupParameter).ActualName =
     59                  VRPMoveEvaluator.MovePrefix +
     60                  (parameter as ILookupParameter).ActualName;
     61              }
     62            }
     63          }
     64
     65          return moveEvaluator;
     66        }
     67      }
    4168    }
    4269
     
    253280
    254281    private void AttachEventHandlers() {
     282      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    255283      BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged);
    256284      DistanceFactorParameter.ValueChanged += new EventHandler(DistanceFactorParameter_ValueChanged);
     
    268296
    269297    #region Event handlers
     298    void EvaluatorParameter_ValueChanged(object sender, EventArgs e) {
     299      moveEvaluator = null;
     300    }
     301
    270302    void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
    271303      EvalBestKnownSolution();
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs

    r4860 r5867  
    4141  [Creatable("Problems")]
    4242  [StorableClass]
    43   public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjectiveProblem, IStorableContent {
     43  public sealed class VehicleRoutingProblem : ParameterizedNamedItem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent {
    4444    public string Filename { get; set; }
    4545   
    4646    public override Image ItemImage {
    47       get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; }
     47      get { return HeuristicLab.Common.Resources.VSImageLibrary.Type; }
    4848    }
    4949
     
    5252      get { return (ValueParameter<BoolValue>)Parameters["Maximization"]; }
    5353    }
    54     IParameter ISingleObjectiveProblem.MaximizationParameter {
     54    IParameter ISingleObjectiveHeuristicOptimizationProblem.MaximizationParameter {
    5555      get { return MaximizationParameter; }
    5656    }
     
    6161      get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
    6262    }
    63     IParameter ISingleObjectiveProblem.BestKnownQualityParameter {
     63    IParameter ISingleObjectiveHeuristicOptimizationProblem.BestKnownQualityParameter {
    6464      get { return BestKnownQualityParameter; }
    6565    }
     
    7070      get { return (IValueParameter<IVRPCreator>)Parameters["SolutionCreator"]; }
    7171    }
    72     IParameter IProblem.SolutionCreatorParameter {
     72    IParameter IHeuristicOptimizationProblem.SolutionCreatorParameter {
    7373      get { return SolutionCreatorParameter; }
    7474    }
     
    7676      get { return (IValueParameter<IVRPEvaluator>)Parameters["Evaluator"]; }
    7777    }
    78     IParameter IProblem.EvaluatorParameter {
     78    IParameter IHeuristicOptimizationProblem.EvaluatorParameter {
    7979      get { return EvaluatorParameter; }
    8080    }
     
    9696    }
    9797
    98     IEvaluator IProblem.Evaluator {
     98    IEvaluator IHeuristicOptimizationProblem.Evaluator {
    9999      get { return this.Evaluator; }
    100100    }
Note: See TracChangeset for help on using the changeset viewer.