Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/11 13:29:56 (13 years ago)
Author:
svonolfe
Message:

Updated interface of evaluator - added individual (#1177)

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

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPEvaluator.cs

    r6752 r6838  
    4747    }
    4848
    49     protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour) {
     49    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    5050      TourInsertionInfo tourInfo = new TourInsertionInfo();
    5151      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPPDTW/CVRPPDTWEvaluator.cs

    r6752 r6838  
    4747    }
    4848
    49     protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour) {
     49    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    5050      TourInsertionInfo tourInfo = new TourInsertionInfo();
    5151      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs

    r6752 r6838  
    5151    }
    5252
    53     protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour) {
     53    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    5454      TourInsertionInfo tourInfo = new TourInsertionInfo();
    5555      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPEvaluator.cs

    r6752 r6838  
    4040  [StorableClass]
    4141  public class SingleDepotVRPEvaluator: VRPEvaluator {
    42     protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour) {
     42    protected override void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
    4343      TourInsertionInfo tourInfo = new TourInsertionInfo();
    4444      eval.InsertionInfo.AddTourInsertionInfo(tourInfo);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs

    r6752 r6838  
    8181    }
    8282
    83     protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour);
     83    protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour, IVRPEncoding solution);
    8484
    8585    protected virtual void InitResultParameters() {
     
    9595      DistanceParameter.ActualValue.Value = tourEvaluation.Distance;
    9696      PenaltyParameter.ActualValue.Value = tourEvaluation.Penalty;
    97     }
    98 
    99     private VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour) {
    100       VRPEvaluation evaluation = CreateTourEvaluation();
    101       EvaluateTour(evaluation, instance, tour);
    102       return evaluation;
    10397    }
    10498
     
    123117    }
    124118
     119    public VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour, IVRPEncoding solution) {
     120      VRPEvaluation evaluation = CreateTourEvaluation();
     121      EvaluateTour(evaluation, instance, tour, solution);
     122      return evaluation;
     123    }
     124
    125125    public VRPEvaluation Evaluate(IVRPProblemInstance instance, IVRPEncoding solution) {
    126126      VRPEvaluation evaluation = CreateTourEvaluation();
    127127
    128128      foreach (Tour tour in solution.GetTours()) {
    129         EvaluateTour(evaluation, instance, tour);
     129        EvaluateTour(evaluation, instance, tour, solution);
    130130      }
    131131
    132132      return evaluation;
    133     }
    134 
    135     public VRPEvaluation Evaluate(IVRPProblemInstance instance, Tour tour) {
    136       return EvaluateTour(instance, tour);
    137133    }
    138134
     
    141137
    142138      VRPEvaluation evaluation = CreateTourEvaluation();
    143       foreach (Tour tour in VRPToursParameter.ActualValue.GetTours()) {
    144         EvaluateTour(evaluation, ProblemInstance, tour);
     139      IVRPEncoding solution = VRPToursParameter.ActualValue;
     140      foreach (Tour tour in solution.GetTours()) {
     141        EvaluateTour(evaluation, ProblemInstance, tour, solution);
    145142      }
    146143      SetResultParameters(evaluation);
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r6752 r6838  
    212212    }
    213213
    214     public bool Feasible(Tour tour) {
     214    public bool TourFeasible(Tour tour, IVRPEncoding solution) {
    215215      return evaluator.Feasible(
    216         evaluator.Evaluate(
    217         this, tour));
     216        evaluator.EvaluateTour(
     217        this, tour, solution));
    218218    }
    219219
     
    222222    }
    223223
    224     public VRPEvaluation Evaluate(Tour tour) {
    225       return evaluator.Evaluate(this, tour);
     224    public VRPEvaluation EvaluateTour(Tour tour, IVRPEncoding solution) {
     225      return evaluator.EvaluateTour(this, tour, solution);
    226226    }
    227227
Note: See TracChangeset for help on using the changeset viewer.