Commit b17004da authored by Tong Li's avatar Tong Li

半成品

parent 6086d002
......@@ -1956,6 +1956,8 @@ public class GeneticDecoder {
.sorted(Comparator.comparing(Entry::getSequence))
.collect(Collectors.toList());
List<GlobalOperationInfo> entrys=
chromosome.getGlobalOpList().stream().filter(t->t.getOp().getGroupId()==groupId).collect(Collectors.toList());
for (Entry currentOp : orderOps) {
......@@ -1966,15 +1968,20 @@ public class GeneticDecoder {
GlobalOperationInfo global= entrys.stream().
filter(t->t.getOp().getId()==currentOp.getId())
.findFirst().orElse(null);
int globalOpId= global.getGlobalOpId();
int machineSeq= chromosome.getMachineSelection().get(globalOpId);
MachineOption machineOption=
currentOp.getMachineOptions().get(machineSeq-1);
Long machineId = machineOption.getMachineId();
Long machineId = currentOp.getSelectMachineID();
MachineOption machineOption= currentOp.getMachineOptions().stream()
.filter(t->t.getMachineId().equals(machineId)).findFirst().orElse(null);
// MachineOption machineOption= currentOp.getMachineOptions().stream()
// .filter(t->t.getMachineId().equals(machineId)).findFirst().orElse(null);
double processTime = machineOption.getProcessingTime();
OpMachine opMachine=new OpMachine();
opMachine.setGroupId(groupId);
......
package com.aps.service.Algorithm;
import com.aps.common.util.FileHelper;
import com.aps.common.util.ProductionDeepCopyUtil;
import com.aps.entity.Algorithm.*;
import com.aps.entity.basic.Entry;
......@@ -600,6 +601,12 @@ public class GeneticOperations {
return;
List<Order> orders = chromosome.getOrders();
List<Integer> OperationSequencing= chromosome.getOperationSequencing();
log("删除前"+OperationSequencing.size(),true);
log(String.format("半成品订单-删除前,工序: %d,工序序列: %d,设备: %d,设备序列: %d",
allOperations.size(), OperationSequencing.size(),globalOpList.size(),chromosome.getMachineSelection().size()),true);
List<Integer> newoorderids= orders.stream()
.filter(t->t.isNewSfCreate())
.map(Order::getId)
......@@ -637,6 +644,11 @@ public class GeneticOperations {
orders.removeIf(t ->newoorderids.contains(t.getId()));
}
}
private void log(String message, boolean enableLogging) {
if (enableLogging ) {
FileHelper.writeLogFile(message);
}
}
}
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