Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8208 for trunk/sources


Ignore:
Timestamp:
07/03/12 22:38:51 (12 years ago)
Author:
abeham
Message:

#1396: Show error dialog when incompatible evaluator is used

Location:
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/HeuristicLab.Problems.TravelingSalesman-3.3.csproj

    r7646 r8208  
    108108    <Reference Include="System.Data" />
    109109    <Reference Include="System.Drawing" />
     110    <Reference Include="System.Windows.Forms" />
    110111    <Reference Include="System.Xml" />
    111112  </ItemGroup>
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/TravelingSalesmanProblem.cs

    r7872 r8208  
    251251      else if (Evaluator is ITSPCoordinatesPathEvaluator && Coordinates != null)
    252252        SolutionCreator.LengthParameter.Value = new IntValue(Coordinates.Rows);
    253       else SolutionCreator.LengthParameter.Value = null;
     253      else {
     254        SolutionCreator.LengthParameter.Value = null;
     255        string error = "The given problem does not support the selected evaluator.";
     256        if (Evaluator is ITSPDistanceMatrixEvaluator)
     257          error += Environment.NewLine + "Please review that the " + DistanceMatrixParameter.Name + " parameter is defined or choose another evaluator.";
     258        else error += Environment.NewLine + "Please review that the " + CoordinatesParameter.Name + " parameter is defined or choose another evaluator.";
     259        PluginInfrastructure.ErrorHandling.ShowErrorDialog(error, null);
     260      }
    254261      SolutionCreator.LengthParameter.Hidden = SolutionCreator.LengthParameter.Value != null;
    255262      SolutionCreator.PermutationTypeParameter.Value = new PermutationType(PermutationTypes.RelativeUndirected);
     
    400407        try {
    401408          EvaluateAndLoadTour(data.BestKnownTour);
    402         }
    403         catch (InvalidOperationException) {
     409        } catch (InvalidOperationException) {
    404410          if (data.BestKnownQuality.HasValue)
    405411            BestKnownQuality = new DoubleValue(data.BestKnownQuality.Value);
Note: See TracChangeset for help on using the changeset viewer.