Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/20/20 16:58:03 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • made interfaces for array/matrix JsonItems and for their VMs aswell (IArrayJsonItem, IArrayJsonItemVM, IMatrixJsonItem, IMatrixJsonItemVM), incl. base classes (ArrayJsonItemBase, ArrayValueVM, MatrixJsonItemBase, MatrixValueVM)
  • changed inheritance structure for already existing array/matrix JsonItems -> they inherit now from new base array/matrix base classes
  • added input elements to configure the size of an matrix or array in JsonItemMultiValueControl (incl. VM binding and validation)
  • splitted file JsonItems.cs into separate files for their corresponding types (IntJsonItems.cs, DoubleJsonItems.cs, BoolJsonItems.cs, StringJsonItem.cs, DateTimeJsonItem.cs)
  • changed location of deserialization of json values from JsonTemplateInstantiator into IJsonItem (implemented in JsonItem and set to virtual, overridden in MatrixJsonItemBase and ArrayJsonItemBase)
  • added new CLI argument StringArgument
  • some little UI improvements (location fixes, anchor fixes, ...)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Problems.TravelingSalesman/3.3/Analyzers/BestTSPSolutionAnalyzer.cs

    r17180 r17446  
    5656      get { return (LookupParameter<PathTSPTour>)Parameters["BestSolution"]; }
    5757    }
    58     public ValueLookupParameter<ResultCollection> ResultsParameter {
    59       get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
    60     }
     58    //public ValueLookupParameter<ResultCollection> ResultsParameter {
     59    //  get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; }
     60    //}
    6161    public LookupParameter<DoubleValue> BestKnownQualityParameter {
    6262      get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; }
     
    6464    public LookupParameter<Permutation> BestKnownSolutionParameter {
    6565      get { return (LookupParameter<Permutation>)Parameters["BestKnownSolution"]; }
     66    }
     67    public IResultParameter<PathTSPTour> BestSolutionResultParameter {
     68      get { return (IResultParameter<PathTSPTour>)Parameters["Best TSP Solution"]; }
     69    }
     70
     71
     72    [StorableHook(HookType.AfterDeserialization)]
     73    private void AfterDeserialization() {
     74      // BackwardsCompatibility3.3
     75      #region Backwards compatible code, remove with 3.4
     76      if (!Parameters.ContainsKey("Best TSP Solution")) {
     77        Parameters.Add(new ResultParameter<PathTSPTour>("Best TSP Solution", "The best TSP solution found so far."));
     78      }
     79      #endregion
    6680    }
    6781
     
    7993      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the TSP solutions which should be analyzed."));
    8094      Parameters.Add(new LookupParameter<PathTSPTour>("BestSolution", "The best TSP solution."));
    81       Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));
     95      //Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best TSP solution should be stored."));
    8296      Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance."));
    8397      Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The best known solution of this TSP instance."));
     98      Parameters.Add(new ResultParameter<PathTSPTour>("Best TSP Solution", "The best TSP solution found so far."));
    8499
    85100      MaximizationParameter.Hidden = true;
     
    88103      QualityParameter.Hidden = true;
    89104      BestSolutionParameter.Hidden = true;
    90       ResultsParameter.Hidden = true;
     105      //ResultsParameter.Hidden = true;
    91106      BestKnownQualityParameter.Hidden = true;
    92107      BestKnownSolutionParameter.Hidden = true;
     
    97112      ItemArray<Permutation> permutations = PermutationParameter.ActualValue;
    98113      ItemArray<DoubleValue> qualities = QualityParameter.ActualValue;
    99       ResultCollection results = ResultsParameter.ActualValue;
     114      //ResultCollection results = ResultsParameter.ActualValue;
    100115      bool max = MaximizationParameter.ActualValue.Value;
    101116      DoubleValue bestKnownQuality = BestKnownQualityParameter.ActualValue;
     
    117132        tour = new PathTSPTour(coordinates, (Permutation)permutations[i].Clone(), new DoubleValue(qualities[i].Value));
    118133        BestSolutionParameter.ActualValue = tour;
    119         results.Add(new Result("Best TSP Solution", tour));
     134        BestSolutionResultParameter.ActualValue = tour;
     135        //results.Add(new Result("Best TSP Solution", tour));
    120136      } else {
    121137        if (max && tour.Quality.Value < qualities[i].Value ||
Note: See TracChangeset for help on using the changeset viewer.