Changeset 6266 for branches/Scheduling/HeuristicLab.Problems.Scheduling
- Timestamp:
- 05/24/11 16:20:04 (14 years ago)
- Location:
- branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
- Files:
-
- 18 added
- 8 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
- Property svn:ignore
-
old new 1 1 Plugin.cs 2 bin 3 obj
-
- Property svn:ignore
-
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs
r6260 r6266 36 36 [Item("BestSchedulingSolutionAnalyzer", "An operator for analyzing the best solution of Scheduling Problems given in schedule-representation.")] 37 37 [StorableClass] 38 public sealed class BestSchedulingSolutionAnalyzer : JSSPOperator, IAnalyzer, IStochasticOperator {38 public sealed class BestSchedulingSolutionAnalyzer : SchedulingAnalyzer, IStochasticOperator { 39 39 [StorableConstructor] 40 40 private BestSchedulingSolutionAnalyzer(bool deserializing) : base(deserializing) { } … … 46 46 } 47 47 48 49 48 public ILookupParameter<IRandom> RandomParameter { 50 49 get { return (LookupParameter<IRandom>)Parameters["Random"]; } … … 54 53 } 55 54 56 57 public LookupParameter<BoolValue> MaximizationParameter { 58 get { return (LookupParameter<BoolValue>)Parameters["Maximization"]; } 59 } 60 public ScopeTreeLookupParameter<DoubleValue> QualityParameter { 61 get { return (ScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"]; } 62 } 63 public LookupParameter<Schedule> BestSolutionParameter { 64 get { return (LookupParameter<Schedule>)Parameters["BestSolution"]; } 65 } 66 public ValueLookupParameter<ResultCollection> ResultsParameter { 67 get { return (ValueLookupParameter<ResultCollection>)Parameters["Results"]; } 68 } 69 public LookupParameter<DoubleValue> BestKnownQualityParameter { 70 get { return (LookupParameter<DoubleValue>)Parameters["BestKnownQuality"]; } 71 } 72 public LookupParameter<Schedule> BestKnownSolutionParameter { 73 get { return (LookupParameter<Schedule>)Parameters["BestKnownSolution"]; } 74 } 75 public ScopeTreeLookupParameter<Schedule> SchedulingSolutionParameter { 76 get { return (ScopeTreeLookupParameter<Schedule>)Parameters["DecodedSchedulingSolution"]; } 55 public BestSchedulingSolutionAnalyzer () : base () { 56 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator.")); 77 57 } 78 58 79 80 81 public BestSchedulingSolutionAnalyzer () {82 Parameters.Add(new LookupParameter<IRandom>("Random", "The pseudo random number generator."));83 84 Parameters.Add(new LookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));85 Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The qualities of the JSSP solutions which should be analyzed."));86 Parameters.Add(new ScopeTreeLookupParameter<Schedule>("DecodedSchedulingSolution", "The solutions from which the best solution has to be chosen from."));87 Parameters.Add(new LookupParameter<Schedule>("BestSolution", "The best JSSP solution."));88 Parameters.Add(new ValueLookupParameter<ResultCollection>("Results", "The result collection where the best JSSP solution should be stored."));89 Parameters.Add(new LookupParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this JSSP instance."));90 Parameters.Add(new LookupParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance."));91 }92 93 94 59 public override IOperation Apply() { 95 ItemList<JSSPJob> jobs = Jobs;96 60 ItemArray<DoubleValue> qualities = QualityParameter.ActualValue; 97 61 ItemArray<Schedule> solutions = SchedulingSolutionParameter.ActualValue; … … 128 92 return base.Apply(); 129 93 } 130 131 94 } 132 95 } -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MakespanEvaluator.cs
r6260 r6266 34 34 [Item("Makespan Evaluator", "Represents an evaluator using the maximum makespan of a schedule.")] 35 35 [StorableClass] 36 public class MakespanEvaluator : JSSPEvaluator {36 public class MakespanEvaluator : SchedulingEvaluator { 37 37 [StorableConstructor] 38 38 protected MakespanEvaluator(bool deserializing) : base(deserializing) { } -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/HeuristicLab.Problems.Scheduling-3.3.csproj
r6260 r6266 49 49 <ItemGroup> 50 50 <Compile Include="Analyzers\BestSchedulingSolutionAnalyzer.cs" /> 51 <Compile Include="Encodings\JobSequenceMatrix\JSMDecodingErrorPolicyTypes.cs" /> 52 <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMJOXCrossover.cs" /> 53 <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMCrossover.cs" /> 54 <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMOXCrossover.cs" /> 55 <Compile Include="Encodings\JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" /> 56 <Compile Include="Encodings\JobSequenceMatrix\JSMDecoder.cs" /> 57 <Compile Include="Encodings\JobSequenceMatrix\JSMForcingStrategyTypes.cs" /> 58 <Compile Include="Encodings\JobSequenceMatrix\JSMRandomCreator.cs" /> 59 <Compile Include="Encodings\JobSequenceMatrix\JSMEncoding.cs" /> 60 <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMShiftChangeManipulator.cs" /> 61 <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMManipulator.cs" /> 62 <Compile Include="Encodings\JobSequenceMatrix\Manipulators\JSMSwapManipulator.cs" /> 63 <Compile Include="Encodings\JSSPCrossover.cs" /> 64 <Compile Include="Encodings\JSSPDecoder.cs" /> 65 <Compile Include="Encodings\JSSPEncodingTypes.cs" /> 66 <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRGOXCrossover.cs" /> 67 <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRCrossover.cs" /> 68 <Compile Include="Encodings\PermutationWithRepetition\Crossovers\PWRPPXCrossover.cs" /> 69 <Compile Include="Encodings\PermutationWithRepetition\Manipulators\PWRUniformOnePositionManipulator.cs" /> 70 <Compile Include="Encodings\PermutationWithRepetition\Manipulators\PWRManipulator.cs" /> 71 <Compile Include="Encodings\PermutationWithRepetition\PWRDecoder.cs" /> 72 <Compile Include="Encodings\PermutationWithRepetition\PWREncoding.cs" /> 73 <Compile Include="Encodings\PermutationWithRepetition\PWRRandomCreator.cs" /> 74 <Compile Include="Encodings\PriorityRulesVector\Crossovers\PRVSinglePointCrossover.cs" /> 75 <Compile Include="Encodings\PriorityRulesVector\Crossovers\PRVDiscreteCrossover.cs" /> 76 <Compile Include="Encodings\PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" /> 77 <Compile Include="Encodings\PriorityRulesVector\PRVEncoding.cs" /> 78 <Compile Include="Interfaces\IJSSPDecoder.cs" /> 51 <Compile Include="Analyzers\SchedulingAnalyzer.cs" /> 52 <Compile Include="Encodings\JobShopScheduling\JSSPManipulator.cs" /> 53 <Compile Include="Encodings\JobShopScheduling\JSSPDecoder.cs" /> 54 <Compile Include="Encodings\JobShopScheduling\JSSPCrossover.cs" /> 55 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMDecodingErrorPolicyTypes.cs" /> 56 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMJOXCrossover.cs" /> 57 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMCrossover.cs" /> 58 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMOXCrossover.cs" /> 59 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Crossovers\JSMSXXCrossover.cs" /> 60 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMDecoder.cs" /> 61 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMForcingStrategyTypes.cs" /> 62 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMRandomCreator.cs" /> 63 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\JSMEncoding.cs" /> 64 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMShiftChangeManipulator.cs" /> 65 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMManipulator.cs" /> 66 <Compile Include="Encodings\JobShopScheduling\JobSequenceMatrix\Manipulators\JSMSwapManipulator.cs" /> 67 <Compile Include="Encodings\JobShopScheduling\JSSPCreator.cs" /> 68 <Compile Include="Encodings\SchedulingCrossover.cs" /> 69 <Compile Include="Encodings\SchedulingDecoder.cs" /> 70 <Compile Include="Encodings\JobShopScheduling\JSSPEncodingTypes.cs" /> 71 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRGOXCrossover.cs" /> 72 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRCrossover.cs" /> 73 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Crossovers\PWRPPXCrossover.cs" /> 74 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Manipulators\PWRUniformOnePositionManipulator.cs" /> 75 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\Manipulators\PWRManipulator.cs" /> 76 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWRDecoder.cs" /> 77 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWREncoding.cs" /> 78 <Compile Include="Encodings\JobShopScheduling\PermutationWithRepetition\PWRRandomCreator.cs" /> 79 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVSinglePointCrossover.cs" /> 80 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVDiscreteCrossover.cs" /> 81 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Manipulators\PRVUniformOnePositionManipulator.cs" /> 82 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVEncoding.cs" /> 83 <Compile Include="Evaluators\SchedulingEvaluatorType.cs" /> 84 <Compile Include="Evaluators\SchedulingEvaluatorTypes.cs" /> 85 <Compile Include="Evaluators\MeanTardinessEvaluator.cs" /> 86 <Compile Include="Interfaces\IJSSPEncoding.cs" /> 87 <Compile Include="Interfaces\ISchedulingDecoder.cs" /> 79 88 <Compile Include="Interfaces\ISchedulingOperator.cs" /> 80 89 <Compile Include="Interfaces\IPWROperator.cs" /> 81 90 <Compile Include="Interfaces\IPRVOperator.cs" /> 82 <Compile Include="Interfaces\I JSSPEncoding.cs" />83 <Compile Include="Encodings\ JSSPCreator.cs" />84 <Compile Include="Encodings\ JSSPManipulator.cs" />85 <Compile Include="Encodings\ PriorityRulesVector\Crossovers\PRVCrossover.cs" />86 <Compile Include="Encodings\ PriorityRulesVector\PRVDecoder.cs" />87 <Compile Include="Encodings\ PriorityRulesVector\PRVRandomCreator.cs" />88 <Compile Include="Encodings\ PriorityRulesVector\Manipulators\PRVManipulator.cs" />91 <Compile Include="Interfaces\ISchedulingEncoding.cs" /> 92 <Compile Include="Encodings\SchedulingCreator.cs" /> 93 <Compile Include="Encodings\SchedulingManipulator.cs" /> 94 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Crossovers\PRVCrossover.cs" /> 95 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVDecoder.cs" /> 96 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\PRVRandomCreator.cs" /> 97 <Compile Include="Encodings\JobShopScheduling\PriorityRulesVector\Manipulators\PRVManipulator.cs" /> 89 98 <Compile Include="Evaluators\MakespanEvaluator.cs" /> 90 99 <Compile Include="IndexedTaskList.cs" /> 91 100 <Compile Include="Interfaces\IJSMOperator.cs" /> 92 <Compile Include="Interfaces\I JSSPCrossover.cs" />93 <Compile Include="Interfaces\I JSSPManipulator.cs" />101 <Compile Include="Interfaces\ISchedulingCrossover.cs" /> 102 <Compile Include="Interfaces\ISchedulingManipulator.cs" /> 94 103 <Compile Include="Interfaces\ISchedulingCreator.cs" /> 95 104 <Compile Include="Interfaces\ISchedulingEvaluator.cs" /> 96 105 <Compile Include="Resource.cs" /> 97 <Compile Include="Evaluators\ JSSPEvaluator.cs" />106 <Compile Include="Evaluators\SchedulingEvaluator.cs" /> 98 107 <Compile Include="JSSPJob.cs" /> 99 108 <Compile Include="JobShopSchedulingProblem.cs" /> 100 109 <Compile Include="JSSPTask.cs" /> 101 <Compile Include=" Encodings\JSSPOperator.cs" />102 <Compile Include="Evaluators\ JSSPEvaluationAlgorithm.cs" />110 <Compile Include="Interfaces\IJSSPOperator.cs" /> 111 <Compile Include="Evaluators\SchedulingEvaluationAlgorithm.cs" /> 103 112 <Compile Include="SchedulingProblem.cs" /> 104 113 <Compile Include="Plugin.cs" /> -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/IndexedTaskList.cs
r6177 r6266 65 65 #endregion 66 66 67 public DoubleValue TotalDuration { 68 get { 69 double result = 0; 70 foreach (JSSPTask t in Tasks) { 71 if (t.EndTime.Value > result) 72 result = t.EndTime.Value; 73 } 74 return new DoubleValue(result); 75 } 76 } 77 67 78 public IndexedTaskList (IntValue index) : base (){ 68 79 Parameters.Add(new ValueParameter<IntValue>("Index", "The index of the resource in the associated Scheduling Problem.", new IntValue())); -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JSSPJob.cs
r6260 r6266 38 38 protected JSSPJob(JSSPJob original, Cloner cloner) 39 39 : base(original, cloner) { 40 this.DueDate = cloner.Clone(original.DueDate); 40 41 } 41 42 public override IDeepCloneable Clone(Cloner cloner) { … … 43 44 } 44 45 45 public JSSPJob(IntValue index) : base (index) {} 46 public DoubleValue DueDate { get; set; } 47 48 public JSSPJob(IntValue index, DoubleValue dueDate) : base (index) { 49 if (dueDate != null) 50 DueDate = (DoubleValue)dueDate.Clone(); 51 else 52 DueDate = null; 53 } 46 54 47 55 public override string ToString() { … … 51 59 sb.Append(t.ToString () + " "); 52 60 } 61 if (DueDate != null) 62 sb.Append("{" + DueDate.Value + "} "); 53 63 sb.Append("]"); 54 64 return sb.ToString(); -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs
r6260 r6266 34 34 using HeuristicLab.Problems.Scheduling.Evaluators; 35 35 using HeuristicLab.Parameters; 36 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix;37 36 using HeuristicLab.Encodings.PermutationEncoding; 38 37 using HeuristicLab.Problems.Scheduling.Analyzers; 39 38 using HeuristicLab.PluginInfrastructure; 40 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix.Manipulators;41 using HeuristicLab.Problems.Scheduling.Encodings.JobSequenceMatrix.Crossovers;42 39 using HeuristicLab.Problems.Scheduling.Interfaces; 43 using HeuristicLab.Problems.Scheduling.Encodings.PriorityRulesVector;44 40 using HeuristicLab.Encodings.IntegerVectorEncoding; 45 using HeuristicLab.Problems.Scheduling.Encodings.PermutationWithRepetition; 41 using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling; 42 using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.JobSequenceMatrix; 43 using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.PriorityRulesVector; 44 using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.PermutationWithRepetition; 46 45 47 46 namespace HeuristicLab.Problems.Scheduling { … … 54 53 private JobShopSchedulingProblem(JobShopSchedulingProblem original, Cloner cloner) 55 54 : base(original, cloner) { 56 this.encodingType = original.encodingType; 55 this.encodingType = original.encodingType; 56 this.Jobs = cloner.Clone(original.Jobs); 57 this.EvaluatorType = cloner.Clone(original.EvaluatorType); 57 58 AttachEventHandlers(); 58 59 } … … 66 67 get { return (ValueParameter<ItemList<JSSPJob>>)Parameters["Jobs"]; } 67 68 } 69 public ValueParameter<SchedulingEvaluatorType> EvaluatorTypeParameter { 70 get { return (ValueParameter<SchedulingEvaluatorType>)Parameters["EvaluatorType"]; } 71 } 68 72 public OptionalValueParameter<Schedule> BestKnownSolutionParameter { 69 73 get { return (OptionalValueParameter<Schedule>)Parameters["BestKnownSolution"]; } 70 74 } 75 71 76 #endregion 72 77 … … 76 81 set { JobsParameter.Value = value; } 77 82 } 83 public SchedulingEvaluatorType EvaluatorType { 84 get { return EvaluatorTypeParameter.Value; } 85 set { EvaluatorTypeParameter.Value = value; } 86 } 78 87 public Schedule BestKnownSolution { 79 88 get { return BestKnownSolutionParameter.Value; } … … 86 95 87 96 public JobShopSchedulingProblem() 88 : base(new JSSPEvaluationAlgorithm (), new JSMRandomCreator ()) { 89 Parameters.Add(new ValueParameter<ItemList<JSSPJob>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.", new ItemList<JSSPJob>())); 90 Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance.")); 97 : base(new SchedulingEvaluationAlgorithm (), new JSMRandomCreator ()) { 98 Parameters.Add(new ValueParameter<ItemList<JSSPJob>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.", new ItemList<JSSPJob>())); 99 Parameters.Add(new ValueParameter<SchedulingEvaluatorType>("EvaluatorType", "Type of the evaluator used to determine the quality of an individual.", new SchedulingEvaluatorType (SchedulingEvaluatorTypes.MakespanEvaluator))); 100 Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance.")); 91 101 encodingType = JSSPEncodingTypes.JSMEncoding; 92 102 InitializeOperators(); … … 119 129 120 130 private void ApplyEncoding() { 121 if (encodingType == JSSPEncodingTypes.JSMEncoding) { 122 Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>()); 123 ((JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MakespanEvaluator()); 131 if (EvaluatorType.Value == SchedulingEvaluatorTypes.MakespanEvaluator) { 132 if (encodingType == JSSPEncodingTypes.JSMEncoding) { 133 Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>()); 134 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MakespanEvaluator()); 135 } else { 136 if (encodingType == JSSPEncodingTypes.PRVEncoding) { 137 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>()); 138 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MakespanEvaluator()); 139 } else { 140 if (encodingType == JSSPEncodingTypes.PWREncoding) { 141 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>()); 142 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MakespanEvaluator()); 143 } 144 } 145 } 124 146 } else { 125 if (encodingType == JSSPEncodingTypes. PRVEncoding) {126 Operators.AddRange(ApplicationManager.Manager.GetInstances<I PRVOperator>());127 (( JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MakespanEvaluator());147 if (encodingType == JSSPEncodingTypes.JSMEncoding) { 148 Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>()); 149 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MeanTardinessEvaluator()); 128 150 } else { 129 if (encodingType == JSSPEncodingTypes.PWREncoding) { 130 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>()); 131 ((JSSPEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MakespanEvaluator()); 151 if (encodingType == JSSPEncodingTypes.PRVEncoding) { 152 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>()); 153 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MeanTardinessEvaluator()); 154 } else { 155 if (encodingType == JSSPEncodingTypes.PWREncoding) { 156 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>()); 157 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MeanTardinessEvaluator()); 158 } 132 159 } 133 160 } … … 183 210 if (data.Count > 0 && ((int)data[0][0] >= 48 && (int)data[0][0] <= 57)) { 184 211 int jobCount = 0; 185 //data[0] = nrOfJobs 186 //data[1] = nrOfResources 212 //data[0] = nrOfJobs (int) 213 //data[1] = nrOfResources (int) 214 //data[2] = bestKnownQuality (double) 215 //data[3] = dueDates (0|1) 216 bool withDueDates = false; 187 217 if (data.Count > 2) 188 218 BestKnownQualityParameter.ActualValue = new DoubleValue(Double.Parse (data[2])); 219 if (data.Count > 3 && data[3] == "1") 220 withDueDates = true; 189 221 line = problemFile.ReadLine(); 190 222 data = SplitString(line); 191 223 while (!problemFile.EndOfStream && data.Count > 0 && ((int)data[0][0] >= 48 && (int)data[0][0] <= 57)) { 192 JSSPJob j = new JSSPJob(new IntValue(jobCount)); 193 for (int i = 0; i < data.Count; i++) { 224 DoubleValue dueDate = null; 225 int dataCount = data.Count; 226 if (withDueDates) { 227 dueDate = new DoubleValue(Double.Parse(data[data.Count - 1])); 228 dataCount--; 229 } 230 JSSPJob j = new JSSPJob(new IntValue(jobCount), dueDate); 231 for (int i = 0; i < dataCount; i++) { 194 232 JSSPTask t = new JSSPTask(new IntValue (i / 2), new IntValue(Int32.Parse(data[i])), new DoubleValue(Double.Parse(data[i + 1])), new IntValue (jobCount)); 195 233 if (j.Tasks.Count > 0) { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Resource.cs
r6260 r6266 43 43 } 44 44 45 public DoubleValue TotalDuration {46 get {47 double result = 0;48 foreach (JSSPTask t in Tasks) {49 if (t.EndTime.Value > result)50 result = t.EndTime.Value;51 }52 return new DoubleValue (result);53 }54 }55 56 45 public Resource(IntValue index) : base (index) { } 57 46
Note: See TracChangeset
for help on using the changeset viewer.