- Timestamp:
- 06/24/11 14:23:19 (13 years ago)
- Location:
- branches/Scheduling/HeuristicLab.Encodings.ScheduleEncoding/3.3
- Files:
-
- 12 added
- 1 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.