Commit cb20ded9 authored by Tong Li's avatar Tong Li

优化

parent a94f7c82
......@@ -788,7 +788,7 @@ public class GeneticDecoder {
Entry currentOp = orderOps.get(scheduledCount);
FileHelper.writeLogFile("工序:"+currentOp.getId());
int opSequence = currentOp.getSequence();
......@@ -863,7 +863,8 @@ public class GeneticDecoder {
orderProcessCounter.put(groupId, orderProcessCounter.get(groupId) + 1);
orderLastEndTime.put(groupId, actualEndTime);
if (isJit&& orderProcessCounter.get(groupId) >= entrysBygroupId.get(groupId).size()) {
if(false){
// if (isJit&& orderProcessCounter.get(groupId) >= entrysBygroupId.get(groupId).size()) {
List<Entry> orderOpsBySeq = entrysBygroupId.get(groupId).stream()
.sorted(Comparator.comparingInt(Entry::getSequence))
......@@ -1503,10 +1504,10 @@ public class GeneticDecoder {
Entry op= entryIndexById.get(result.getOperationId());
Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
if (deductions != null && !deductions.isEmpty()) {
rollbackOperationStockDeduction(chromosome, deductions);
}
// Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
// if (deductions != null && !deductions.isEmpty()) {
// rollbackOperationStockDeduction(chromosome, deductions);
// }
}
machineTasksCache.clear();
......@@ -1540,10 +1541,10 @@ public class GeneticDecoder {
Entry op= entryIndexById.get(result.getOperationId());
Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
if (deductions != null && !deductions.isEmpty()) {
rollbackOperationStockDeduction(chromosome, deductions);
}
// Map<String, MaterialDeduction> deductions = readOperationStockDeductions(op);
// if (deductions != null && !deductions.isEmpty()) {
// rollbackOperationStockDeduction(chromosome, deductions);
// }
Machine machine = getMachineById(chromosome, result.getMachineId());
if (machine != null) {
AddMachineAvailable(machine, result.getGeneDetails());
......
......@@ -115,6 +115,7 @@ public class HybridAlgorithm {
List<GlobalOperationInfo> globalOpList =new ArrayList<>();// initialization.generateGlobalOpList();
// 初始化变邻域搜索
_vns = new VariableNeighborhoodSearch( allOperations,orders,materials,_entryRel, _fitnessCalculator );
_vns.initMachineSelectFrequency();
_hillClimbing = new HillClimbing(allOperations,orders,materials,_entryRel, _fitnessCalculator);
_simulatedAnnealing = new SimulatedAnnealing( allOperations,orders,materials,_entryRel, _fitnessCalculator);
_tabuSearch = new TabuSearch(allOperations,orders,materials,_entryRel, _fitnessCalculator);
......@@ -464,7 +465,7 @@ public class HybridAlgorithm {
FileHelper.writeLogFile("解码---------------"+population.size() );
// GeneticDecoder decoder = new GeneticDecoder(_GlobalParam, param.getBaseTime(), machines, orders, materials, machineScheduler,materialRequirementService, sceneId);
boolean ismore=true;
boolean ismore=false;
if(ismore) {
CompletableFuture.allOf(population.stream()
.map(chromosome -> CompletableFuture.runAsync(() -> decode(sharedDecoder, chromosome, param, allOperations, globalOpList), decodeExecutor))
......
......@@ -177,8 +177,8 @@ public class PlanResultService {
* 后续会按场景创建人自动回退到可用的策略配置。
*/
public Chromosome execute2(String SceneId) {
return execute2(SceneId, 2361l, 241l, null);
// return execute2(SceneId, 2321l, 207l, null);
// return execute2(SceneId, 2361l, 241l, null);
return execute2(SceneId, 2321l, 207l, null);
}
......
......@@ -42,7 +42,7 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test();
// planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000
// planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces
// planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces
planResultService.execute2("197083D0D26A449EB179AC103C753FD3");
// planResultService.execute2("9FEDFD92BB6A4675BF9B1CC64505D1AB");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment