Commit be8c854e authored by Tong Li's avatar Tong Li

配套bug

parent 490858d6
...@@ -504,7 +504,7 @@ public class GeneticDecoder { ...@@ -504,7 +504,7 @@ public class GeneticDecoder {
public void serialDecode(Chromosome chromosome) { public void serialDecode(Chromosome chromosome) {
long decodeStart = System.nanoTime(); long decodeStart = System.nanoTime();
chromosome.setScenarioID(sceneId); chromosome.setScenarioID(sceneId);
boolean isJit=_globalParam.isJit(); boolean isJit=true;//_globalParam.isJit();
...@@ -645,12 +645,20 @@ public class GeneticDecoder { ...@@ -645,12 +645,20 @@ public class GeneticDecoder {
for (Map.Entry<Integer, List<Entry>> entry : entrysBygroupId.entrySet()) { for (Map.Entry<Integer, List<Entry>> entry : entrysBygroupId.entrySet()) {
int groupId = entry.getKey(); int groupId = entry.getKey();
Entry firstOp = entry.getValue().get(0); Entry firstOp = entry.getValue().get(0);
if(isJit) {
if (Entry.SchedulingMode.BACKWARD.name().equals(
firstOp.getSchedulingMode()) && semiFinishedOrderIds.contains(groupId)) {
orderSchedulingInfo.put(groupId,
new AbstractMap.SimpleEntry<>(true, 0));
}
}else {
if (Entry.SchedulingMode.BACKWARD.name().equals( if (Entry.SchedulingMode.BACKWARD.name().equals(
firstOp.getSchedulingMode())&&semiFinishedOrderIds.contains(groupId)) { firstOp.getSchedulingMode())) {
orderSchedulingInfo.put(groupId, orderSchedulingInfo.put(groupId,
new AbstractMap.SimpleEntry<>(true, 0)); new AbstractMap.SimpleEntry<>(true, 0));
} }
} }
}
...@@ -687,7 +695,7 @@ public class GeneticDecoder { ...@@ -687,7 +695,7 @@ public class GeneticDecoder {
int scheduledCount = orderProcessCounter.get(groupId); int scheduledCount = orderProcessCounter.get(groupId);
if(groupId==51) if(groupId==7)
{ {
int k=0; int k=0;
} }
...@@ -1479,6 +1487,9 @@ public class GeneticDecoder { ...@@ -1479,6 +1487,9 @@ public class GeneticDecoder {
.collect(Collectors.toList()); .collect(Collectors.toList());
for (GAScheduleResult result : resultsToRemove) { for (GAScheduleResult result : resultsToRemove) {
Machine machine = getMachineById(chromosome, result.getMachineId()); Machine machine = getMachineById(chromosome, result.getMachineId());
if (machine != null) { if (machine != null) {
AddMachineAvailable(machine, result.getGeneDetails()); AddMachineAvailable(machine, result.getGeneDetails());
...@@ -1495,7 +1506,6 @@ public class GeneticDecoder { ...@@ -1495,7 +1506,6 @@ public class GeneticDecoder {
machineTasksCache.clear(); machineTasksCache.clear();
return new ArrayList<>(repairOperationIds); return new ArrayList<>(repairOperationIds);
} }
private int processOperation(Entry currentOp, Long machineId, double processTime, private int processOperation(Entry currentOp, Long machineId, double processTime,
OpMachine machineOption, Chromosome chromosome, OpMachine machineOption, Chromosome chromosome,
Map<Long, Machine> machineIdMap, Map<Long, Machine> machineIdMap,
...@@ -1701,7 +1711,7 @@ public class GeneticDecoder { ...@@ -1701,7 +1711,7 @@ public class GeneticDecoder {
Map<Integer, Object> result = machineCalculator.CreateScheduleResult(machine, operation, Map<Integer, Object> result = machineCalculator.CreateScheduleResult(machine, operation,
processingTimeTotal, earliestStartTime, AvailableTimeSegment, processingTime, processingTimeTotal, earliestStartTime, AvailableTimeSegment, processingTime,
operation.getQuantity(), operation.getIsInterrupt() != 1, setupTime, operation.getQuantity(), operation.getIsInterrupt() != 1, setupTime,
_globalParam.is_smoothChangeOverInWeek(), setupStartTime, true, isJit); _globalParam.is_smoothChangeOverInWeek(), setupStartTime, islockMachineTime, isJit);
setupTime = (int) result.get(1); setupTime = (int) result.get(1);
operation.setChangeLineTime(setupTime); operation.setChangeLineTime(setupTime);
geneDetails = (CopyOnWriteArrayList<ScheduleResultDetail>) result.get(2); geneDetails = (CopyOnWriteArrayList<ScheduleResultDetail>) result.get(2);
......
...@@ -234,7 +234,7 @@ if(isJit) ...@@ -234,7 +234,7 @@ if(isJit)
// CopyOnWriteArrayList<ScheduleResultDetail> geneDetails = estimateCalendarAwareDuration(machine,op,machineTasks, start, rawDur,mo.getProcessingTime(),isJit); // CopyOnWriteArrayList<ScheduleResultDetail> geneDetails = estimateCalendarAwareDuration(machine,op,machineTasks, start, rawDur,mo.getProcessingTime(),isJit);
if(result!=null) { if(result!=null) {
start = result.getStartTime(); start = result.getStartTime()-result.getChangeOverTime();
end = result.getEndTime(); end = result.getEndTime();
}else { }else {
return -1; return -1;
......
...@@ -177,8 +177,8 @@ public class PlanResultService { ...@@ -177,8 +177,8 @@ public class PlanResultService {
* 后续会按场景创建人自动回退到可用的策略配置。 * 后续会按场景创建人自动回退到可用的策略配置。
*/ */
public Chromosome execute2(String SceneId) { public Chromosome execute2(String SceneId) {
// return execute2(SceneId, 2361l, 241l, null); return execute2(SceneId, 2361l, 241l, null);
return execute2(SceneId, 2321l, 207l, null); // return execute2(SceneId, 2321l, 207l, null);
} }
......
...@@ -42,8 +42,8 @@ public class PlanResultServiceTest { ...@@ -42,8 +42,8 @@ public class PlanResultServiceTest {
// nsgaiiUtils.Test(); // nsgaiiUtils.Test();
// planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000 // planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000
// planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces planResultService.execute2("E1448B3C9C8743DEAB39708F2CFE348A");//倒排bomces
planResultService.execute2("197083D0D26A449EB179AC103C753FD3"); // planResultService.execute2("197083D0D26A449EB179AC103C753FD3");
// planResultService.execute2("9FEDFD92BB6A4675BF9B1CC64505D1AB"); // planResultService.execute2("9FEDFD92BB6A4675BF9B1CC64505D1AB");
// planResultService.execute2("15210B13B88A453F8B84AAC7F16C7541");//2000 // planResultService.execute2("15210B13B88A453F8B84AAC7F16C7541");//2000
......
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