Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/27/10 16:00:18 (14 years ago)
Author:
svonolfe
Message:

Improved VRP evaluation (#1177)

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

Legend:

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

    r4378 r4520  
    9393    }
    9494
    95     protected override void UpdateResultParameters(VRPEvaluation tourEvaluation) {
    96       base.UpdateResultParameters(tourEvaluation);
     95    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
     96      base.SetResultParameters(tourEvaluation);
    9797
    98       OverloadParameter.ActualValue.Value += (tourEvaluation as CVRPEvaluation).Overload;
     98      OverloadParameter.ActualValue.Value = (tourEvaluation as CVRPEvaluation).Overload;
    9999    }
    100100   
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs

    r4378 r4520  
    130130    }
    131131
    132     protected override void UpdateResultParameters(VRPEvaluation tourEvaluation) {
    133       base.UpdateResultParameters(tourEvaluation);
     132    protected override void SetResultParameters(VRPEvaluation tourEvaluation) {
     133      base.SetResultParameters(tourEvaluation);
    134134
    135       TardinessParameter.ActualValue.Value += (tourEvaluation as CVRPTWEvaluation).Tardiness;
    136       TravelTimeParameter.ActualValue.Value += (tourEvaluation as CVRPTWEvaluation).TravelTime;
     135      TardinessParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).Tardiness;
     136      TravelTimeParameter.ActualValue.Value = (tourEvaluation as CVRPTWEvaluation).TravelTime;
    137137    }
    138138   
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs

    r4378 r4520  
    7878    }
    7979
    80     protected virtual void UpdateResultParameters(VRPEvaluation tourEvaluation) {
    81       QualityParameter.ActualValue.Value += tourEvaluation.Quality;
    82       VehcilesUtilizedParameter.ActualValue.Value += tourEvaluation.VehicleUtilization;
    83       DistanceParameter.ActualValue.Value += tourEvaluation.Distance;
     80    protected virtual void SetResultParameters(VRPEvaluation tourEvaluation) {
     81      QualityParameter.ActualValue.Value = tourEvaluation.Quality;
     82      VehcilesUtilizedParameter.ActualValue.Value = tourEvaluation.VehicleUtilization;
     83      DistanceParameter.ActualValue.Value = tourEvaluation.Distance;
    8484    }
    8585
     
    111111
    112112    public override IOperation Apply() {
    113       double quality = 0;
    114113      InitResultParameters();
    115114
     115      VRPEvaluation evaluation = CreateTourEvaluation();
    116116      foreach (Tour tour in VRPToursParameter.ActualValue.GetTours()) {
    117         VRPEvaluation tourEvaluation = EvaluateTour(ProblemInstance, tour);
    118         quality += tourEvaluation.Quality;
     117        EvaluateTour(evaluation, ProblemInstance, tour);
     118      }
     119      SetResultParameters(evaluation);
    119120
    120         UpdateResultParameters(tourEvaluation);
    121       }
    122 
    123       QualityParameter.ActualValue = new DoubleValue(quality);
     121      QualityParameter.ActualValue = new DoubleValue(evaluation.Quality);
    124122
    125123      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.