Changeset 15541 for branches/2864_PermutationProblems/HeuristicLab.Problems.Instances.PFSP/3.3/FSSPTAILIBParser.cs
- Timestamp:
- 12/19/17 11:10:14 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2864_PermutationProblems/HeuristicLab.Problems.Instances.PFSP/3.3/FSSPTAILIBParser.cs
r15521 r15541 67 67 } 68 68 } 69 70 /// <summary> 71 /// Reads from the given stream data which is expected to be in the JSSP ORLIB format. 72 /// </summary> 73 /// <remarks> 74 /// The stream is not closed or disposed. The caller has to take care of that. 75 /// </remarks> 76 /// <param name="stream">The stream to read data from.</param> 69 77 70 public void Parse(Stream stream) 78 71 { … … 111 104 } 112 105 } 113 114 /// <summary> 115 /// Writes to the given stream data which is expected to be in the JSSP ORLIB format. 116 /// </summary> 117 /// <remarks> 118 /// The stream is not closed or disposed. The caller has to take care of that. 119 /// </remarks> 120 /// <param name="stream">The stream to write data to.</param> 106 121 107 public void Export(Stream stream) 122 108 { 123 //TODO: complete Export, seems as if it is just a dummy (copy-paste)-implementation124 109 using (var writer = new StreamWriter(stream, Encoding.UTF8, 4092, true)) 125 110 { 126 111 writer.WriteLine(Name); 127 112 writer.WriteLine(Description); 128 writer.WriteLine(Jobs.ToString(CultureInfo.InvariantCulture.NumberFormat) + " " + Machines.ToString(CultureInfo.InvariantCulture.NumberFormat)); 129 for (int i = 0; i < Machines; i++) 113 writer.WriteLine(Jobs + '\t' + Machines); 114 writer.WriteLine(BestKnownQuality); 115 116 for (int k = 0; k < Machines; k++) 130 117 { 131 for (int j = 0; j < Jobs; j++)118 for (int i = 0; i < Jobs; i++) 132 119 { 133 writer.Write(ProcessingTimes[ i, j] + "");120 writer.Write(ProcessingTimes[k, i] + "\t"); 134 121 } 135 122 writer.WriteLine(); 123 } 124 125 if (BestKnownSchedule != null) { 126 writer.WriteLine(BestKnownSchedule); 136 127 } 137 128 writer.Flush(); 138 129 } 139 130 } 140 141 131 } 142 132 }
Note: See TracChangeset
for help on using the changeset viewer.