Changeset 6475
- Timestamp:
- 06/24/11 14:23:19 (13 years ago)
- Location:
- branches/Scheduling
- Files:
-
- 13 added
- 3 deleted
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding.Tests/HeuristicLab.Encodings.ScheduleEncoding-3.3.Tests.csproj
r6406 r6475 52 52 </ItemGroup> 53 53 <ItemGroup> 54 <Compile Include="DirectScheduleGTCrossoverTest.cs" /> 54 55 <Compile Include="JSMJOXCrossoverTest.cs" /> 55 56 <Compile Include="JSMShiftChangeManipulatorTest.cs" /> -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding.Tests/TestUtils.cs
r6406 r6475 39 39 return result; 40 40 } 41 42 43 public static ItemList<Job> CreateJobData() { 44 Job j1 = new Job(0, 0); 45 j1.Tasks = new ItemList<Task> { 46 new Task (0, 0, j1.Index, 1), 47 new Task (1, 1, j1.Index, 2), 48 new Task (2, 2, j1.Index, 1) 49 }; 50 51 Job j2 = new Job(1, 0); 52 j2.Tasks = new ItemList<Task> { 53 new Task (3, 2, j2.Index, 2), 54 new Task (4, 1, j2.Index, 1), 55 new Task (5, 0, j2.Index, 2) 56 }; 57 58 Job j3 = new Job(2, 0); 59 j3.Tasks = new ItemList<Task> { 60 new Task (6, 0, j3.Index, 1), 61 new Task (7, 2, j3.Index, 2), 62 new Task (8, 1, j3.Index, 1) 63 }; 64 65 return new ItemList<Job> { j1, j2, j3 }; 66 } 67 68 public static Schedule CreateTestSchedule1() { 69 Schedule result = DirectScheduleRandomCreator.Apply(3, 3, new PWREncoding(3, 3, new TestRandom(new int[] { 1, 0, 1, 1, 2, 0, 2, 2, 0 }, null)), CreateJobData()); 70 return result; 71 } 72 73 public static Schedule CreateTestSchedule2() { 74 Schedule result = DirectScheduleRandomCreator.Apply(3, 3, new PWREncoding(3, 3, new TestRandom(new int[] { 0, 1, 1, 0, 2, 0, 1, 2, 2 }, null)), CreateJobData()); 75 return result; 76 } 41 77 } 42 78 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding.Views/3.3/Plugin.cs
r6414 r6475 23 23 24 24 namespace HeuristicLab.Encodings.ScheduleEncoding.Views { 25 [Plugin("HeuristicLab.Encodings.ScheduleEncoding.Views", "3.3.3.641 2")]25 [Plugin("HeuristicLab.Encodings.ScheduleEncoding.Views", "3.3.3.6414")] 26 26 [PluginFile("HeuristicLab.Encodings.ScheduleEncoding.Views-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabEncodingsScheduleEncodingViewsPlugin : PluginBase { -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding.Views/3.3/Properties/AssemblyInfo.cs
r6414 r6475 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.3.641 2")]57 [assembly: AssemblyFileVersion("3.3.3.6414")] -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/HeuristicLab.Encodings.ScheduleEncoding-3.3.csproj
r6406 r6475 47 47 </ItemGroup> 48 48 <ItemGroup> 49 <Compile Include="Interfaces\IDirectScheduleOperator.cs" /> 49 50 <Compile Include="Interfaces\IScheduleEvaluationAlgorithm.cs" /> 50 51 <Compile Include="Interfaces\IJSMOperator.cs" /> … … 71 72 <Compile Include="PermutationWithRepetition\Crossovers\PWRPPXCrossover.cs" /> 72 73 <Compile Include="PermutationWithRepetition\Manipulators\PWRManipulator.cs" /> 73 <Compile Include="PermutationWithRepetition\Manipulators\PWR UniformOnePositionManipulator.cs" />74 <Compile Include="PermutationWithRepetition\Manipulators\PWRInsertionManipulator.cs" /> 74 75 <Compile Include="PermutationWithRepetition\PWREncoding.cs" /> 75 76 <Compile Include="PermutationWithRepetition\PWRRandomCreator.cs" /> … … 83 84 <Compile Include="PriorityRulesVector\PRVRandomCreator.cs" /> 84 85 <Compile Include="Properties\AssemblyInfo.cs" /> 86 <Compile Include="ScheduleEncoding\Crossovers\DirectScheduleCrossover.cs" /> 87 <Compile Include="ScheduleEncoding\Crossovers\DirectScheduleGTCrossover.cs" /> 88 <Compile Include="ScheduleEncoding\GTAlgorithmUtils.cs" /> 89 <Compile Include="ScheduleEncoding\Job.cs" /> 90 <Compile Include="ScheduleEncoding\Manipulators\DirectScheduleManipulator.cs" /> 91 <Compile Include="ScheduleEncoding\Manipulators\ConcreteScheduleManipulator.cs" /> 92 <Compile Include="ScheduleEncoding\DirectScheduleRandomCreator.cs" /> 85 93 <Compile Include="ScheduleEncoding\Resource.cs" /> 86 94 <Compile Include="ScheduleEncoding\Schedule.cs" /> … … 89 97 <Compile Include="ScheduleCrossover.cs" /> 90 98 <Compile Include="ScheduleDecoder.cs" /> 99 <Compile Include="ScheduleEncoding\Task.cs" /> 91 100 <Compile Include="ScheduleManipulator.cs" /> 92 101 </ItemGroup> -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/JSMRandomCreator.cs
r6406 r6475 64 64 65 65 66 p rotected override JSMEncoding CreateSolution() {66 public static JSMEncoding Apply(int jobs, int resources, IRandom random) { 67 67 JSMEncoding solution = new JSMEncoding(); 68 IntValue nrOfJobs = new IntValue(JobsParameter.ActualValue.Value);69 IntValue nrOfResources = new IntValue(ResourcesParameter.ActualValue.Value);70 68 71 for (int i = 0; i < nrOfResources.Value; i++) {72 solution.JobSequenceMatrix.Add(new Permutation(PermutationTypes.Absolute, nrOfJobs.Value, RandomParameter.ActualValue));69 for (int i = 0; i < resources; i++) { 70 solution.JobSequenceMatrix.Add(new Permutation(PermutationTypes.Absolute, jobs, random)); 73 71 } 74 72 75 73 return solution; 76 74 } 75 76 77 protected override JSMEncoding CreateSolution() { 78 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue); 79 } 77 80 } 78 81 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRPPXCrossover.cs
r6406 r6475 28 28 29 29 namespace HeuristicLab.Encodings.ScheduleEncoding.PermutationWithRepetition { 30 [Item("PWR OrderCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")]30 [Item("PWRPPXCrossover", "Represents a crossover operation swapping sequences of the parents to generate offspring.")] 31 31 [StorableClass] 32 32 public class PWRPPXCrossover : PWRCrossover { -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWREncoding.cs
r6406 r6475 48 48 } 49 49 50 public PWREncoding(int problemDimension, IRandom random)50 public PWREncoding(int nrOfJobs, int nrOfResources, IRandom random) 51 51 : base() { 52 PermutationWithRepetition = new IntegerVector( problemDimension * problemDimension);53 int[] lookUpTable = new int[ problemDimension];52 PermutationWithRepetition = new IntegerVector(nrOfJobs * nrOfResources); 53 int[] lookUpTable = new int[nrOfJobs]; 54 54 55 55 for (int i = 0; i < PermutationWithRepetition.Length; i++) { 56 int newValue = random.Next( problemDimension);57 while (lookUpTable[newValue] >= problemDimension)58 newValue = random.Next( problemDimension);56 int newValue = random.Next(nrOfJobs); 57 while (lookUpTable[newValue] >= nrOfResources) 58 newValue = random.Next(nrOfJobs); 59 59 60 60 PermutationWithRepetition[i] = newValue; -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/PWRRandomCreator.cs
r6406 r6475 63 63 } 64 64 65 public static PWREncoding Apply(int jobs, int resources, IRandom random) { 66 return new PWREncoding(jobs, resources, random); 67 } 68 65 69 66 70 protected override PWREncoding CreateSolution() { 67 PWREncoding result = new PWREncoding(JobsParameter.ActualValue.Value, Random); 68 return result; 71 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, Random); 69 72 } 70 73 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/Plugin.cs
r6414 r6475 23 23 24 24 namespace HeuristicLab.Encodings.ScheduleEncoding { 25 [Plugin("HeuristicLab.Encodings.ScheduleEncoding", "3.3.3.641 2")]25 [Plugin("HeuristicLab.Encodings.ScheduleEncoding", "3.3.3.6414")] 26 26 [PluginFile("HeuristicLab.Encodings.ScheduleEncoding-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabEncodingsScheduleEncodingPlugin : PluginBase { -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/PRVRandomCreator.cs
r6406 r6475 64 64 } 65 65 66 public static PRVEncoding Apply(int jobs, int resources, IRandom random, IntValue nrOfRules) { 67 return new PRVEncoding(jobs * resources, random, 0, nrOfRules.Value, nrOfRules); 68 } 66 69 67 70 protected override PRVEncoding CreateSolution() { 68 IntValue nrOfJobs = new IntValue(JobsParameter.ActualValue.Value); 69 IntValue nrOfResources = new IntValue(ResourcesParameter.ActualValue.Value); 70 PRVEncoding solution = new PRVEncoding(nrOfJobs.Value * nrOfResources.Value, RandomParameter.ActualValue, 0, NrOfRules.Value, NrOfRules); 71 return solution; 71 return Apply(JobsParameter.ActualValue.Value, ResourcesParameter.ActualValue.Value, RandomParameter.ActualValue, NrOfRules); 72 72 } 73 74 73 75 } 74 76 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/Properties/AssemblyInfo.cs
r6414 r6475 55 55 // [assembly: AssemblyVersion("1.0.*")] 56 56 [assembly: AssemblyVersion("3.3.0.0")] 57 [assembly: AssemblyFileVersion("3.3.3.641 2")]57 [assembly: AssemblyFileVersion("3.3.3.6414")] -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Resource.cs
r6412 r6475 75 75 return sb.ToString(); 76 76 } 77 78 79 public override bool Equals(object obj) { 80 if (obj.GetType() == typeof(Resource)) 81 return AreEqual(this, obj as Resource); 82 else 83 return false; 84 } 85 86 private static bool AreEqual(Resource res1, Resource res2) { 87 if (res1.Tasks.Count != res2.Tasks.Count) 88 return false; 89 for (int i = 0; i < res1.Tasks.Count; i++) { 90 if (!res1.Tasks[i].Equals(res2.Tasks[i])) 91 return false; 92 } 93 94 return true; 95 } 77 96 } 78 97 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Schedule.cs
r6412 r6475 31 31 [Item("Schedule", "Represents the general solution for scheduling problems.")] 32 32 [StorableClass] 33 public class Schedule : NamedItem {33 public class Schedule : NamedItem, IScheduleEncoding { 34 34 #region Properties 35 35 [Storable] … … 79 79 lastScheduledTaskOfJob = new Dictionary<int, ScheduledTask>(); 80 80 } 81 81 82 82 83 … … 159 160 return quality; 160 161 } 162 163 public override bool Equals(object obj) { 164 if (obj.GetType() == typeof(Schedule)) 165 return AreEqual(this, obj as Schedule); 166 else 167 return false; 168 } 169 170 private static bool AreEqual(Schedule schedule1, Schedule schedule2) { 171 if (schedule1.Resources.Count != schedule2.Resources.Count) 172 return false; 173 for (int i = 0; i < schedule1.Resources.Count; i++) { 174 if (!schedule1.Resources[i].Equals(schedule2.Resources[i])) 175 return false; 176 } 177 178 return true; 179 } 180 161 181 } 162 182 } -
branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/ScheduledTask.cs
r6414 r6475 71 71 return sb.ToString(); 72 72 } 73 74 75 public override bool Equals(object obj) { 76 if (obj.GetType() == typeof(ScheduledTask)) 77 return AreEqual(this, obj as ScheduledTask); 78 else 79 return false; 80 } 81 82 public static bool AreEqual(ScheduledTask task1, ScheduledTask task2) { 83 return (task1.Duration == task2.Duration && 84 task1.JobNr == task2.JobNr && 85 task1.ResourceNr == task2.ResourceNr && 86 task1.StartTime == task2.StartTime && 87 task1.EndTime == task2.EndTime); 88 } 73 89 } 74 90 } -
branches/Scheduling/HeuristicLab.Problems.Scheduling.Views/3.3/JobShopSchedulingProblemView.cs
r6412 r6475 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Core.Views; 26 using HeuristicLab.Encodings.ScheduleEncoding; 26 27 using HeuristicLab.MainForm; 27 28 using HeuristicLab.PluginInfrastructure; -
branches/Scheduling/HeuristicLab.Problems.Scheduling.Views/3.3/Plugin.cs
r6414 r6475 23 23 24 24 namespace HeuristicLab.Problems.Scheduling.Views { 25 [Plugin("HeuristicLab.Problems.Scheduling.Views", "3.3.3.641 2")]25 [Plugin("HeuristicLab.Problems.Scheduling.Views", "3.3.3.6414")] 26 26 [PluginFile("HeuristicLab.Problems.Scheduling.Views-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabProblemsSchedulingViewsPlugin : PluginBase { -
branches/Scheduling/HeuristicLab.Problems.Scheduling.Views/3.3/Properties/AssemblyInfo.cs
r6414 r6475 53 53 // by using the '*' as shown below: 54 54 [assembly: AssemblyVersion("3.3.0.0")] 55 [assembly: AssemblyFileVersion("3.3.0.641 2")]55 [assembly: AssemblyFileVersion("3.3.0.6414")] -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluationAlgorithm.cs
r6406 r6475 54 54 } 55 55 56 public void InitializeOperatorGraph<T>() where T : Item, IScheduleEncoding { 57 OperatorGraph.Operators.Clear(); 58 OperatorGraph.InitialOperator = evaluator; 59 } 60 56 61 public void InitializeOperatorGraph<T>(ScheduleDecoder<T> decoder) where T : Item, IScheduleEncoding { 57 62 OperatorGraph.Operators.Clear(); -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/HeuristicLab.Problems.Scheduling-3.3.csproj
r6406 r6475 50 50 <Compile Include="Analyzers\BestSchedulingSolutionAnalyzer.cs" /> 51 51 <Compile Include="Analyzers\SchedulingAnalyzer.cs" /> 52 <Compile Include="Decoders\GTAlgorithmUtils.cs" />53 52 <Compile Include="Decoders\JSMDecoder.cs" /> 54 53 <Compile Include="Decoders\JSMDecodingErrorPolicyTypes.cs" /> … … 60 59 <Compile Include="Evaluators\SchedulingEvaluator.cs" /> 61 60 <Compile Include="Interfaces\IJSSPOperator.cs" /> 62 <Compile Include="Job.cs" />63 61 <Compile Include="JobShopSchedulingProblem.cs" /> 64 62 <Compile Include="Evaluators\SchedulingEvaluationAlgorithm.cs" /> 65 <Compile Include="Task.cs" />66 63 <Compile Include="SchedulingProblem.cs" /> 67 64 <Compile Include="Plugin.cs" /> -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Interfaces/IJSSPOperator.cs
r6406 r6475 1 1 using HeuristicLab.Core; 2 using HeuristicLab.Encodings.ScheduleEncoding; 2 3 3 4 namespace HeuristicLab.Problems.Scheduling { -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem.cs
r6412 r6475 173 173 PWRDecoder decoder = new PWRDecoder(); 174 174 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<PWREncoding>(decoder); 175 } else { 176 if (SolutionCreator.GetType().Equals(typeof(DirectScheduleRandomCreator))) { 177 Operators.AddRange(ApplicationManager.Manager.GetInstances<IDirectScheduleOperator>()); 178 ((SchedulingEvaluationAlgorithm)this.EvaluatorParameter.ActualValue).InitializeOperatorGraph<Schedule>(); 179 } 175 180 } 176 181 } -
branches/Scheduling/HeuristicLab.Problems.Scheduling/3.3/Plugin.cs
r6414 r6475 23 23 24 24 namespace HeuristicLab.Problems.Scheduling { 25 [Plugin("HeuristicLab.Problems.Scheduling", "3.3.3.641 2")]25 [Plugin("HeuristicLab.Problems.Scheduling", "3.3.3.6414")] 26 26 [PluginFile("HeuristicLab.Problems.Scheduling-3.3.dll", PluginFileType.Assembly)] 27 27 public class HeuristicLabProblemsSchedulingPlugin : PluginBase {
Note: See TracChangeset
for help on using the changeset viewer.