Changeset 13449
- Timestamp:
- 12/11/15 12:53:43 (9 years ago)
- Location:
- branches/ProblemRefactoring
- Files:
-
- 4 deleted
- 4 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/HeuristicLab.Encodings.ScheduleEncoding-3.3.csproj
r13443 r13449 118 118 <Compile Include="JobSequenceMatrix\Decoder\JSMDecoder.cs" /> 119 119 <Compile Include="JobSequenceMatrix\Decoder\JSMDecodingErrorPolicy.cs" /> 120 <Compile Include="JobSequenceMatrix\Decoder\JSMDecodingErrorPolicyTypes.cs" />121 120 <Compile Include="JobSequenceMatrix\Decoder\JSMForcingStrategy.cs" /> 122 <Compile Include="JobSequenceMatrix\Decoder\JSMForcingStrategyTypes.cs" />123 121 <Compile Include="PriorityRulesVector\Decoder\PRVDecoder.cs" /> 124 122 <Compile Include="PermutationWithRepetition\Decoder\PWRDecoder.cs" /> -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMDecoder.cs
r13443 r13449 25 25 using HeuristicLab.Common; 26 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 27 28 using HeuristicLab.Encodings.PermutationEncoding; 28 29 using HeuristicLab.Parameters; … … 35 36 public class JSMDecoder : ScheduleDecoder { 36 37 37 public I ValueParameter<JSMDecodingErrorPolicy> DecodingErrorPolicyParameter {38 get { return (I ValueParameter<JSMDecodingErrorPolicy>)Parameters["DecodingErrorPolicy"]; }38 public IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>> DecodingErrorPolicyParameter { 39 get { return (IFixedValueParameter<EnumValue<JSMDecodingErrorPolicy>>)Parameters["DecodingErrorPolicy"]; } 39 40 } 40 public I ValueParameter<JSMForcingStrategy> ForcingStrategyParameter {41 get { return (I ValueParameter<JSMForcingStrategy>)Parameters["ForcingStrategy"]; }41 public IFixedValueParameter<EnumValue<JSMForcingStrategy>> ForcingStrategyParameter { 42 get { return (IFixedValueParameter<EnumValue<JSMForcingStrategy>>)Parameters["ForcingStrategy"]; } 42 43 } 43 44 44 private JSMDecodingErrorPolicy TypesDecodingErrorPolicy {45 private JSMDecodingErrorPolicy DecodingErrorPolicy { 45 46 get { return DecodingErrorPolicyParameter.Value.Value; } 46 47 } 47 48 48 private JSMForcingStrategy TypesForcingStrategy {49 private JSMForcingStrategy ForcingStrategy { 49 50 get { return ForcingStrategyParameter.Value.Value; } 50 51 } … … 59 60 public JSMDecoder() 60 61 : base() { 61 Parameters.Add(new ValueParameter<JSMDecodingErrorPolicy>("DecodingErrorPolicy", "Specify the policy that should be used to handle decoding errors.", new JSMDecodingErrorPolicy(JSMDecodingErrorPolicyTypes.RandomPolicy)));62 Parameters.Add(new ValueParameter<JSMForcingStrategy>("ForcingStrategy", "Specifies a forcing strategy.", new JSMForcingStrategy(JSMForcingStrategyTypes.SwapForcing)));62 Parameters.Add(new FixedValueParameter<EnumValue<JSMDecodingErrorPolicy>>("DecodingErrorPolicy", "Specify the policy that should be used to handle decoding errors.", new EnumValue<JSMDecodingErrorPolicy>(JSMDecodingErrorPolicy.RandomPolicy))); 63 Parameters.Add(new FixedValueParameter<EnumValue<JSMForcingStrategy>>("ForcingStrategy", "Specifies a forcing strategy.", new EnumValue<JSMForcingStrategy>(JSMForcingStrategy.SwapForcing))); 63 64 } 64 65 65 private static Task SelectTaskFromConflictSet(JSMEncoding solution, JSMDecodingErrorPolicy Types decodingErrorPolicy, JSMForcingStrategyTypesforcingStrategy, int conflictedResourceNr, int progressOnConflictedResource, ItemList<Task> conflictSet, IRandom random) {66 private static Task SelectTaskFromConflictSet(JSMEncoding solution, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy, int conflictedResourceNr, int progressOnConflictedResource, ItemList<Task> conflictSet, IRandom random) { 66 67 if (conflictSet.Count == 1) 67 68 return conflictSet[0]; … … 89 90 } 90 91 91 private static Task ApplyDecodingErrorPolicy(JSMDecodingErrorPolicy TypesdecodingErrorPolicy, ItemList<Task> conflictSet, Permutation resource, int progress, IRandom random) {92 if (decodingErrorPolicy == JSMDecodingErrorPolicy Types.RandomPolicy) {92 private static Task ApplyDecodingErrorPolicy(JSMDecodingErrorPolicy decodingErrorPolicy, ItemList<Task> conflictSet, Permutation resource, int progress, IRandom random) { 93 if (decodingErrorPolicy == JSMDecodingErrorPolicy.RandomPolicy) { 93 94 //Random 94 95 return conflictSet[random.Next(conflictSet.Count - 1)]; … … 107 108 } 108 109 109 private static void ApplyForcingStrategy(JSMForcingStrategy TypesforcingStrategy, JSMEncoding solution, int conflictedResource, int newResolutionIndex, int progressOnResource, int newResolution) {110 private static void ApplyForcingStrategy(JSMForcingStrategy forcingStrategy, JSMEncoding solution, int conflictedResource, int newResolutionIndex, int progressOnResource, int newResolution) { 110 111 var jsm = solution.JobSequenceMatrix; 111 if (forcingStrategy == JSMForcingStrategy Types.SwapForcing) {112 if (forcingStrategy == JSMForcingStrategy.SwapForcing) { 112 113 //SwapForcing 113 114 jsm[conflictedResource][newResolutionIndex] = jsm[conflictedResource][progressOnResource]; 114 115 jsm[conflictedResource][progressOnResource] = newResolution; 115 } else if (forcingStrategy == JSMForcingStrategy Types.ShiftForcing) {116 } else if (forcingStrategy == JSMForcingStrategy.ShiftForcing) { 116 117 //ShiftForcing 117 118 List<int> asList = jsm[conflictedResource].ToList<int>(); … … 135 136 } 136 137 137 public static Schedule DecodeSchedule(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy Types decodingErrorPolicy, JSMForcingStrategyTypesforcingStrategy) {138 public static Schedule DecodeSchedule(JSMEncoding solution, ItemList<Job> jobData, JSMDecodingErrorPolicy decodingErrorPolicy, JSMForcingStrategy forcingStrategy) { 138 139 var random = new FastRandom(solution.RandomSeed); 139 140 var jobs = (ItemList<Job>)jobData.Clone(); -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMDecodingErrorPolicy.cs
r13448 r13449 21 21 22 22 namespace HeuristicLab.Encodings.ScheduleEncoding { 23 public enum JSMDecodingErrorPolicy Types{23 public enum JSMDecodingErrorPolicy { 24 24 RandomPolicy, 25 25 GuidedPolicy -
branches/ProblemRefactoring/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Decoder/JSMForcingStrategy.cs
r13448 r13449 21 21 22 22 namespace HeuristicLab.Encodings.ScheduleEncoding { 23 public enum JSMForcingStrategy Types{23 public enum JSMForcingStrategy { 24 24 ShiftForcing, 25 25 SwapForcing -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling.Views/3.3/HeuristicLab.Problems.Scheduling.Views-3.3.csproj
r11623 r13449 116 116 </ItemGroup> 117 117 <ItemGroup> 118 <Compile Include="JSMForcingStrategyView.cs"> 119 <SubType>UserControl</SubType> 120 </Compile> 121 <Compile Include="JSMForcingStrategyView.Designer.cs"> 122 <DependentUpon>JSMForcingStrategyView.cs</DependentUpon> 123 </Compile> 124 <Compile Include="JobShopSchedulingProblemView.cs"> 125 <SubType>UserControl</SubType> 126 </Compile> 118 <Compile Include="JobShopSchedulingProblemView.cs" /> 127 119 <Compile Include="JobShopSchedulingProblemView.Designer.cs"> 128 120 <DependentUpon>JobShopSchedulingProblemView.cs</DependentUpon> 129 </Compile>130 <Compile Include="JSMDecodingErrorPolicyView.cs">131 <SubType>UserControl</SubType>132 </Compile>133 <Compile Include="JSMDecodingErrorPolicyView.Designer.cs">134 <DependentUpon>JSMDecodingErrorPolicyView.cs</DependentUpon>135 121 </Compile> 136 122 <Compile Include="Plugin.cs" /> -
branches/ProblemRefactoring/HeuristicLab.Problems.Scheduling/3.3/JobShopSchedulingProblem new.cs
r13443 r13449 289 289 } 290 290 } 291 BestKnownSolution = JSMDecoder.DecodeSchedule(enc, jobData, JSMDecodingErrorPolicy Types.RandomPolicy, JSMForcingStrategyTypes.SwapForcing);291 BestKnownSolution = JSMDecoder.DecodeSchedule(enc, jobData, JSMDecodingErrorPolicy.RandomPolicy, JSMForcingStrategy.SwapForcing); 292 292 //if (ScheduleEvaluator is MeanTardinessEvaluator) 293 293 // BestKnownQuality = MeanTardinessEvaluator.GetMeanTardiness(BestKnownSolution, jobData);
Note: See TracChangeset
for help on using the changeset viewer.