Index: /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs
===================================================================
--- /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs	(revision 11191)
+++ /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Creators/GreedyOrienteeringTourCreator.cs	(revision 11191)
@@ -0,0 +1,152 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Problems.Orienteering {
+  [Item("GreedyOrienteeringTourCreator", @"The initial solution for P-VNS is generated by means of a greedy algorithm that takes into
+account all vertices vi that are located within the cost limit Tmax. These points are sorted
+in descending order regarding the sum of their objective values. Afterwards, the algorithm
+starts with a tour only including the starting and ending point and successively inserts the
+points from this list at the first position in which they can feasibly be inserted. (Schilde et. al. 2009)")]
+  [StorableClass]
+  public class GreedyOrienteeringTourCreator : IntegerVectorCreator {
+    public override bool CanChangeName { get { return false; } }
+
+    #region Parameter Properties
+    public ILookupParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ILookupParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
+    }
+    public ILookupParameter<DoubleArray> ScoresParameter {
+      get { return (ILookupParameter<DoubleArray>)Parameters["Scores"]; }
+    }
+    public ILookupParameter<DoubleValue> MaximumDistanceParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["MaximumDistance"]; }
+    }
+    public ILookupParameter<IntValue> StartingPointParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["StartingPoint"]; }
+    }
+    public ILookupParameter<IntValue> TerminusPointParameter {
+      get { return (ILookupParameter<IntValue>)Parameters["TerminusPoint"]; }
+    }
+    public ILookupParameter<DoubleValue> FixedPenaltyParameter {
+      get { return (ILookupParameter<DoubleValue>)Parameters["FixedPenalty"]; }
+    }
+    #endregion
+
+    [StorableConstructor]
+    protected GreedyOrienteeringTourCreator(bool deserializing)
+      : base(deserializing) { }
+    protected GreedyOrienteeringTourCreator(GreedyOrienteeringTourCreator original, Cloner cloner)
+      : base(original, cloner) { }
+
+    public GreedyOrienteeringTourCreator()
+      : base() {
+      Parameters.Add(new LookupParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points."));
+      Parameters.Add(new LookupParameter<DoubleArray>("Scores", "The scores of the points."));
+      Parameters.Add(new LookupParameter<DoubleValue>("MaximumDistance", "The maximum distance constraint for a Orienteering solution."));
+      Parameters.Add(new LookupParameter<IntValue>("StartingPoint", "Index of the starting point."));
+      Parameters.Add(new LookupParameter<IntValue>("TerminusPoint", "Index of the ending point."));
+      Parameters.Add(new LookupParameter<DoubleValue>("FixedPenalty", "The penalty for each visited vertex."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new GreedyOrienteeringTourCreator(this, cloner);
+    }
+
+    protected override IntegerVector Create(IRandom _, IntValue __, IntMatrix ___) {
+      int startPoint = StartingPointParameter.ActualValue.Value;
+      int endPoint = TerminusPointParameter.ActualValue.Value;
+      int numPoints = ScoresParameter.ActualValue.Length;
+      var distances = DistanceMatrixParameter.ActualValue;
+      double fixedPenalty = FixedPenaltyParameter.ActualValue.Value;
+      double maxDistance = MaximumDistanceParameter.ActualValue.Value;
+      var scores = ScoresParameter.ActualValue;
+
+      // Find all points within the maximum distance allowed (ellipse)
+      var feasiblePoints =
+        from i in Enumerable.Range(0, numPoints)
+        let distance = distances[startPoint, i] + distances[i, endPoint] + fixedPenalty
+        where distance <= maxDistance && i != startPoint && i != endPoint
+        select new { Distance = distance, Index = i, Score = scores[i] };
+
+      var orderedFeasiblePoints = feasiblePoints.OrderByDescending(p => p.Score).ToList();
+
+      // Add the starting and terminus point
+      var tour = new List<int> {
+        startPoint,
+        endPoint
+      };
+
+      // Add points in a greedy way
+      bool insertionPerformed = true;
+      while (insertionPerformed) {
+        insertionPerformed = false;
+
+        for (int i = 0; i < orderedFeasiblePoints.Count; i++) {
+          for (int position = 1; position < tour.Count; position++) {
+            // Create the candidate tour
+            var candidateTour = new List<int>(tour);
+            candidateTour.Insert(position, orderedFeasiblePoints[i].Index);
+            double length = CalculateTourLength(candidateTour);
+
+            // If the insertion would be feasible, perform it
+            if (length <= maxDistance) {
+              tour = candidateTour;
+              orderedFeasiblePoints.RemoveAt(i);
+              insertionPerformed = true;
+              break;
+            }
+          }
+          if (insertionPerformed) break;
+        }
+      }
+
+      return new IntegerVector(tour.ToArray());
+    }
+
+
+    private double CalculateTourLength(IList<int> path) {
+      var distances = DistanceMatrixParameter.ActualValue;
+      var fixedPenalty = FixedPenaltyParameter.ActualValue.Value;
+
+      double length = 0.0;
+
+      for (int i = 1; i < path.Count; i++) {
+        length += distances[i - 1, i];
+      }
+      // Add the fixed penalty for every vertex except for the starting and ending vertex
+      if (path.Count > 1) {
+        if (path[path.Count - 1] == TerminusPointParameter.ActualValue.Value) length += ((path.Count - 2.0) * fixedPenalty);
+        else length += ((path.Count - 1.0) * fixedPenalty);
+      }
+
+      return length;
+    }
+  }
+}
Index: /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Evaluators/OrienteeringEvaluator.cs
===================================================================
--- /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Evaluators/OrienteeringEvaluator.cs	(revision 11190)
+++ /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/Evaluators/OrienteeringEvaluator.cs	(revision 11191)
@@ -34,5 +34,5 @@
     }
     public ILookupParameter<IntegerVector> SolutionParameter {
-      get { return (ILookupParameter<IntegerVector>)Parameters["Solution"]; }
+      get { return (ILookupParameter<IntegerVector>)Parameters["IntegerVector"]; }
     }
     public ILookupParameter<DoubleArray> ScoresParameter {
@@ -53,5 +53,5 @@
       : base() {
       Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The evaluated quality of the Orienteering solution."));
-      Parameters.Add(new LookupParameter<IntegerVector>("Solution", "The Orienteering Solution given in path representation."));
+      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The Orienteering Solution given in path representation."));
       Parameters.Add(new LookupParameter<DoubleArray>("Scores", "The scores of the points."));
     }
Index: /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj
===================================================================
--- /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj	(revision 11190)
+++ /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/HeuristicLab.Problems.Orienteering-3.3.csproj	(revision 11191)
@@ -47,4 +47,5 @@
   <ItemGroup>
     <Compile Include="Analyzers\BestOrienteeringSolutionAnalyser.cs" />
+    <Compile Include="Creators\GreedyOrienteeringTourCreator.cs" />
     <Compile Include="DistanceMatrix.cs" />
     <Compile Include="Interfaces\IOrienteeringEvaluator.cs" />
Index: /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs
===================================================================
--- /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs	(revision 11190)
+++ /branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Problems.Orienteering/3.3/OrienteeringProblem.cs	(revision 11191)
@@ -22,5 +22,4 @@
 using System;
 using System.Linq;
-using HeuristicLab.Analysis;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -30,4 +29,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Problems.Instances;
 
@@ -47,9 +47,6 @@
       get { return (OptionalValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     }
-    public OptionalValueParameter<DistanceMatrix> DistanceMatrixParameter {
-      get { return (OptionalValueParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
-    }
-    public ValueParameter<BoolValue> UseDistanceMatrixParameter {
-      get { return (ValueParameter<BoolValue>)Parameters["UseDistanceMatrix"]; }
+    public ValueParameter<DistanceMatrix> DistanceMatrixParameter {
+      get { return (ValueParameter<DistanceMatrix>)Parameters["DistanceMatrix"]; }
     }
 
@@ -84,8 +81,4 @@
       set { DistanceMatrixParameter.Value = value; }
     }
-    public BoolValue UseDistanceMatrix {
-      get { return UseDistanceMatrixParameter.Value; }
-      set { UseDistanceMatrixParameter.Value = value; }
-    }
     public IntValue StartingPoint {
       get { return StartingPointParameter.Value; }
@@ -115,7 +108,4 @@
       get { return Operators.OfType<BestOrienteeringSolutionAnalyser>().SingleOrDefault(); }
     }
-    private SingleObjectivePopulationDiversityAnalyzer SingleObjectivePopulationDiversityAnalyzer {
-      get { return Operators.OfType<SingleObjectivePopulationDiversityAnalyzer>().SingleOrDefault(); }
-    }
     #endregion
 
@@ -132,8 +122,7 @@
     }
     public OrienteeringProblem()
-      : base(new OrienteeringEvaluator(), new UniformRandomIntegerVectorCreator()) { // TODO: Greedy route creator for solution creator
+      : base(new OrienteeringEvaluator(), new GreedyOrienteeringTourCreator()) {
       Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the points."));
-      Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points."));
-      Parameters.Add(new ValueParameter<BoolValue>("UseDistanceMatrix", "True if the coordinates based evaluators should calculate the distance matrix from the coordinates and use it for evaluation similar to the distance matrix evaluator, otherwise false.", new BoolValue(true)));
+      Parameters.Add(new ValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the points."));
       Parameters.Add(new ValueParameter<IntValue>("StartingPoint", "Index of the starting point.", new IntValue(0)));
       Parameters.Add(new ValueParameter<IntValue>("TerminusPoint", "Index of the ending point.", new IntValue(0)));
@@ -182,12 +171,12 @@
       }
       ParameterizeSolutionCreator();
-      DistanceMatrix = null;
+      CalculateDistanceMatrix();
     }
     private void CoordinatesValue_ItemChanged(object sender, EventArgs<int, int> e) {
-      DistanceMatrix = null;
+      CalculateDistanceMatrix();
     }
     private void CoordinatesValue_Reset(object sender, EventArgs e) {
       ParameterizeSolutionCreator();
-      DistanceMatrix = null;
+      CalculateDistanceMatrix();
     }
     private void StartingPointParameter_ValueChanged(object sender, EventArgs e) {
@@ -245,8 +234,12 @@
 
     private void ParameterizeSolutionCreator() {
-      if (SolutionCreator is UniformRandomIntegerVectorCreator) {
-        if (SolutionCreator.LengthParameter.Value == null || SolutionCreator.LengthParameter.Value.Value != Scores.Length) {
-          SolutionCreator.LengthParameter.Value = new IntValue(Scores.Length);
-        }
+      if (SolutionCreator is GreedyOrienteeringTourCreator) {
+        var creator = (GreedyOrienteeringTourCreator)SolutionCreator;
+        creator.DistanceMatrixParameter.ActualName = DistanceMatrixParameter.Name;
+        creator.ScoresParameter.ActualName = ScoresParameter.Name;
+        creator.MaximumDistanceParameter.ActualName = MaximumDistanceParameter.Name;
+        creator.StartingPointParameter.ActualName = StartingPointParameter.Name;
+        creator.TerminusPointParameter.ActualName = TerminusPointParameter.Name;
+        creator.FixedPenaltyParameter.ActualName = FixedPenaltyParameter.Name;
       }
     }
@@ -259,13 +252,45 @@
     }
     private void ParameterizeAnalyzer() {
-      // TODO
+      if (BestOrienteeringSolutionAnalyser != null) {
+        BestOrienteeringSolutionAnalyser.QualityParameter.ActualName = Evaluator.QualityParameter.ActualName;
+
+        BestOrienteeringSolutionAnalyser.IntegerVector.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
+        BestOrienteeringSolutionAnalyser.CoordinatesParameter.ActualName = CoordinatesParameter.Name;
+        BestOrienteeringSolutionAnalyser.ScoresParameter.ActualName = ScoresParameter.Name;
+
+        BestOrienteeringSolutionAnalyser.ResultsParameter.ActualName = "Results";
+        BestOrienteeringSolutionAnalyser.BestKnownQualityParameter.ActualName = BestKnownQualityParameter.Name;
+        BestOrienteeringSolutionAnalyser.BestKnownSolutionParameter.ActualName = BestKnownSolutionParameter.Name;
+      }
     }
     private void InitializeOperators() {
-      // TODO
+      Operators.Add(new BestOrienteeringSolutionAnalyser());
+      ParameterizeAnalyzer();
+
+      var operators = ApplicationManager.Manager.GetInstances<IIntegerVectorOperator>();
+      Operators.AddRange(operators);
+      ParameterizeOperators();
     }
     private void ParameterizeOperators() {
-      // TODO
+      //foreach (var op in Operators.OfType<IIntegerVectorManipulator>())
+      //  op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
+      foreach (var op in Operators.OfType<IIntegerVectorMultiNeighborhoodShakingOperator>())
+        op.IntegerVectorParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
+      foreach (var op in Operators.OfType<ISingleObjectiveImprovementOperator>())
+        op.SolutionParameter.ActualName = SolutionCreator.IntegerVectorParameter.ActualName;
     }
     #endregion
+
+    private void CalculateDistanceMatrix() {
+      var distances = new double[Coordinates.Rows, Coordinates.Rows];
+      for (int i = 0; i < Coordinates.Rows; i++) {
+        for (int j = 0; j < Coordinates.Rows; j++) {
+          double distanceX = Math.Abs(Coordinates[i, 0] - Coordinates[j, 0]);
+          double distanceY = Math.Abs(Coordinates[i, 1] - Coordinates[j, 1]);
+          distances[i, j] = Math.Sqrt(Math.Pow(distanceX, 2) + Math.Pow(distanceY, 2));
+        }
+      }
+      DistanceMatrix = new DistanceMatrix(distances);
+    }
 
     private void InitializeInitialOrienteeringInstance() {
@@ -277,5 +302,5 @@
         {  5.00,  5.60 }
       });
-      UseDistanceMatrix.Value = false;
+      CalculateDistanceMatrix();
 
       StartingPoint.Value = 0;
@@ -296,6 +321,6 @@
 
       Coordinates = data.Coordinates != null ? new DoubleMatrix(data.Coordinates) : null;
-      UseDistanceMatrix.Value = data.Distances != null;
-      DistanceMatrix = data.Distances != null ? new DistanceMatrix(data.Distances) : null;
+      if (Coordinates == null)
+        DistanceMatrix = new DistanceMatrix(data.Distances);
       StartingPoint = new IntValue(0);// Depot is interpreted as start and endpoint (default)
       TerminusPoint = new IntValue(0);
