Changeset 15217 for stable/HeuristicLab.Problems.GraphColoring
- Timestamp:
- 07/12/17 21:02:01 (7 years ago)
- Location:
- stable
- Files:
-
- 3 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 14412,14475-14476,14659-14660,14663,14912,15050,15067,15069,15079,15162,15166,15172-15173
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.GraphColoring/3.3/GraphColoringProblem.cs
r15050 r15217 38 38 [Creatable(CreatableAttribute.Categories.CombinatorialProblems, Priority = 135)] 39 39 [StorableClass] 40 public sealed class GraphColoringProblem : SingleObjectiveBasicProblem<LinearLinkageEncoding>, IProblemInstanceConsumer<GCPData> {40 public sealed class GraphColoringProblem : SingleObjectiveBasicProblem<LinearLinkageEncoding>, IProblemInstanceConsumer<GCPData>, IProblemInstanceExporter<GCPData> { 41 41 42 42 public override bool Maximization { … … 115 115 private void FitnessFunctionParameterOnValueChanged(object sender, EventArgs eventArgs) { 116 116 fitnessFunctionParameter.Value.ValueChanged += FitnessFunctionOnValueChanged; 117 OnReset();117 FitnessFunctionOnValueChanged(sender, eventArgs); 118 118 } 119 119 120 120 private void FitnessFunctionOnValueChanged(object sender, EventArgs eventArgs) { 121 121 BestKnownQualityParameter.Value = null; 122 if (FitnessFunction == FitnessFunction.Prioritized 123 && BestKnownColorsParameter.Value != null 124 && Encoding.Length > 0) { 125 var mag = Math.Pow(10, -(int)Math.Ceiling(Math.Log10(Encoding.Length))); 126 // the value is e.g. 0.051 for 0 conflicts with 51 colors (and less than 1000 nodes) 127 BestKnownQuality = BestKnownColorsParameter.Value.Value * mag; 128 } else BestKnownQualityParameter.Value = null; 122 129 OnReset(); 123 130 } … … 242 249 Description = data.Description; 243 250 OnReset(); 251 } 252 253 public GCPData Export() { 254 var instance = new GCPData(); 255 instance.Name = Name; 256 instance.Description = Description; 257 instance.Nodes = Encoding.Length; 258 var adjList = AdjacencyListParameter.Value; 259 instance.Adjacencies = new int[adjList.Rows, 2]; 260 for (var r = 0; r < adjList.Rows; r++) { 261 instance.Adjacencies[r, 0] = adjList[r, 0]; 262 instance.Adjacencies[r, 1] = adjList[r, 1]; 263 } 264 if (BestKnownColorsParameter.Value != null) 265 instance.BestKnownColors = BestKnownColorsParameter.Value.Value; 266 return instance; 244 267 } 245 268 -
stable/HeuristicLab.Problems.GraphColoring/3.3/HeuristicLab.Problems.GraphColoring-3.3.csproj
r15050 r15217 125 125 </ProjectReference> 126 126 <ProjectReference Include="..\..\HeuristicLab.Encodings.LinearLinkageEncoding\3.4\HeuristicLab.Encodings.LinearLinkageEncoding-3.4.csproj"> 127 <Project>{ 166507c9-ef26-4370-bb80-699742a29d4f}</Project>127 <Project>{be698769-975a-429e-828c-72bb2b6182c8}</Project> 128 128 <Name>HeuristicLab.Encodings.LinearLinkageEncoding-3.4</Name> 129 129 <Private>False</Private>
Note: See TracChangeset
for help on using the changeset viewer.