Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/03/10 11:15:22 (14 years ago)
Author:
svonolfe
Message:

Worked on the evaluators and on the project structure of the VRP plugin - WIP (#1177)

File:
1 copied

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPEvaluator.cs

    r4362 r4363  
    3131using HeuristicLab.Optimization;
    3232using HeuristicLab.PluginInfrastructure;
    33 using HeuristicLab.Problems.VehicleRouting.Interfaces.Variants;
     33using HeuristicLab.Problems.VehicleRouting.Variants;
    3434using HeuristicLab.Problems.VehicleRouting.Encodings;
    35 using HeuristicLab.Problems.VehicleRouting.DomainModel;
    3635
    37 namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances.Evaluation {
     36namespace HeuristicLab.Problems.VehicleRouting.ProblemInstances {
    3837  [Item("VRPEvaluator", "Represents a VRP evaluator.")]
    3938  [StorableClass]
     
    4443   
    4544    #region ISingleObjectiveEvaluator Members
    46 
    4745    public ILookupParameter<DoubleValue> QualityParameter {
    4846      get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    4947    }
     48    #endregion
    5049
    5150    public ILookupParameter<DoubleValue> DistanceParameter {
     
    5554      get { return (ILookupParameter<DoubleValue>)Parameters["VehiclesUtilized"]; }
    5655    }
    57 
    58     public ILookupParameter<DoubleValue> FleetUsageFactor {
    59       get { return (ILookupParameter<DoubleValue>)Parameters["EvalFleetUsageFactor"]; }
    60     }
    61     public ILookupParameter<DoubleValue> DistanceFactor {
    62       get { return (ILookupParameter<DoubleValue>)Parameters["EvalDistanceFactor"]; }
    63     }
    64 
    65     #endregion
    6656   
    6757    [StorableConstructor]
     
    7060    public VRPEvaluator() {
    7161      Parameters.Add(new LookupParameter<IVRPEncoding>("VRPTours", "The VRP tours which should be evaluated."));
    72 
    73       Parameters.Add(new LookupParameter<DoubleValue>("EvalFleetUsageFactor", "The fleet usage factor considered in the evaluation."));
    74       Parameters.Add(new LookupParameter<DoubleValue>("EvalDistanceFactor", "The distance factor considered in the evaluation."));
    7562
    7663      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the VRP solution."));
     
    8572    protected abstract void EvaluateTour(VRPEvaluation eval, IVRPProblemInstance instance, Tour tour);
    8673
    87     protected VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour) {
    88       VRPEvaluation evaluation = CreateTourEvaluation();
    89       EvaluateTour(evaluation, instance, tour);
    90       return evaluation;
    91     }
    92 
    9374    protected virtual void InitResultParameters() {
    9475      QualityParameter.ActualValue = new DoubleValue(0);
     
    10182      VehcilesUtilizedParameter.ActualValue.Value += tourEvaluation.VehicleUtilization;
    10283      DistanceParameter.ActualValue.Value += tourEvaluation.Distance;
     84    }
     85
     86    protected VRPEvaluation EvaluateTour(IVRPProblemInstance instance, Tour tour) {
     87      VRPEvaluation evaluation = CreateTourEvaluation();
     88      EvaluateTour(evaluation, instance, tour);
     89      return evaluation;
    10390    }
    10491
Note: See TracChangeset for help on using the changeset viewer.