Changeset 15472
- Timestamp:
- 11/15/17 12:14:18 (7 years ago)
- Location:
- branches/CFSAP
- Files:
-
- 9 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/CFSAP/HeuristicLab.Problems.Instances
- Property svn:mergeinfo changed
-
branches/CFSAP/HeuristicLab.Problems.Instances.CFSAP/3.3/BozejkoCFSAPInstanceProvider.cs
r15460 r15472 107 107 108 108 private static readonly Dictionary<string, int> bestKnownCycleTimes = new Dictionary<string, int>() { 109 { "gi_001", 608 },110 { "gi_002", 623 },111 { "gi_003", 500 },112 { "gi_004", 585 },113 { "gi_005", 549 },114 { "gi_006", 629 },115 { "gi_007", 603 },116 { "gi_008", 506 },117 { "gi_009", 588 },118 { "gi_010", 493 },119 { "gi_011", 597 },120 { "gi_012", 554 },121 { "gi_013", 594 },122 { "gi_014", 505 },123 { "gi_015", 631 },124 { "gi_016", 626 },125 { "gi_017", 585 },126 { "gi_018", 529 },127 { "gi_019", 649 },128 { "gi_020", 561 },129 { "gi_021", 535 },130 { "gi_022", 586 },131 { "gi_023", 602 },132 { "gi_024", 607 },133 { "gi_025", 598 },134 { "gi_026", 572 },135 { "gi_027", 605 },136 { "gi_028", 619 },137 { "gi_029", 646 },138 { "gi_030", 591 },139 { "gi_031", 958 },140 { "gi_032", 838 },141 { "gi_033", 974 },142 { "gi_034", 904 },109 { "gi_001", 608 }, 110 { "gi_002", 623 }, 111 { "gi_003", 500 }, 112 { "gi_004", 585 }, 113 { "gi_005", 549 }, 114 { "gi_006", 629 }, 115 { "gi_007", 603 }, 116 { "gi_008", 506 }, 117 { "gi_009", 588 }, 118 { "gi_010", 493 }, 119 { "gi_011", 597 }, 120 { "gi_012", 554 }, 121 { "gi_013", 594 }, 122 { "gi_014", 505 }, 123 { "gi_015", 631 }, 124 { "gi_016", 626 }, 125 { "gi_017", 585 }, 126 { "gi_018", 529 }, 127 { "gi_019", 649 }, 128 { "gi_020", 561 }, 129 { "gi_021", 535 }, 130 { "gi_022", 586 }, 131 { "gi_023", 602 }, 132 { "gi_024", 607 }, 133 { "gi_025", 598 }, 134 { "gi_026", 572 }, 135 { "gi_027", 605 }, 136 { "gi_028", 619 }, 137 { "gi_029", 646 }, 138 { "gi_030", 591 }, 139 { "gi_031", 958 }, 140 { "gi_032", 838 }, 141 { "gi_033", 974 }, 142 { "gi_034", 904 }, 143 143 { "gi_035", 1002 }, 144 { "gi_036", 998 },145 { "gi_037", 988 },146 { "gi_038", 872 },144 { "gi_036", 998 }, 145 { "gi_037", 988 }, 146 { "gi_038", 872 }, 147 147 { "gi_039", 1009 }, 148 148 { "gi_040", 1000 }, 149 { "gi_041", 992 },149 { "gi_041", 992 }, 150 150 { "gi_042", 1097 }, 151 { "gi_043", 989 },151 { "gi_043", 989 }, 152 152 { "gi_044", 1038 }, 153 { "gi_045", 998 },153 { "gi_045", 998 }, 154 154 { "gi_046", 1077 }, 155 { "gi_047", 997 },156 { "gi_048", 921 },157 { "gi_049", 902 },155 { "gi_047", 997 }, 156 { "gi_048", 921 }, 157 { "gi_049", 902 }, 158 158 { "gi_050", 1035 }, 159 { "gi_051", 914 },159 { "gi_051", 914 }, 160 160 { "gi_052", 1019 }, 161 { "gi_053", 997 },162 { "gi_054", 928 },163 { "gi_055", 973 },161 { "gi_053", 997 }, 162 { "gi_054", 928 }, 163 { "gi_055", 973 }, 164 164 { "gi_056", 1011 }, 165 { "gi_057", 943 },166 { "gi_058", 959 },165 { "gi_057", 943 }, 166 { "gi_058", 959 }, 167 167 { "gi_059", 1079 }, 168 { "gi_060", 940 },168 { "gi_060", 940 }, 169 169 { "gi_061", 2176 }, 170 170 { "gi_062", 2100 }, … … 186 186 { "gi_078", 2236 }, 187 187 { "gi_079", 2223 }, 188 { "gi_080", 213 6},188 { "gi_080", 2132 }, 189 189 { "gi_081", 2147 }, 190 190 { "gi_082", 2285 }, … … 199 199 { "gi_091", 4465 }, 200 200 { "gi_092", 4269 }, 201 { "gi_093", 4 201},202 { "gi_094", 43 30},203 { "gi_095", 415 8},201 { "gi_093", 4199 }, 202 { "gi_094", 4319 }, 203 { "gi_095", 4154 }, 204 204 { "gi_096", 4355 }, 205 205 { "gi_097", 4363 }, 206 { "gi_098", 426 8},207 { "gi_099", 41 43 },206 { "gi_098", 4264 }, 207 { "gi_099", 4133 }, 208 208 { "gi_100", 4313 }, 209 { "gi_101", 428 5},209 { "gi_101", 4284 }, 210 210 { "gi_102", 4421 }, 211 { "gi_103", 42 88},211 { "gi_103", 4279 }, 212 212 { "gi_104", 4295 }, 213 { "gi_105", 429 5},213 { "gi_105", 4290 }, 214 214 { "gi_106", 4257 }, 215 { "gi_107", 46 10},216 { "gi_108", 4 579},217 { "gi_109", 457 8},215 { "gi_107", 4604 }, 216 { "gi_108", 4285 }, 217 { "gi_109", 4570 }, 218 218 { "gi_110", 4219 }, 219 219 { "gi_111", 4472 }, … … 230 230 } 231 231 } 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 -
branches/CFSAP/HeuristicLab.Problems.Instances.CFSAP/3.3/Plugin.cs.frame
r14757 r15472 25 25 [Plugin("HeuristicLab.Problems.Instances.CFSAP", "Plugin that provides problem instances for the non-permutational cyclic flow shop problem with two machine nests.", "3.3.14.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.Instances.CFSAP-3.3.dll", PluginFileType.Assembly)] 27 [PluginDependency("HeuristicLab.Common", "3.3")]28 27 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 29 28 public class HeuristicLabProblemsInstancesCFSAPPlugin : PluginBase { } -
branches/CFSAP/HeuristicLab.Problems.Instances/3.3/HeuristicLab.Problems.Instances-3.3.csproj
r14757 r15472 129 129 <Compile Include="ProblemInstanceManager.cs" /> 130 130 <Compile Include="IProblemInstanceExporter.cs" /> 131 <Compile Include="Types\GCPData.cs" /> 131 132 <Compile Include="Types\CFSAPData.cs" /> 132 133 <Compile Include="Types\PTSPData.cs" /> -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/CFSAP.cs
r15460 r15472 64 64 : base(original, cloner) {} 65 65 public CFSAP() { 66 Parameters.Add(new ValueParameter<IntMatrix>("ProcessingTimes", "The processing times of each machine and each job.") );67 Parameters.Add(new ValueParameter<ItemList<IntMatrix>>("SetupTimes", "The sequence dependent set up times of each machine and between all jobs.") );66 Parameters.Add(new ValueParameter<IntMatrix>("ProcessingTimes", "The processing times of each machine and each job.") { GetsCollected = false }); 67 Parameters.Add(new ValueParameter<ItemList<IntMatrix>>("SetupTimes", "The sequence dependent set up times of each machine and between all jobs.") { GetsCollected = false }); 68 68 69 69 ProcessingTimesParameter.Value = new IntMatrix(new int[,] { … … 90 90 Encoding.Add(new PermutationEncoding("sequence", 5, PermutationTypes.RelativeDirected)); 91 91 Encoding.Add(new BinaryVectorEncoding("assignment", 5)); 92 93 EncodingParameter.GetsCollected = false; 94 foreach (var param in ((IEncoding)Encoding).Parameters.OfType<IValueParameter>().ToList()) { 95 param.GetsCollected = false; 96 } 92 97 93 98 Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator); -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/HeuristicLab.Problems.Scheduling.CFSAP-3.3.csproj
r15460 r15472 76 76 <SpecificVersion>False</SpecificVersion> 77 77 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.PermutationEncoding-3.3.dll</HintPath> 78 <Private>False</Private> 79 </Reference> 80 <Reference Include="HeuristicLab.Operators-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 81 <SpecificVersion>False</SpecificVersion> 82 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Operators-3.3.dll</HintPath> 78 83 <Private>False</Private> 79 84 </Reference> -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/MultiNestCFSAP.cs
r15460 r15472 41 41 : base(original, cloner) { } 42 42 public MultiNestCFSAP() { 43 Parameters.Add(new ValueParameter<ItemList<IntMatrix>>("ProcessingTimes", "The processing times of each nest, each machine, each job.") );44 Parameters.Add(new ValueParameter<ItemList<ItemList<IntMatrix>>>("SetupTimes", "The sequence dependent set up times for each nest, each machine, and each job to each other.") );43 Parameters.Add(new ValueParameter<ItemList<IntMatrix>>("ProcessingTimes", "The processing times of each nest, each machine, each job.") { GetsCollected = false }); 44 Parameters.Add(new ValueParameter<ItemList<ItemList<IntMatrix>>>("SetupTimes", "The sequence dependent set up times for each nest, each machine, and each job to each other.") { GetsCollected = false }); 45 45 46 46 ProcessingTimesParameter.Value = new ItemList<IntMatrix>() { … … 69 69 Encoding.Add(new PermutationEncoding("seq0", 5, PermutationTypes.RelativeDirected)); 70 70 Encoding.Add(new BinaryVectorEncoding("assign0", 5)); 71 72 EncodingParameter.GetsCollected = false; 73 foreach (var param in ((IEncoding)Encoding).Parameters.OfType<IValueParameter>().ToList()) { 74 param.GetsCollected = false; 75 } 71 76 72 77 Operators.RemoveAll(x => x is SingleObjectiveMoveGenerator); … … 124 129 Encoding.Add(new BinaryVectorEncoding("assign" + n, data.Jobs)); 125 130 } 131 132 #region Reduce run size by removing collected parameters 133 foreach (var param in ((IEncoding)Encoding).Parameters.OfType<IValueParameter>().ToList()) 134 param.GetsCollected = false; 135 136 var solCreator = SolutionCreator as IParameterizedItem; 137 if (solCreator != null) { 138 foreach (var param in solCreator.Parameters.OfType<IValueParameter>().ToList()) { 139 param.GetsCollected = false; 140 var secondLevel = param.Value as IParameterizedItem; 141 if (secondLevel != null) { 142 foreach (var secondLevelParam in secondLevel.Parameters.OfType<IValueParameter>().ToList()) 143 secondLevelParam.GetsCollected = false; 144 } 145 } 146 } 147 #endregion 148 126 149 Name = data.Name; 127 150 Description = data.Description; -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/MultiNestCFSAPSolvingStrategy.cs
r15460 r15472 3 3 using System.Linq; 4 4 using System.Threading; 5 using HeuristicLab.Analysis; 5 6 using HeuristicLab.Common; 6 7 using HeuristicLab.Core; … … 32 33 } 33 34 35 36 public IFixedValueParameter<StringValue> EvaluatedSolutionsNameParameter { 37 get { return (IFixedValueParameter<StringValue>)Parameters["EvaluatedSolutionsName"]; } 38 } 39 40 public IAlgorithm Solver { 41 get { return SolverParameter.Value; } 42 set { SolverParameter.Value = value; } 43 } 44 34 45 public TimeSpan MaximumRuntime { 35 46 get { return MaximumRuntimeParameter.Value.Value; } 36 47 set { MaximumRuntimeParameter.Value.Value = value; } 48 } 49 50 public string EvaluatedSolutionsName { 51 get { return EvaluatedSolutionsNameParameter.Value.Value; } 52 set { EvaluatedSolutionsNameParameter.Value.Value = value; } 37 53 } 38 54 … … 47 63 if (original.algorithmsResults != null) 48 64 algorithmsResults = cloner.Clone(original.algorithmsResults); 65 if (original.qualityPerClock != null) 66 qualityPerClock = cloner.Clone(original.qualityPerClock); 67 if (original.qualityPerEvaluations != null) 68 qualityPerEvaluations = cloner.Clone(original.qualityPerEvaluations); 49 69 } 50 70 public MultiNestCFSAPSolvingStrategy() { 51 Parameters.Add(new ValueParameter<IAlgorithm>("Solver", "The actual solver template.") );71 Parameters.Add(new ValueParameter<IAlgorithm>("Solver", "The actual solver template.") { GetsCollected = false }); 52 72 Parameters.Add(new FixedValueParameter<TimeSpanValue>("MaximumRuntime", "The maximum time that the strategy should run.", new TimeSpanValue(TimeSpan.FromSeconds(60)))); 73 Parameters.Add(new FixedValueParameter<StringValue>("EvaluatedSolutionsName", "The name of the result that shows the number of evaluated solutions by the actual solver.", new StringValue("EvaluatedSolutions"))); 53 74 } 54 75 55 76 public override IDeepCloneable Clone(Cloner cloner) { 56 77 return new MultiNestCFSAPSolvingStrategy(this, cloner); 78 } 79 80 81 [StorableHook(HookType.AfterDeserialization)] 82 private void AfterDeserialization() { 83 if (!Parameters.ContainsKey("EvaluatedSolutionsName")) 84 Parameters.Add(new FixedValueParameter<StringValue>("EvaluatedSolutionsName", "The name of the result that shows the number of evaluated solutions by the actual solver.", new StringValue("EvaluatedSolutions"))); 57 85 } 58 86 … … 63 91 [Storable] 64 92 private ResultCollection algorithmsResults; 93 [Storable] 94 private IndexedDataTable<double> qualityPerClock; 95 [Storable] 96 private IndexedDataTable<double> qualityPerEvaluations; 65 97 66 98 protected override void OnPrepared() { … … 68 100 algorithms = null; 69 101 qualities = null; 102 algorithmsResults = null; 103 qualityPerClock = null; 104 qualityPerEvaluations = null; 70 105 } 71 106 … … 89 124 var min = worst.Quality; 90 125 126 qualityPerClock = new IndexedDataTable<double>("Quality per Clock"); 127 var qpcRow = new IndexedDataRow<double>("First-hit Graph"); 128 qpcRow.Values.Add(Tuple.Create(ExecutionTime.TotalSeconds, (double)min)); 129 qpcRow.Values.Add(Tuple.Create(ExecutionTime.TotalSeconds, (double)min)); 130 qualityPerClock.Rows.Add(qpcRow); 131 qualityPerEvaluations = new IndexedDataTable<double>("Quality per Evaluations"); 132 var qpeRow = new IndexedDataRow<double>("First-hit Graph"); 133 qualityPerEvaluations.Rows.Add(qpeRow); 134 double evaluations = GetEvaluatedSolutions(); 135 qpeRow.Values.Add(Tuple.Create((double)evaluations, (double)min)); 136 qpeRow.Values.Add(Tuple.Create((double)evaluations, (double)min)); 137 91 138 Results.Add(new Result("Nest with maximum T", new IntValue(worst.Index + 1))); 92 139 Results.Add(new Result("Maximum T", new IntValue(min))); 140 Results.Add(new Result("BestQuality", new DoubleValue(min))); 93 141 Results.Add(new Result("Best Solution Found At", new TimeSpanValue(ExecutionTime))); 94 142 Results.Add(new Result("Delta T", new PercentValue((min - Problem.BestKnownQuality) / Problem.BestKnownQuality))); 95 143 Results.Add(new Result("Nest Results", algorithmsResults)); 144 Results.Add(new Result("QualityPerClock", qualityPerClock)); 145 Results.Add(new Result("QualityPerEvaluations", qualityPerEvaluations)); 96 146 97 147 base.Initialize(cancellationToken); 148 } 149 150 private double GetEvaluatedSolutions() { 151 if (algorithmsResults == null) throw new InvalidOperationException("Strategy has not been started yet."); 152 return algorithmsResults.Select(x => { 153 IResult res; 154 if (((ResultCollection)x.Value).TryGetValue(EvaluatedSolutionsName, out res)) { 155 var itm = res.Value; 156 if (itm is IntValue) return ((IntValue)itm).Value; 157 else if (itm is DoubleValue) return ((DoubleValue)itm).Value; 158 } 159 throw new InvalidOperationException("No result " + EvaluatedSolutionsName + " in the collection of " + x.Name); 160 }).Sum(); 98 161 } 99 162 … … 106 169 qualities[worst.Index] = (int)((DoubleValue)algorithms[worst.Index].Results["BestQuality"].Value).Value; 107 170 worst = qualities.Select((v, i) => new { Index = i, Quality = v }).MaxItems(x => x.Quality).First(); 171 172 var evaluations = GetEvaluatedSolutions(); 173 var time = ExecutionTime.TotalSeconds; 174 var qpcRow = qualityPerClock.Rows.First(); 175 var qpeRow = qualityPerEvaluations.Rows.First(); 176 qpcRow.Values[qpcRow.Values.Count - 1] = Tuple.Create(time, (double)min); 177 qpeRow.Values[qpeRow.Values.Count - 1] = Tuple.Create(evaluations, (double)min); 178 108 179 if (worst.Quality < min) { 109 180 min = worst.Quality; 110 Results["Nest with maximum T"].Value = new IntValue(worst.Index + 1); 111 Results["Maximum T"].Value = new IntValue(min); 112 Results["Best Solution Found At"].Value = new TimeSpanValue(ExecutionTime); 113 Results["Delta T"].Value = new PercentValue((min - Problem.BestKnownQuality) / Problem.BestKnownQuality); 181 ((IntValue)Results["Nest with maximum T"].Value).Value = worst.Index + 1; 182 ((IntValue)Results["Maximum T"].Value).Value = min; 183 ((DoubleValue)Results["BestQuality"].Value).Value = min; 184 ((TimeSpanValue)Results["Best Solution Found At"].Value).Value = TimeSpan.FromSeconds(time); 185 ((PercentValue)Results["Delta T"].Value).Value = (min - Problem.BestKnownQuality) / Problem.BestKnownQuality; 186 qpcRow.Values.Add(Tuple.Create(time, (double)min)); 187 qpeRow.Values.Add(Tuple.Create(evaluations, (double)min)); 114 188 } 189 115 190 if (cancellationToken.IsCancellationRequested) return; 116 191 } -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/Plugin.cs.frame
r14757 r15472 30 30 [PluginDependency("HeuristicLab.Collections", "3.3")] 31 31 [PluginDependency("HeuristicLab.Common", "3.3")] 32 [PluginDependency("HeuristicLab.Common.Resources", "3.3")]33 32 [PluginDependency("HeuristicLab.Core", "3.3")] 34 33 [PluginDependency("HeuristicLab.Data", "3.3")] … … 38 37 [PluginDependency("HeuristicLab.Parameters", "3.3")] 39 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] 40 [PluginDependency("HeuristicLab. SimSharp", "3.0.9")]39 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 41 40 public class HeuristicLabProblemsSchedulingCFSAPPlugin : PluginBase { 42 41 }
Note: See TracChangeset
for help on using the changeset viewer.