Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/12 14:29:53 (13 years ago)
Author:
abeham
Message:

#1396:

  • Fixed loading of instances that did not specify coordinates (visual or actual ones)
  • Turned coordinates into an OptionalValueParameter
  • Added checks in relevant operators that throw an exception if they can neither find coordinates or distances
  • Writing a message to the visualization if coordinates are not defined
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs

    r7558 r7621  
    2020#endregion
    2121
     22using System;
    2223using HeuristicLab.Common;
    2324using HeuristicLab.Core;
     
    9394            if (dm == null) {  // check again to avoid race condition
    9495              DoubleMatrix c = CoordinatesParameter.ActualValue;
     96              if (c == null) throw new InvalidOperationException("Neither a distance matrix nor coordinates were given.");
    9597              dm = new DistanceMatrix(c.Rows, c.Rows);
    9698              for (int i = 0; i < dm.Rows; i++) {
     
    111113        Permutation p = PermutationParameter.ActualValue;
    112114        DoubleMatrix c = CoordinatesParameter.ActualValue;
    113 
     115        if (c == null) throw new InvalidOperationException("No coordinates were given.");
    114116        double length = 0;
    115117        for (int i = 0; i < p.Length - 1; i++)
Note: See TracChangeset for help on using the changeset viewer.