Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4374 for branches/VRP


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

Added analyzers and views (#1177)

Location:
branches/VRP
Files:
28 added
7 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/HeuristicLab.Problems.VehicleRouting.Views-3.4.csproj

    r4362 r4374  
    111111  </ItemGroup>
    112112  <ItemGroup>
     113    <Compile Include="CVRPTWView.cs">
     114      <SubType>UserControl</SubType>
     115    </Compile>
     116    <Compile Include="CVRPTWView.Designer.cs">
     117      <DependentUpon>CVRPTWView.cs</DependentUpon>
     118    </Compile>
    113119    <Compile Include="HeuristicLabProblemsVehicleRoutingViewsPlugin.cs" />
    114120    <Compile Include="Properties\AssemblyInfo.cs" />
     121    <Compile Include="SingleDepotVRPView.cs">
     122      <SubType>UserControl</SubType>
     123    </Compile>
     124    <Compile Include="SingleDepotVRPView.Designer.cs">
     125      <DependentUpon>SingleDepotVRPView.cs</DependentUpon>
     126    </Compile>
     127    <Compile Include="VRPProblemInstanceView.cs">
     128      <SubType>UserControl</SubType>
     129    </Compile>
     130    <Compile Include="VRPProblemInstanceView.Designer.cs">
     131      <DependentUpon>VRPProblemInstanceView.cs</DependentUpon>
     132    </Compile>
    115133    <Compile Include="VehicleRoutingProblemView.cs">
    116134      <SubType>UserControl</SubType>
     
    118136    <Compile Include="VehicleRoutingProblemView.Designer.cs">
    119137      <DependentUpon>VehicleRoutingProblemView.cs</DependentUpon>
     138    </Compile>
     139    <Compile Include="VRPSolutionView.cs">
     140      <SubType>UserControl</SubType>
     141    </Compile>
     142    <Compile Include="VRPSolutionView.Designer.cs">
     143      <DependentUpon>VRPSolutionView.cs</DependentUpon>
    120144    </Compile>
    121145  </ItemGroup>
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r4370 r4374  
    106106  </ItemGroup>
    107107  <ItemGroup>
     108    <Compile Include="Analyzer\BestAverageWorstTours\BestAverageWorstVRPToursAnalyzer.cs" />
     109    <Compile Include="Analyzer\BestAverageWorstTours\BestAverageWorstVRPToursCalculator.cs" />
     110    <Compile Include="Analyzer\BestAverageWorstTours\BestVRPToursMemorizer.cs" />
     111    <Compile Include="Analyzer\BestAverageWorstTours\Capacitated\BestAverageWorstCapacitatedVRPToursAnalyzer.cs" />
     112    <Compile Include="Analyzer\BestAverageWorstTours\Capacitated\BestAverageWorstCapacitatedVRPToursCalculator.cs" />
     113    <Compile Include="Analyzer\BestAverageWorstTours\Capacitated\BestCapacitatedVRPToursMemorizer.cs" />
     114    <Compile Include="Analyzer\BestAverageWorstTours\TimeWindowed\BestAverageWorstTimeWindowedVRPToursAnalyzer.cs" />
     115    <Compile Include="Analyzer\BestAverageWorstTours\TimeWindowed\BestAverageWorstTimeWindowedVRPToursCalculator.cs" />
     116    <Compile Include="Analyzer\BestAverageWorstTours\TimeWindowed\BestTimeWindowedVRPToursMemorizer.cs" />
     117    <Compile Include="Analyzer\BestSolution\BestVRPSolutionAnalyzer.cs" />
     118    <Compile Include="Analyzer\BestSolution\Capacitated\BestCapacitatedVRPSolutionAnalyzer.cs" />
     119    <Compile Include="Analyzer\BestSolution\TimeWindowed\BestTimeWindowedVRPSolutionAnalyzer.cs" />
     120    <Compile Include="Analyzer\VRPSolution.cs" />
    108121    <Compile Include="Encodings\Alba\AlbaEncoding.cs" />
    109122    <Compile Include="Encodings\Alba\Creators\DefaultRepresentationCreator.cs" />
  • 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.