Commit cf8215e1 authored by Tong Li's avatar Tong Li

优先级

parent 3d3915bf
This diff is collapsed.
This diff is collapsed.
...@@ -562,7 +562,7 @@ public class Initialization { ...@@ -562,7 +562,7 @@ public class Initialization {
} }
boolean considerSequence = rnd.nextBoolean(); boolean considerSequence = rnd.nextBoolean();
if (considerSequence) { if (considerSequence) {
sortedOps.sort(Comparator.comparing((Entry op) -> -op.getPriority()) sortedOps.sort(Comparator.comparing((Entry op) -> op.getPriority())
.thenComparing(Entry::getSequence) .thenComparing(Entry::getSequence)
.thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型 .thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型
.thenComparing(op -> { .thenComparing(op -> {
...@@ -571,7 +571,7 @@ public class Initialization { ...@@ -571,7 +571,7 @@ public class Initialization {
}) })
.thenComparing(randomIds::get)); .thenComparing(randomIds::get));
}else { }else {
sortedOps.sort(Comparator.comparing((Entry op) -> -op.getPriority()) sortedOps.sort(Comparator.comparing((Entry op) -> op.getPriority())
.thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型 .thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型
.thenComparing(op -> { .thenComparing(op -> {
Order order = orderMap.get(op.getGroupId()); Order order = orderMap.get(op.getGroupId());
...@@ -664,7 +664,7 @@ public class Initialization { ...@@ -664,7 +664,7 @@ public class Initialization {
randomIds.put(allOperations.get(i), indices.get(i)); randomIds.put(allOperations.get(i), indices.get(i));
} }
sortedOps.sort(Comparator.comparing((Entry op) -> -op.getPriority()) sortedOps.sort(Comparator.comparing((Entry op) -> op.getPriority())
.thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") .thenComparing(op -> op.getProductId() != null ? op.getProductId() : "")
.thenComparing(op -> op.getMachineOptions().get(0).getProcessingTime() * op.getQuantity()) .thenComparing(op -> op.getMachineOptions().get(0).getProcessingTime() * op.getQuantity())
.thenComparing(randomIds::get)); .thenComparing(randomIds::get));
...@@ -890,7 +890,7 @@ public class Initialization { ...@@ -890,7 +890,7 @@ public class Initialization {
} }
} }
sortedOps.sort(Comparator.comparing((Entry op) -> -op.getPriority()) sortedOps.sort(Comparator.comparing((Entry op) -> op.getPriority())
.thenComparing((Entry op) -> { .thenComparing((Entry op) -> {
if (op.getMachineOptions() == null || op.getMachineOptions().isEmpty()) { if (op.getMachineOptions() == null || op.getMachineOptions().isEmpty()) {
return 0.0; return 0.0;
...@@ -964,7 +964,7 @@ public class Initialization { ...@@ -964,7 +964,7 @@ public class Initialization {
for (int i = 0; i < allOperations.size(); i++) { for (int i = 0; i < allOperations.size(); i++) {
randomIds.put(allOperations.get(i), indices.get(i)); randomIds.put(allOperations.get(i), indices.get(i));
} }
sortedOps.sort(Comparator.comparing((Entry op) -> -op.getPriority()) sortedOps.sort(Comparator.comparing((Entry op) -> op.getPriority())
.thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型 .thenComparing(op -> op.getProductId() != null ? op.getProductId() : "") // 相同物料排在一起,减少换型
.thenComparing(randomIds::get)); .thenComparing(randomIds::get));
......
...@@ -95,6 +95,7 @@ public class MachineCalculator { ...@@ -95,6 +95,7 @@ public class MachineCalculator {
int remainingTime = processingTime; int remainingTime = processingTime;
final LocalDateTime processSearchEnd = cursor; final LocalDateTime processSearchEnd = cursor;
List<TimeSegment> processSegments = machine.getAvailability().stream() List<TimeSegment> processSegments = machine.getAvailability().stream()
.filter(slot -> !slot.isUsed()) .filter(slot -> !slot.isUsed())
.filter(slot -> slot.getType() != SegmentType.MAINTENANCE) .filter(slot -> slot.getType() != SegmentType.MAINTENANCE)
......
...@@ -58,7 +58,7 @@ spring: ...@@ -58,7 +58,7 @@ spring:
# url: jdbc:oracle:thin:@//39.100.77.7:1522/ORCLPDB1 # ORCL为你的Oracle实例名 # url: jdbc:oracle:thin:@//39.100.77.7:1522/ORCLPDB1 # ORCL为你的Oracle实例名
# username: mes # 替换为你的Oracle用户名 # username: mes # 替换为你的Oracle用户名
# password: root_mes123456 # 替换为你的Oracle密码 # password: root_mes123456 # 替换为你的Oracle密码
url: jdbc:oracle:thin:@//39.100.78.207:7002/ORCLPDB1 # ORCL为你的Oracle实例名 url: jdbc:oracle:thin:@//39.100.78.207:7002/ORCLPDB1 # ORCL为你的Oracle实例名 7005
username: mes # 替换为你的Oracle用户名 username: mes # 替换为你的Oracle用户名
password: root_mes123456 # 替换为你的Oracle密码 password: root_mes123456 # 替换为你的Oracle密码
# sqlserver: # sqlserver:
......
...@@ -41,7 +41,8 @@ public class PlanResultServiceTest { ...@@ -41,7 +41,8 @@ public class PlanResultServiceTest {
// sortService.test1(); // sortService.test1();
// nsgaiiUtils.Test(); // nsgaiiUtils.Test();
planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000 // planResultService.execute2("64E64F6B68094AF38CEDC418630C3CC2");//2000
planResultService.execute2("5C93A528725F40228889FCFC1E040B55");//2000
// 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