Index: trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs	(revision 7558)
+++ trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/TSPAlleleFrequencyAnalyzer.cs	(revision 7621)
@@ -60,4 +60,5 @@
       DoubleMatrix coords = CoordinatesParameter.ActualValue;
       DistanceMatrix dm = DistanceMatrixParameter.ActualValue;
+      if (dm == null && coords == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
       int source, target, h;
       double impact;
Index: trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs	(revision 7558)
+++ trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs	(revision 7621)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -93,4 +94,5 @@
             if (dm == null) {  // check again to avoid race condition
               DoubleMatrix c = CoordinatesParameter.ActualValue;
+              if (c == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
               dm = new DistanceMatrix(c.Rows, c.Rows);
               for (int i = 0; i < dm.Rows; i++) {
@@ -111,5 +113,5 @@
         Permutation p = PermutationParameter.ActualValue;
         DoubleMatrix c = CoordinatesParameter.ActualValue;
-
+        if (c == null) throw new InvalidOperationException("No coordinates were given.");
         double length = 0;
         for (int i = 0; i < p.Length - 1; i++)
Index: trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs	(revision 7558)
+++ trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/MoveEvaluators/TSPPathMoveEvaluator.cs	(revision 7621)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -78,9 +79,13 @@
         DistanceMatrix distanceMatrix = DistanceMatrixParameter.ActualValue;
         if (distanceMatrix == null) {
+          if (coordinates == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
           distanceMatrix = CalculateDistanceMatrix(coordinates);
           DistanceMatrixParameter.ActualValue = distanceMatrix;
         }
         relativeQualityDifference = EvaluateByDistanceMatrix(permutation, distanceMatrix);
-      } else relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates);
+      } else {
+        if (coordinates == null) throw new InvalidOperationException("No coordinates were given.");
+        relativeQualityDifference = EvaluateByCoordinates(permutation, coordinates);
+      }
       DoubleValue moveQuality = MoveQualityParameter.ActualValue;
       if (moveQuality == null) MoveQualityParameter.ActualValue = new DoubleValue(QualityParameter.ActualValue.Value + relativeQualityDifference);
Index: trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs	(revision 7558)
+++ trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs	(revision 7621)
@@ -44,6 +44,6 @@
 
     #region Parameter Properties
-    public ValueParameter<DoubleMatrix> CoordinatesParameter {
-      get { return (ValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
+    public OptionalValueParameter<DoubleMatrix> CoordinatesParameter {
+      get { return (OptionalValueParameter<DoubleMatrix>)Parameters["Coordinates"]; }
     }
     public OptionalValueParameter<DistanceMatrix> DistanceMatrixParameter {
@@ -110,5 +110,5 @@
     public TravelingSalesmanProblem()
       : base(new TSPRoundedEuclideanPathEvaluator(), new RandomPermutationCreator()) {
-      Parameters.Add(new ValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
+      Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities."));
       Parameters.Add(new OptionalValueParameter<DistanceMatrix>("DistanceMatrix", "The matrix which contains the distances between the cities."));
       Parameters.Add(new ValueParameter<BoolValue>("UseDistanceMatrix", "True if a distance matrix should be calculated and used for evaluation, otherwise false.", new BoolValue(true)));
@@ -148,4 +148,5 @@
       Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
       ParameterizeEvaluator();
+      ParameterizeSolutionCreator();
       UpdateMoveEvaluators();
       ParameterizeAnalyzers();
@@ -153,6 +154,8 @@
     }
     private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) {
-      Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
-      Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      if (Coordinates != null) {
+        Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+        Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      }
       ParameterizeSolutionCreator();
       ClearDistanceMatrix();
@@ -197,4 +200,10 @@
       }
 
+      ValueParameter<DoubleMatrix> oldCoordinates = (Parameters["Coordinates"] as ValueParameter<DoubleMatrix>);
+      if (oldCoordinates != null) {
+        Parameters.Remove(oldCoordinates);
+        Parameters.Add(new OptionalValueParameter<DoubleMatrix>("Coordinates", "The x- and y-Coordinates of the cities.", oldCoordinates.Value, oldCoordinates.GetsCollected));
+      }
+
       if (Operators.Count == 0) InitializeOperators();
       #endregion
@@ -204,6 +213,8 @@
     private void RegisterEventHandlers() {
       CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged);
-      Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
-      Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      if (Coordinates != null) {
+        Coordinates.ItemChanged += new EventHandler<EventArgs<int, int>>(Coordinates_ItemChanged);
+        Coordinates.Reset += new EventHandler(Coordinates_Reset);
+      }
       SolutionCreator.PermutationParameter.ActualNameChanged += new EventHandler(SolutionCreator_PermutationParameter_ActualNameChanged);
       Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged);
@@ -229,6 +240,10 @@
     }
     private void ParameterizeSolutionCreator() {
-      SolutionCreator.LengthParameter.Value = new IntValue(Coordinates.Rows);
-      SolutionCreator.LengthParameter.Hidden = true;
+      if (Evaluator is ITSPDistanceMatrixEvaluator && DistanceMatrix != null)
+        SolutionCreator.LengthParameter.Value = new IntValue(DistanceMatrix.Rows);
+      else if (Evaluator is ITSPCoordinatesPathEvaluator && Coordinates != null)
+        SolutionCreator.LengthParameter.Value = new IntValue(Coordinates.Rows);
+      else SolutionCreator.LengthParameter.Value = null;
+      SolutionCreator.LengthParameter.Hidden = SolutionCreator.LengthParameter.Value != null;
       SolutionCreator.PermutationTypeParameter.Value = new PermutationType(PermutationTypes.RelativeUndirected);
       SolutionCreator.PermutationTypeParameter.Hidden = true;
@@ -324,5 +339,5 @@
     public void Load(TSPData data) {
       if (data.Coordinates == null && data.Distances == null)
-        throw new System.IO.InvalidDataException("The given instance does not specify neither coordinates or distances!");
+        throw new System.IO.InvalidDataException("The given instance specifies neither coordinates nor distances!");
       if (data.Dimension > DistanceMatrixSizeLimit && (data.DistanceMeasure == TSPDistanceMeasure.Att
         || data.DistanceMeasure == TSPDistanceMeasure.Manhattan
@@ -338,4 +353,5 @@
       if (data.Coordinates != null && data.Coordinates.GetLength(0) > 0)
         Coordinates = new DoubleMatrix(data.Coordinates);
+      else Coordinates = null;
 
       TSPEvaluator evaluator;
@@ -392,7 +408,7 @@
 
       double quality;
-      if (Evaluator is TSPDistanceMatrixEvaluator) {
+      if (Evaluator is ITSPDistanceMatrixEvaluator) {
         quality = TSPDistanceMatrixEvaluator.Apply(DistanceMatrix, route);
-      } else if (Evaluator is TSPCoordinatesPathEvaluator) {
+      } else if (Evaluator is ITSPCoordinatesPathEvaluator) {
         quality = TSPCoordinatesPathEvaluator.Apply((TSPCoordinatesPathEvaluator)Evaluator, Coordinates, route);
       } else {
