Changeset 13202 for branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs
- Timestamp:
- 11/17/15 09:28:57 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PTSP/HeuristicLab.Problems.PTSP/3.3/PTSP.cs
r12387 r13202 20 20 #endregion 21 21 22 using System; 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 26 using System.Threading.Tasks; 22 using HeuristicLab.Common; 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 25 using HeuristicLab.Encodings.PermutationEncoding; 27 26 using HeuristicLab.Optimization; 28 using HeuristicLab.PluginInfrastructure; 29 using HeuristicLab.Core; 27 using HeuristicLab.Parameters; 30 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 31 29 using HeuristicLab.Problems.Instances; 32 using HeuristicLab.Encodings.PermutationEncoding;33 using HeuristicLab.Common;34 using HeuristicLab.Parameters;35 using HeuristicLab.Data;36 using HeuristicLab.Random;37 30 38 31 namespace HeuristicLab.Problems.PTSP { … … 59 52 get { return (ValueParameter<DoubleArray>)Parameters["ProbabilityMatrix"]; } 60 53 } 61 54 62 55 63 56 #endregion … … 84 77 set { ProbabilityMatrixParameter.Value = value; } 85 78 } 86 79 87 80 #endregion 88 81 89 82 90 83 public override bool Maximization { … … 112 105 }); 113 106 114 ProbabilityMatrix = new DoubleArray(new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1});115 107 ProbabilityMatrix = new DoubleArray(new double[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }); 108 116 109 } 117 110 … … 134 127 BestKnownSolution = new Permutation(PermutationTypes.RelativeUndirected, data.BestKnownTour); 135 128 } 136 137 bool clearCoordinates = false, clearDistanceMatrix = false;138 if (data.Coordinates != null && data.Coordinates.GetLength(0) > 0)139 Coordinates = new DoubleMatrix(data.Coordinates);140 else clearCoordinates = true;141 129 142 // reset them after assigning the evaluator 143 if (clearCoordinates) Coordinates = null; 144 if (clearDistanceMatrix) DistanceMatrix = null; 130 Coordinates = data.Coordinates != null && data.Coordinates.GetLength(0) > 0 ? new DoubleMatrix(data.Coordinates) : null; 131 DistanceMatrix = new DistanceMatrix(data.GetDistanceMatrix()); 145 132 146 DistanceMatrix = new DistanceMatrix(data.GetDistanceMatrix());147 148 133 Encoding.Length = data.Dimension; 149 134
Note: See TracChangeset
for help on using the changeset viewer.