Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/19/17 11:10:14 (7 years ago)
Author:
fholzing
Message:

#2864: CleanUp of old code, added LOP benchmark instances

Location:
branches/2864_PermutationProblems/HeuristicLab.Problems.LinearOrdering/3.3/Evaluators
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2864_PermutationProblems/HeuristicLab.Problems.LinearOrdering/3.3/Evaluators/LOPEvaluator.cs

    r15521 r15541  
    3636    public abstract class LOPEvaluator : InstrumentedOperator, ILOPEvaluator
    3737    {
    38         public override bool CanChangeName {
     38        public override bool CanChangeName
     39        {
    3940            get { return false; }
    4041        }
    4142
    42         public ILookupParameter<DoubleValue> QualityParameter {
     43        public ILookupParameter<DoubleValue> QualityParameter
     44        {
    4345            get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; }
    4446        }
  • branches/2864_PermutationProblems/HeuristicLab.Problems.LinearOrdering/3.3/Evaluators/MatrixTriangulationEvaluator.cs

    r15521 r15541  
    3131{
    3232    /// <summary>
    33     /// A base class for operators which evaluate LOP solutions given in Matrix representation.
     33    /// A base class for operators which evaluates LOP solutions given in Matrix representation.
    3434    /// </summary>
    3535    [Item("MatrixTriangulationEvaluator", "A base class for operators which evaluate LOP solutions given in Matrix representation.")]
     
    3737    public abstract class MatrixTriangulationEvaluator : LOPEvaluator, IMatrixTriangulationEvaluator
    3838    {
    39         private object locker = new object();
    40 
    4139        public ILookupParameter<Permutation> PermutationParameter { get { return (ILookupParameter<Permutation>)Parameters["Permutation"]; } }
    4240        public ILookupParameter<DoubleMatrix> MatrixParameter { get { return (ILookupParameter<DoubleMatrix>)Parameters["Matrix"]; } }
    4341        public ILookupParameter<Permutation> BestKnownSolutionParameter { get { return (ILookupParameter<Permutation>)Parameters["BestKnownSolution"]; } }
    4442        public ILookupParameter<DoubleValue> BestKnownQualityParameter { get { return (ILookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } }
     43
    4544        [StorableConstructor]
    4645        protected MatrixTriangulationEvaluator(bool deserializing) : base(deserializing) { }
     
    4948          : base()
    5049        {
    51             Parameters.Add(new LookupParameter<Permutation>("Permutation", "The TSP solution given in path representation which should be evaluated."));
     50            Parameters.Add(new LookupParameter<Permutation>("Permutation", "The LOP solution given in path representation which should be evaluated."));
    5251            Parameters.Add(new LookupParameter<DoubleMatrix>("Matrix", "The matrix which contains the distances between the cities."));
    5352            Parameters.Add(new LookupParameter<Permutation>("BestKnownSolution", "The currently best known solution."));
     
    5857        private void AfterDeserialization()
    5958        {
    60             // BackwardsCompatibility3.3
    61             #region Backwards compatible code (remove with 3.4)
    62             LookupParameter<DoubleMatrix> oldDistanceMatrixParameter = Parameters["Matrix"] as LookupParameter<DoubleMatrix>;
    63             if (oldDistanceMatrixParameter != null)
    64             {
    65                 Parameters.Remove(oldDistanceMatrixParameter);
    66                 Parameters.Add(new LookupParameter<DoubleMatrix>("Matrix", "The matrix which contains the distances between the cities."));
    67                 MatrixParameter.ActualName = oldDistanceMatrixParameter.ActualName;
    68             }
    69             #endregion
     59
    7060        }
    7161
    7262        public static double Apply(MatrixTriangulationEvaluator evaluator, DoubleMatrix matrix, Permutation permut)
    7363        {
    74             double length = evaluator.CalculateUpperTriangle(matrix, permut);
    75             return length;
     64            return evaluator.CalculateUpperTriangle(matrix, permut);
    7665        }
    7766
     
    8069            Permutation p = PermutationParameter.ActualValue;
    8170            DoubleMatrix c = MatrixParameter.ActualValue;
    82             if (c == null) throw new InvalidOperationException("No coordinates were given.");
     71            if (c == null) throw new InvalidOperationException("No matrix was given.");
    8372
    8473            double upperTriangle = CalculateUpperTriangle(c, p);
Note: See TracChangeset for help on using the changeset viewer.