Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/10 17:26:26 (14 years ago)
Author:
svonolfe
Message:

Added analyzers and views (#1177)

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

Legend:

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

    r4363 r4374  
    5252      set { OverloadPenaltyParameter.Value = value; }
    5353    }
    54    
    55     public override IEnumerable<IOperator> Operators {
    56       get {
    57         return base.Operators
     54
     55    protected override IEnumerable<IOperator> GetOperators() {
     56        return base.GetOperators()
    5857          .Where(o => o is ICapacitatedOperator).Cast<IOperator>();
    59       }
     58    }
     59
     60    protected override IEnumerable<IOperator> GetAnalyzers() {
     61      return ApplicationManager.Manager.GetInstances<ICapacitatedOperator>()
     62        .Where(o => o is IAnalyzer)
     63        .Cast<IOperator>().Union(base.GetAnalyzers());
    6064    }
    6165
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWEvaluator.cs

    r4363 r4374  
    4040    public ILookupParameter<DoubleValue> TardinessParameter {
    4141      get { return (ILookupParameter<DoubleValue>)Parameters["Tardiness"]; }
     42    }
     43
     44    public ILookupParameter<DoubleValue> TravelTimeParameter {
     45      get { return (ILookupParameter<DoubleValue>)Parameters["TravelTime"]; }
    4246    }
    4347
     
    8791
    8892      (eval as CVRPTWEvaluation).Tardiness = tardiness;
     93      (eval as CVRPTWEvaluation).TravelTime = time;
     94
    8995      double penalty = tardiness * vrptw.TardinessPenalty.Value;
    9096      eval.Penalty += penalty;
     
    97103
    98104      TardinessParameter.ActualValue = new DoubleValue(0);
     105      TravelTimeParameter.ActualValue = new DoubleValue(0);
    99106    }
    100107
     
    103110
    104111      TardinessParameter.ActualValue.Value += (tourEvaluation as CVRPTWEvaluation).Tardiness;
     112      TravelTimeParameter.ActualValue.Value += (tourEvaluation as CVRPTWEvaluation).TravelTime;
    105113    }
    106114   
     
    110118    public CVRPTWEvaluator() {
    111119      Parameters.Add(new LookupParameter<DoubleValue>("Tardiness", "The tardiness."));
     120      Parameters.Add(new LookupParameter<DoubleValue>("TravelTime", "The travel time."));
    112121    }
    113122  }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/CVRP/CVRPTW/CVRPTWProblemInstance.cs

    r4363 r4374  
    7474      set { TardinessPenaltyParameter.Value = value; }
    7575    }
    76    
    77     public override IEnumerable<IOperator> Operators {
    78       get {
    79         return base.Operators
    80           .Where(o => o is ITimeWindowedOperator).Cast<IOperator>();
    81       }
     76
     77    protected override IEnumerable<IOperator> GetOperators() {
     78      return base.GetOperators()
     79        .Where(o => o is ITimeWindowedOperator).Cast<IOperator>();
    8280    }
    8381
     82    protected override IEnumerable<IOperator> GetAnalyzers() {
     83      return ApplicationManager.Manager.GetInstances<ITimeWindowedOperator>()
     84        .Where(o => o is IAnalyzer)
     85        .Cast<IOperator>().Union(base.GetAnalyzers());
     86    }
     87   
    8488    protected override IVRPEvaluator Evaluator {
    8589      get {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/SingleDepotVRP/SingleDepotVRPProblemInstance.cs

    r4365 r4374  
    3737  [StorableClass]
    3838  public class SingleDepotVRPProblemInstance: VRPProblemInstance, ISingleDepotProblemInstance {
    39     public override IEnumerable<IOperator> Operators {
    40       get {
    41         return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
    42       }
     39    protected override IEnumerable<IOperator> GetOperators() {
     40      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>().Cast<IOperator>();
     41    }
     42
     43    protected override IEnumerable<IOperator> GetAnalyzers() {
     44      return ApplicationManager.Manager.GetInstances<ISingleDepotOperator>()
     45        .Where(o => o is IAnalyzer)
     46        .Cast<IOperator>();
    4347    }
    4448
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs

    r4365 r4374  
    4444    }
    4545
    46     public abstract IEnumerable<IOperator> Operators { get; }
     46    protected abstract IEnumerable<IOperator> GetOperators();
     47    protected abstract IEnumerable<IOperator> GetAnalyzers();
     48
     49    public IEnumerable<IOperator> Operators {
     50      get {
     51        return GetOperators().Union(GetAnalyzers());
     52      }
     53    }
    4754   
    4855    protected ValueParameter<DoubleMatrix> CoordinatesParameter {
Note: See TracChangeset for help on using the changeset viewer.