Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11321


Ignore:
Timestamp:
09/01/14 12:15:49 (10 years ago)
Author:
pfleck
Message:

#2208

  • Added IOrienteeringEvaluator interface
  • Defined parameters in IOrienteeringEvaluator
Location:
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs

    r11320 r11321  
    3636points from this list at the first position in which they can feasibly be inserted. (Schilde et. al. 2009)")]
    3737  [StorableClass]
    38   public sealed class GreedyOrienteeringTourCreator : IntegerVectorCreator {
     38  public sealed class GreedyOrienteeringTourCreator : IntegerVectorCreator, IOrienteeringSolutionCreator {
    3939    public override bool CanChangeName { get { return false; } }
    4040
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj

    r11305 r11321  
    8888    <Compile Include="Interfaces\IOrienteeringEvaluator.cs" />
    8989    <Compile Include="Evaluators\OrienteeringEvaluator.cs" />
     90    <Compile Include="Interfaces\IOrienteeringSolutionCreator.cs" />
    9091    <Compile Include="OrienteeringProblem.cs" />
    9192    <Compile Include="OrienteeringScript.cs" />
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Interfaces/IOrienteeringEvaluator.cs

    r11186 r11321  
    2020#endregion
    2121
     22using HeuristicLab.Core;
     23using HeuristicLab.Data;
     24using HeuristicLab.Encodings.IntegerVectorEncoding;
    2225using HeuristicLab.Optimization;
    2326
    2427namespace HeuristicLab.Problems.Orienteering {
    25   public interface IOrienteeringEvaluator : ISingleObjectiveEvaluator { }
     28  public interface IOrienteeringEvaluator : ISingleObjectiveEvaluator {
     29    ILookupParameter<IntegerVector> IntegerVectorParameter { get; }
     30    ILookupParameter<DoubleArray> ScoresParameter { get; }
     31    ILookupParameter<DistanceMatrix> DistanceMatrixParameter { get; }
     32    ILookupParameter<DoubleValue> MaximumDistanceParameter { get; }
     33    ILookupParameter<DoubleValue> PointVisitingCostsParameter { get; }
     34    ILookupParameter<DoubleValue> PenaltyParameter { get; }
     35  }
    2636}
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs

    r11320 r11321  
    3939  [StorableClass]
    4040  public sealed class OrienteeringProblem
    41     : SingleObjectiveHeuristicOptimizationProblem<IOrienteeringEvaluator, IIntegerVectorCreator>,
     41    : SingleObjectiveHeuristicOptimizationProblem<IOrienteeringEvaluator, IOrienteeringSolutionCreator>,
    4242    IStorableContent, IProblemInstanceConsumer<OPData>, IProblemInstanceConsumer<TSPData>, IProblemInstanceConsumer<CVRPData> {
    4343
     
    235235
    236236    private void ParameterizeSolutionCreator() {
    237       if (SolutionCreator is GreedyOrienteeringTourCreator) {
    238         var creator = (GreedyOrienteeringTourCreator)SolutionCreator;
    239         creator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
    240         creator.ScoresParameter.ActualName = ScoresParameter.Name;
    241         creator.MaximumDistanceParameter.ActualName = MaximumDistanceParameter.Name;
    242         creator.StartingPointParameter.ActualName = StartingPointParameter.Name;
    243         creator.TerminalPointParameter.ActualName = TerminalPointParameter.Name;
    244         creator.PointVisitingCostsParameter.ActualName = PointVisitingCostsParameter.Name;
    245       }
     237      SolutionCreator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
     238      SolutionCreator.ScoresParameter.ActualName = ScoresParameter.Name;
     239      SolutionCreator.MaximumDistanceParameter.ActualName = MaximumDistanceParameter.Name;
     240      SolutionCreator.StartingPointParameter.ActualName = StartingPointParameter.Name;
     241      SolutionCreator.TerminalPointParameter.ActualName = TerminalPointParameter.Name;
     242      SolutionCreator.PointVisitingCostsParameter.ActualName = PointVisitingCostsParameter.Name;
    246243    }
    247244    private void ParameterizeEvaluator() {
    248       if (Evaluator is OrienteeringEvaluator) {
    249         var evaluator = (OrienteeringEvaluator)Evaluator;
    250         evaluator.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
    251         evaluator.ScoresParameter.ActualName = ScoresParameter.Name;
    252       }
     245      Evaluator.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
     246      Evaluator.ScoresParameter.ActualName = ScoresParameter.Name;
     247      Evaluator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
     248      Evaluator.MaximumDistanceParameter.ActualName = MaximumDistanceParameter.Name;
     249      Evaluator.PointVisitingCostsParameter.ActualName = PointVisitingCostsParameter.Name;
    253250    }
    254251    private void ParameterizeAnalyzer() {
Note: See TracChangeset for help on using the changeset viewer.