- Timestamp:
- 03/18/19 17:24:30 (6 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.Scheduling/3.3/JSSPORLIBDataDescriptor.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.Scheduling/3.3/JSSPORLIBInstanceProvider.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 67 67 var parser = new JSSPORLIBParser(); 68 68 parser.Parse(stream); 69 var instance = Load(parser); 70 instance.Name = id.Name; 71 instance.Description = id.Description; 72 73 return instance; 69 return Load(parser); 74 70 } 75 71 } … … 82 78 var parser = new JSSPORLIBParser(); 83 79 parser.Parse(path); 84 var instance = Load(parser); 85 instance.Name = Path.GetFileName(path); 86 instance.Description = "Loaded from file \"" + path + "\" on " + DateTime.Now.ToString(); 87 return instance; 80 return Load(parser); 88 81 } 89 82 90 83 private JSSPData Load(JSSPORLIBParser parser) { 91 84 var instance = new JSSPData { 85 Name = parser.Name, 86 Description = parser.Description, 92 87 Jobs = parser.Jobs, 93 88 Resources = parser.Resources, -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.Scheduling/3.3/JSSPORLIBParser.cs
r12012 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.IO; 25 25 using System.Linq; 26 using System.Text; 26 27 27 28 namespace HeuristicLab.Problems.Instances.Scheduling { … … 53 54 54 55 public void Export(string file) { 55 using (Stream stream = new FileStream(file, FileMode. Open, FileAccess.Read)) {56 using (Stream stream = new FileStream(file, FileMode.Create, FileAccess.Write)) { 56 57 Export(stream); 57 58 } … … 65 66 /// </remarks> 66 67 /// <param name="stream">The stream to read data from.</param> 67 /// <returns>True if the file was successfully read or false otherwise.</returns>68 68 public void Parse(Stream stream) { 69 var reader = new StreamReader(stream);70 Name = reader.ReadLine().Trim();71 Description = reader.ReadLine().Trim();72 var delim = new char[] { ' ', '\t'};69 using (var reader = new StreamReader(stream, Encoding.UTF8, true, 4092, true)) { 70 Name = reader.ReadLine().Trim(); 71 Description = reader.ReadLine().Trim(); 72 var delim = new char[] {' ', '\t'}; 73 73 74 var info = reader.ReadLine().Split(delim, StringSplitOptions.RemoveEmptyEntries);75 Jobs = int.Parse(info[0]);76 Resources = int.Parse(info[1]);77 ProcessingTimes = new double[Jobs, Resources];78 Demands = new int[Jobs, Resources];74 var info = reader.ReadLine().Split(delim, StringSplitOptions.RemoveEmptyEntries); 75 Jobs = int.Parse(info[0]); 76 Resources = int.Parse(info[1]); 77 ProcessingTimes = new double[Jobs, Resources]; 78 Demands = new int[Jobs, Resources]; 79 79 80 for (int k = 0; k < Jobs; k++) {81 if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream.");82 var valLine = reader.ReadLine();83 while (String.IsNullOrWhiteSpace(valLine)) valLine = reader.ReadLine();84 var vals = valLine.Split(delim, StringSplitOptions.RemoveEmptyEntries);85 if (vals.Length > 2 * Resources) {86 if (DueDates == null) DueDates = new double[Jobs];87 DueDates[k] = double.Parse(vals.Last(), CultureInfo.InvariantCulture.NumberFormat);88 }80 for (int k = 0; k < Jobs; k++) { 81 if (reader.EndOfStream) throw new InvalidDataException("Unexpected End of Stream."); 82 var valLine = reader.ReadLine(); 83 while (String.IsNullOrWhiteSpace(valLine)) valLine = reader.ReadLine(); 84 var vals = valLine.Split(delim, StringSplitOptions.RemoveEmptyEntries); 85 if (vals.Length > 2 * Resources) { 86 if (DueDates == null) DueDates = new double[Jobs]; 87 DueDates[k] = double.Parse(vals.Last(), CultureInfo.InvariantCulture.NumberFormat); 88 } 89 89 90 for (int i = 0; i < Resources; i++) { 91 Demands[k, i] = int.Parse(vals[2 * i]); 92 ProcessingTimes[k, i] = double.Parse(vals[2 * i + 1], CultureInfo.InvariantCulture.NumberFormat); 90 for (int i = 0; i < Resources; i++) { 91 Demands[k, i] = int.Parse(vals[2 * i]); 92 ProcessingTimes[k, i] = double.Parse(vals[2 * i + 1], CultureInfo.InvariantCulture.NumberFormat); 93 } 93 94 } 94 95 } 95 96 96 } 97 97 98 /// <summary> 99 /// Writes to the given stream data which is expected to be in the JSSP ORLIB format. 100 /// </summary> 101 /// <remarks> 102 /// The stream is not closed or disposed. The caller has to take care of that. 103 /// </remarks> 104 /// <param name="stream">The stream to write data to.</param> 98 105 public void Export(Stream stream) { 99 var writer = new StreamWriter(stream); 100 writer.WriteLine(Name); 101 writer.WriteLine(Description); 102 writer.WriteLine(Jobs.ToString(CultureInfo.InvariantCulture.NumberFormat) + " " + Resources.ToString(CultureInfo.InvariantCulture.NumberFormat)); 103 for (int i = 0; i < Jobs; i++) { 104 for (int j = 0; j < Resources; j++) { 105 writer.Write(Demands[i, j] + " " + ProcessingTimes[i, j] + " "); 106 using (var writer = new StreamWriter(stream, Encoding.UTF8, 4092, true)) { 107 writer.WriteLine(Name); 108 writer.WriteLine(Description); 109 writer.WriteLine(Jobs.ToString(CultureInfo.InvariantCulture.NumberFormat) + " " + Resources.ToString(CultureInfo.InvariantCulture.NumberFormat)); 110 for (int i = 0; i < Jobs; i++) { 111 for (int j = 0; j < Resources; j++) { 112 writer.Write(Demands[i, j] + " " + ProcessingTimes[i, j] + " "); 113 } 114 if (DueDates != null) writer.Write(DueDates[i].ToString("r", CultureInfo.InvariantCulture.NumberFormat)); 115 writer.WriteLine(); 106 116 } 107 if (DueDates != null) writer.Write(DueDates[i].ToString(CultureInfo.InvariantCulture.NumberFormat)); 108 writer.WriteLine(); 117 writer.Flush(); 109 118 } 110 writer.Flush();111 119 } 112 120 -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.Scheduling/3.3/Plugin.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 24 24 namespace HeuristicLab.Problems.Instances.Scheduling { 25 [Plugin("HeuristicLab.Problems.Instances.Scheduling", "3.3.1 3.$WCREV$")]25 [Plugin("HeuristicLab.Problems.Instances.Scheduling", "3.3.15.$WCREV$")] 26 26 [PluginFile("HeuristicLab.Problems.Instances.Scheduling-3.3.dll", PluginFileType.Assembly)] 27 27 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] -
branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.Scheduling/3.3/Properties/AssemblyInfo.cs.frame
r13321 r16692 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 32 32 [assembly: AssemblyCompany("HEAL")] 33 33 [assembly: AssemblyProduct("HeuristicLab")] 34 [assembly: AssemblyCopyright("(c) 2002-201 5HEAL")]34 [assembly: AssemblyCopyright("(c) 2002-2018 HEAL")] 35 35 [assembly: AssemblyTrademark("")] 36 36 [assembly: AssemblyCulture("")] … … 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.1 3.$WCREV$")]57 [assembly: AssemblyFileVersion("3.3.15.$WCREV$")]
Note: See TracChangeset
for help on using the changeset viewer.