Changeset 15493 for branches/CFSAP
- Timestamp:
- 12/05/17 13:35:20 (7 years ago)
- Location:
- branches/CFSAP
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CFSAP/HeuristicLab.Problems.Instances.CFSAP/3.3/BozejkoCFSAPInstanceProvider.cs
r15472 r15493 62 62 }; 63 63 } 64 64 65 public override CFSAPData ImportData(string path) { 65 66 var instance = LoadInstance(new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)); -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/CFSAP.cs
r15472 r15493 108 108 var order = individual.Permutation("sequence"); 109 109 var assignment = individual.BinaryVector("assignment"); 110 int T = EvaluateAssignement(order, assignment.Select(x => x ? 1 : 0).ToArray(), 111 ProcessingTimesParameter.Value, SetupTimesParameter.Value); 112 return T; 110 return Evaluate(order, assignment); 111 } 112 113 public int Evaluate(Permutation order, BinaryVector assignment) { 114 return EvaluateAssignement(order, assignment, ProcessingTimes, SetupTimes); 113 115 } 114 116 … … 130 132 int operation = order[i]; 131 133 if (assignment[operation] == machine) { 134 if (first == -1) 135 first = operation; 136 else 137 T += setupTimes[machine][last, operation]; 138 last = operation; 139 } 140 } 141 if (last != -1 && first != -1) 142 T += setupTimes[machine][last, first]; 143 } 144 145 return T; 146 } 147 148 //Function to evaluate individual with the specified assignment 149 public static int EvaluateAssignement(Permutation order, BinaryVector assignment, IntMatrix processingTimes, ItemList<IntMatrix> setupTimes) { 150 if (processingTimes.Rows != 2) throw new ArgumentException("Method can only be used when there are two machines.", "assignment"); 151 var N = order.Length; 152 int T = 0; 153 154 for (int i = 0; i < N; i++) { 155 int operation = order[i]; 156 int machine = assignment[operation] ? 1 : 0; 157 T += processingTimes[machine, operation]; 158 } 159 160 for (int machine = 0; machine < 2; machine++) { 161 int first = -1; 162 int last = -1; 163 for (int i = 0; i < N; i++) { 164 int operation = order[i]; 165 if ((assignment[operation] ? 1 : 0) == machine) { 132 166 if (first == -1) 133 167 first = operation; -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/HeuristicLab.Problems.Scheduling.CFSAP-3.3.csproj
r15472 r15493 103 103 <Private>False</Private> 104 104 </Reference> 105 <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 106 <SpecificVersion>False</SpecificVersion> 107 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath> 108 <Private>False</Private> 109 </Reference> 105 110 <Reference Include="SimSharp-3.0.9, Version=3.0.9.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 106 111 <SpecificVersion>False</SpecificVersion> … … 121 126 <Compile Include="CFSAP.cs" /> 122 127 <Compile Include="CFSAPSequenceOnly.cs" /> 128 <Compile Include="GeneticAlgorithm.cs" /> 123 129 <Compile Include="ICFSAP.cs" /> 124 130 <Compile Include="MultiNestCFSAP.cs" /> 125 131 <Compile Include="MultiNestCFSAPSolvingStrategy.cs" /> 132 <Compile Include="OptimalAssignment.cs" /> 126 133 <Compile Include="Plugin.cs" /> 127 134 <None Include="Properties\AssemblyInfo.cs.frame" /> -
branches/CFSAP/HeuristicLab.Problems.Scheduling.CFSAP/3.3/Plugin.cs.frame
r15472 r15493 38 38 [PluginDependency("HeuristicLab.Persistence", "3.3")] 39 39 [PluginDependency("HeuristicLab.Problems.Instances", "3.3")] 40 [PluginDependency("HeuristicLab.Random", "3.3")] 40 41 public class HeuristicLabProblemsSchedulingCFSAPPlugin : PluginBase { 41 42 }
Note: See TracChangeset
for help on using the changeset viewer.