Changeset 6293
- Timestamp:
- 05/26/11 10:25:04 (14 years ago)
- Location:
- branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3
- Files:
-
- 11 added
- 17 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/BestSchedulingSolutionAnalyzer.cs
r6266 r6293 30 30 using HeuristicLab.Parameters; 31 31 using HeuristicLab.Data; 32 using HeuristicLab. Problems.Scheduling.Encodings;32 using HeuristicLab.Encodings.SchedulingEncoding; 33 33 34 34 namespace HeuristicLab.Problems.Scheduling.Analyzers { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Analyzers/SchedulingAnalyzer.cs
r6266 r6293 31 31 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 32 32 using HeuristicLab.Common; 33 using HeuristicLab.Encodings.SchedulingEncoding; 33 34 34 35 namespace HeuristicLab.Problems.Scheduling.Analyzers { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MakespanEvaluator.cs
r6266 r6293 30 30 using HeuristicLab.Optimization; 31 31 using HeuristicLab.Parameters; 32 using HeuristicLab.Encodings.SchedulingEncoding; 32 33 33 34 namespace HeuristicLab.Problems.Scheduling.Evaluators { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/MeanTardinessEvaluator.cs
r6266 r6293 30 30 using HeuristicLab.Optimization; 31 31 using HeuristicLab.Parameters; 32 using HeuristicLab. Problems.Scheduling.Interfaces;32 using HeuristicLab.Encodings.SchedulingEncoding; 33 33 34 34 namespace HeuristicLab.Problems.Scheduling.Evaluators { 35 35 [Item("Men tardiness Evaluator", "Represents an evaluator using the mean tardiness of a schedule.")] 36 36 [StorableClass] 37 public class MeanTardinessEvaluator : SchedulingEvaluator , IJSSPOperator{37 public class MeanTardinessEvaluator : SchedulingEvaluator { 38 38 [StorableConstructor] 39 39 protected MeanTardinessEvaluator(bool deserializing) : base(deserializing) { } … … 46 46 47 47 #region Parameter Properties 48 public ILookupParameter<ItemList<J SSPJob>> JobsParameter {49 get { return (ILookupParameter<ItemList<J SSPJob>>)Parameters["Jobs"]; }48 public ILookupParameter<ItemList<Job>> JobsParameter { 49 get { return (ILookupParameter<ItemList<Job>>)Parameters["Jobs"]; } 50 50 } 51 51 #endregion 52 52 #region Properties 53 public ItemList<J SSPJob> Jobs {53 public ItemList<Job> Jobs { 54 54 get { return JobsParameter.ActualValue; } 55 55 } … … 57 57 58 58 public MeanTardinessEvaluator() : base() { 59 Parameters.Add(new LookupParameter<ItemList<J SSPJob>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance."));59 Parameters.Add(new LookupParameter<ItemList<Job>>("Jobs", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.")); 60 60 } 61 61 -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluationAlgorithm.cs
r6266 r6293 31 31 using HeuristicLab.Data; 32 32 using HeuristicLab.Parameters; 33 using HeuristicLab.Problems.Scheduling.Interfaces; 34 using HeuristicLab.Problems.Scheduling.Encodings; 35 using HeuristicLab.Problems.Scheduling.Encodings.JobShopScheduling.JobSequenceMatrix; 33 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces; 34 using HeuristicLab.Encodings.SchedulingEncoding; 36 35 37 36 namespace HeuristicLab.Problems.Scheduling.Evaluators { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs
r6266 r6293 29 29 using HeuristicLab.Parameters; 30 30 using System; 31 using HeuristicLab.Problems.Scheduling.Encodings;32 31 using HeuristicLab.Operators; 33 using HeuristicLab.Problems.Scheduling.Interfaces; 32 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces; 33 using HeuristicLab.Encodings.SchedulingEncoding; 34 34 35 35 -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/HeuristicLab.Problems.Scheduling-3.3.csproj
r6266 r6293 50 50 <Compile Include="Analyzers\BestSchedulingSolutionAnalyzer.cs" /> 51 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" /> 52 <Compile Include="Decoders\GTAlgorithmUtils.cs" /> 53 <Compile Include="Decoders\JSMDecoder.cs" /> 54 <Compile Include="Decoders\JSMDecodingErrorPolicyTypes.cs" /> 55 <Compile Include="Decoders\JSMForcingStrategyTypes.cs" /> 56 <Compile Include="Decoders\PRVDecoder.cs" /> 57 <Compile Include="Decoders\PWRDecoder.cs" /> 83 58 <Compile Include="Evaluators\SchedulingEvaluatorType.cs" /> 84 59 <Compile Include="Evaluators\SchedulingEvaluatorTypes.cs" /> 85 60 <Compile Include="Evaluators\MeanTardinessEvaluator.cs" /> 86 <Compile Include="Interfaces\IJSSPEncoding.cs" />87 <Compile Include="Interfaces\ISchedulingDecoder.cs" />88 <Compile Include="Interfaces\ISchedulingOperator.cs" />89 <Compile Include="Interfaces\IPWROperator.cs" />90 <Compile Include="Interfaces\IPRVOperator.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" />98 61 <Compile Include="Evaluators\MakespanEvaluator.cs" /> 62 <Compile Include="Evaluators\SchedulingEvaluator.cs" /> 99 63 <Compile Include="IndexedTaskList.cs" /> 100 <Compile Include="Interfaces\IJSMOperator.cs" /> 101 <Compile Include="Interfaces\ISchedulingCrossover.cs" /> 102 <Compile Include="Interfaces\ISchedulingManipulator.cs" /> 103 <Compile Include="Interfaces\ISchedulingCreator.cs" /> 104 <Compile Include="Interfaces\ISchedulingEvaluator.cs" /> 105 <Compile Include="Resource.cs" /> 106 <Compile Include="Evaluators\SchedulingEvaluator.cs" /> 107 <Compile Include="JSSPJob.cs" /> 64 <Compile Include="Interfaces\IJSSPOperator.cs" /> 65 <Compile Include="Job.cs" /> 108 66 <Compile Include="JobShopSchedulingProblem.cs" /> 109 <Compile Include="JSSPTask.cs" />110 <Compile Include="Interfaces\IJSSPOperator.cs" />111 67 <Compile Include="Evaluators\SchedulingEvaluationAlgorithm.cs" /> 68 <Compile Include="Task.cs" /> 112 69 <Compile Include="SchedulingProblem.cs" /> 113 70 <Compile Include="Plugin.cs" /> 114 71 <Compile Include="Properties\AssemblyInfo.cs" /> 115 <Compile Include="Schedule.cs" />116 72 </ItemGroup> 117 73 <ItemGroup> … … 148 104 <Project>{DBECB8B0-B166-4133-BAF1-ED67C3FD7FCA}</Project> 149 105 <Name>HeuristicLab.Encodings.PermutationEncoding-3.3</Name> 106 </ProjectReference> 107 <ProjectReference Include="..\..\HeuristicLab.Encodings.SchedulingEncoding\3.3\HeuristicLab.Encodings.SchedulingEncoding-3.3.csproj"> 108 <Project>{17F3EF80-B2C3-4B8D-A4D5-BE9CE3BA2606}</Project> 109 <Name>HeuristicLab.Encodings.SchedulingEncoding-3.3</Name> 150 110 </ProjectReference> 151 111 <ProjectReference Include="..\..\HeuristicLab.Operators\3.3\HeuristicLab.Operators-3.3.csproj"> -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs
r6266 r6293 31 31 using HeuristicLab.Data; 32 32 using System.IO; 33 using HeuristicLab.Problems.Scheduling.Encodings;34 33 using HeuristicLab.Problems.Scheduling.Evaluators; 35 34 using HeuristicLab.Parameters; 36 using HeuristicLab.Encodings.PermutationEncoding;37 35 using HeuristicLab.Problems.Scheduling.Analyzers; 38 36 using HeuristicLab.PluginInfrastructure; 39 using HeuristicLab.Problems.Scheduling.Interfaces; 40 using HeuristicLab.Encodings.IntegerVectorEncoding; 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; 37 using HeuristicLab.Encodings.SchedulingEncoding; 38 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces; 39 using HeuristicLab.Encodings.SchedulingEncoding.JobSequenceMatrix; 40 using HeuristicLab.Encodings.PermutationEncoding; 41 using HeuristicLab.Encodings.SchedulingEncoding.PriorityRulesVector; 42 using HeuristicLab.Encodings.SchedulingEncoding.PermutationWithRepetition; 43 using HeuristicLab.Problems.Scheduling.Decoders; 45 44 46 45 namespace HeuristicLab.Problems.Scheduling { … … 64 63 65 64 #region Parameter Properties 66 public ValueParameter<ItemList<J SSPJob>> JobsParameter {67 get { return (ValueParameter<ItemList<J SSPJob>>)Parameters["Jobs"]; }65 public ValueParameter<ItemList<Job>> JobDataParameter { 66 get { return (ValueParameter<ItemList<Job>>)Parameters["JobData"]; } 68 67 } 69 68 public ValueParameter<SchedulingEvaluatorType> EvaluatorTypeParameter { … … 74 73 } 75 74 75 public ValueParameter<IntValue> JobsParameter { 76 get { return (ValueParameter<IntValue>)Parameters["Jobs"]; } 77 } 78 public ValueParameter<IntValue> ResourcesParameter { 79 get { return (ValueParameter<IntValue>)Parameters["Resources"]; } 80 } 81 76 82 #endregion 77 83 78 84 #region Properties 79 public ItemList<J SSPJob> Jobs{80 get { return Job sParameter.Value; }81 set { Job sParameter.Value = value; }85 public ItemList<Job> JobData { 86 get { return JobDataParameter.Value; } 87 set { JobDataParameter.Value = value; } 82 88 } 83 89 public SchedulingEvaluatorType EvaluatorType { … … 89 95 set { BestKnownSolutionParameter.Value = value; } 90 96 } 97 public IntValue Jobs { 98 get { return JobsParameter.Value; } 99 set { JobsParameter.Value = value; } 100 } 101 public IntValue Resources { 102 get { return ResourcesParameter.Value; } 103 set { ResourcesParameter.Value = value; } 104 } 91 105 #endregion 92 106 93 107 [Storable] 94 private JSSPEncodingTypes encodingType;108 private SchedulingEncodingTypes encodingType; 95 109 96 110 public JobShopSchedulingProblem() 97 111 : 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.")); 101 encodingType = JSSPEncodingTypes.JSMEncoding; 112 Parameters.Add(new ValueParameter<ItemList<Job>>("JobData", "Jobdata defining the precedence relationships and the duration of the tasks in this JSSP-Instance.", new ItemList<Job>())); 113 Parameters.Add(new ValueParameter<SchedulingEvaluatorType>("EvaluatorType", "Type of the evaluator used to determine the quality of an individual.", new SchedulingEvaluatorType(SchedulingEvaluatorTypes.MakespanEvaluator))); 114 Parameters.Add(new OptionalValueParameter<Schedule>("BestKnownSolution", "The best known solution of this JSSP instance.")); 115 116 Parameters.Add(new ValueParameter<IntValue>("Jobs", "The number of jobs used in this JSSP instance.", new IntValue ())); 117 Parameters.Add(new ValueParameter<IntValue>("Resources", "The number of resources used this JSSP instance.", new IntValue())); 118 encodingType = SchedulingEncodingTypes.JSMEncoding; 102 119 InitializeOperators(); 103 120 AttachEventHandlers(); … … 108 125 protected override void OnSolutionCreatorChanged() { 109 126 if (SolutionCreator.GetType().Equals(typeof(JSMRandomCreator))) 110 encodingType = JSSPEncodingTypes.JSMEncoding;127 encodingType = SchedulingEncodingTypes.JSMEncoding; 111 128 else { 112 129 if (SolutionCreator.GetType().Equals(typeof(PRVRandomCreator))) 113 encodingType = JSSPEncodingTypes.PRVEncoding;130 encodingType = SchedulingEncodingTypes.PRVEncoding; 114 131 else 115 encodingType = JSSPEncodingTypes.PWREncoding;132 encodingType = SchedulingEncodingTypes.PWREncoding; 116 133 } 117 134 InitializeOperators(); … … 130 147 private void ApplyEncoding() { 131 148 if (EvaluatorType.Value == SchedulingEvaluatorTypes.MakespanEvaluator) { 132 if (encodingType == JSSPEncodingTypes.JSMEncoding) {149 if (encodingType == SchedulingEncodingTypes.JSMEncoding) { 133 150 Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>()); 134 151 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MakespanEvaluator()); 135 152 } else { 136 if (encodingType == JSSPEncodingTypes.PRVEncoding) {153 if (encodingType == SchedulingEncodingTypes.PRVEncoding) { 137 154 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>()); 138 155 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MakespanEvaluator()); 139 156 } else { 140 if (encodingType == JSSPEncodingTypes.PWREncoding) {157 if (encodingType == SchedulingEncodingTypes.PWREncoding) { 141 158 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>()); 142 159 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MakespanEvaluator()); … … 145 162 } 146 163 } else { 147 if (encodingType == JSSPEncodingTypes.JSMEncoding) {164 if (encodingType == SchedulingEncodingTypes.JSMEncoding) { 148 165 Operators.AddRange(ApplicationManager.Manager.GetInstances<IJSMOperator>()); 149 166 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<JSMEncoding>(new JSMDecoder(), new MeanTardinessEvaluator()); 150 167 } else { 151 if (encodingType == JSSPEncodingTypes.PRVEncoding) {168 if (encodingType == SchedulingEncodingTypes.PRVEncoding) { 152 169 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPRVOperator>()); 153 170 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PRVEncoding>(new PRVDecoder(), new MeanTardinessEvaluator()); 154 171 } else { 155 if (encodingType == JSSPEncodingTypes.PWREncoding) {172 if (encodingType == SchedulingEncodingTypes.PWREncoding) { 156 173 Operators.AddRange(ApplicationManager.Manager.GetInstances<IPWROperator>()); 157 174 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(new PWRDecoder(), new MeanTardinessEvaluator()); … … 203 220 bool problemFound = false; 204 221 205 Job s = new ItemList<JSSPJob>();222 JobData = new ItemList<Job>(); 206 223 207 224 while (!problemFile.EndOfStream && !problemFound) { … … 210 227 if (data.Count > 0 && ((int)data[0][0] >= 48 && (int)data[0][0] <= 57)) { 211 228 int jobCount = 0; 212 //data[0] = nrOfJobs (int)213 //data[1] = nrOfResources (int)229 Jobs = new IntValue (Int32.Parse(data[0])); 230 Resources = new IntValue (Int32.Parse(data[1])); 214 231 //data[2] = bestKnownQuality (double) 215 232 //data[3] = dueDates (0|1) … … 228 245 dataCount--; 229 246 } 230 J SSPJob j = new JSSPJob(new IntValue(jobCount), dueDate);247 Job j = new Job(new IntValue(jobCount), dueDate); 231 248 for (int i = 0; i < dataCount; i++) { 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)); 233 if (j.Tasks.Count > 0) { 234 t.StartTime = new DoubleValue (j.Tasks[j.Tasks.Count - 1].EndTime.Value + 2); 235 } 249 Task t = new Task(i / 2, Int32.Parse(data[i]), jobCount, Double.Parse(data[i + 1])); 236 250 j.Tasks.Add(t); 237 251 i++; 238 252 }//for 239 this.Job s.Add(j);253 this.JobData.Add(j); 240 254 jobCount++; 241 255 line = problemFile.ReadLine(); … … 277 291 278 292 JSMDecoder decoder = new JSMDecoder(); 279 Schedule result = decoder.CreateScheduleFromEncoding(solution, Job s);293 Schedule result = decoder.CreateScheduleFromEncoding(solution, JobData); 280 294 BestKnownSolution = result; 281 295 } -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/SchedulingProblem.cs
r6177 r6293 28 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 29 29 using HeuristicLab.Common; 30 using HeuristicLab. Problems.Scheduling.Interfaces;30 using HeuristicLab.Encodings.SchedulingEncoding.Interfaces; 31 31 32 32 namespace HeuristicLab.Problems.Scheduling {
Note: See TracChangeset
for help on using the changeset viewer.