Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/02/14 13:09:59 (10 years ago)
Author:
pfleck
Message:

#2208

  • Added distance and penalty visualization for orienteering solution.
  • Added Evaluate method in IOrienteeringEvaluator for evaluation of new best solutions (still need some design improvements).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering.Views/3.3/OrienteeringProblemView.cs

    r11325 r11327  
    6262        orienteeringSolutionView.Content = null;
    6363      } else {
    64         orienteeringSolutionView.Content = new OrienteeringSolution(
    65           Content.BestKnownSolution, Content.Coordinates, Content.StartingPointParameter.Value, Content.TerminalPointParameter.Value, Content.Scores, Content.BestKnownQuality, penalty: null);
     64        orienteeringSolutionView.Content = new OrienteeringSolution(Content.BestKnownSolution,
     65          Content.Coordinates, Content.StartingPointParameter.Value, Content.TerminalPointParameter.Value, Content.Scores);
     66        if (Content.BestKnownSolution != null) {
     67          EvaluateBestSolution();
     68        }
    6669      }
    6770    }
     
    8992    private void BestKnownSolutionParameter_ValueChanged(object sender, EventArgs e) {
    9093      orienteeringSolutionView.Content.IntegerVector = Content.BestKnownSolution;
     94      if (Content.BestKnownSolution != null)
     95        EvaluateBestSolution();
     96      else {
     97        var solution = orienteeringSolutionView.Content;
     98        solution.Penalty = null;
     99        solution.Distance = null;
     100      }
     101    }
     102
     103    private void EvaluateBestSolution() {
     104      var evaluation = Content.Evaluator.Evaluate(Content.BestKnownSolution, Content.Scores, Content.DistanceMatrix,
     105        Content.MaximumDistance, Content.PointVisitingCosts);
     106      orienteeringSolutionView.Content.Quality = evaluation.Quality;
     107      orienteeringSolutionView.Content.Penalty = evaluation.Penalty;
     108      orienteeringSolutionView.Content.Distance = evaluation.Distance;
    91109    }
    92110  }
Note: See TracChangeset for help on using the changeset viewer.