Commit bd586664 authored by Tong Li's avatar Tong Li

物料需求

parent 587dadb1
...@@ -589,6 +589,19 @@ public class GeneticDecoder { ...@@ -589,6 +589,19 @@ public class GeneticDecoder {
public void parallelDecodeByMachine(Chromosome chromosome) { public void parallelDecodeByMachine(Chromosome chromosome) {
if (rebuildStructureForCurrentDecode) {
//创建半成品订单
materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
}
if(rebuildStructureForCurrentDecode && _globalParam.isIsCheckSf()) {
int isnew= generateGlobalOpList(chromosome);
if(isnew==1) {
CreateNewOpSequence(chromosome);
}
}
// 1. 获取工序处理顺序 // 1. 获取工序处理顺序
List<Integer> operationSequencing = chromosome.getOperationSequencing(); List<Integer> operationSequencing = chromosome.getOperationSequencing();
......
...@@ -242,7 +242,15 @@ public class RoutingDataService { ...@@ -242,7 +242,15 @@ public class RoutingDataService {
List<MachineOption> mos = new ArrayList<>(); List<MachineOption> mos = new ArrayList<>();
for (ProdEquipment e : Equipments) { for (ProdEquipment e : Equipments) {
Double totalprocessTime=e.getSpeed()/e.getSingleOut().doubleValue()*entry.getQuantity(); Double totalprocessTime=0d;
if(op.getConstTime()==1)//常数时间
{
totalprocessTime=e.getSpeed();
}else {
totalprocessTime=e.getSpeed()/e.getSingleOut().doubleValue()*entry.getQuantity();
}
if(machineIds.containsKey(e.getEquipId())) if(machineIds.containsKey(e.getEquipId()))
{ {
if( machineIds.get(e.getEquipId())<totalprocessTime) if( machineIds.get(e.getEquipId())<totalprocessTime)
......
...@@ -646,9 +646,15 @@ public class VariableNeighborhoodSearch { ...@@ -646,9 +646,15 @@ public class VariableNeighborhoodSearch {
Entry entry1 = entrybyids.get(op1.getOperationId()); Entry entry1 = entrybyids.get(op1.getOperationId());
Entry entry2 = entrybyids.get(op2.getOperationId()); Entry entry2 = entrybyids.get(op2.getOperationId());
if (entry1 == null || entry2 == null) { if (entry1 == null && entry2 == null) {
return 0; return 0;
} }
if (entry1 == null) {
return 1;
}
if (entry2 == null) {
return -1;
}
int size1 = priorityToGroupIds.getOrDefault(entry1.getPriority(), new HashSet<>()).size(); int size1 = priorityToGroupIds.getOrDefault(entry1.getPriority(), new HashSet<>()).size();
int size2 = priorityToGroupIds.getOrDefault(entry2.getPriority(), new HashSet<>()).size(); int size2 = priorityToGroupIds.getOrDefault(entry2.getPriority(), new HashSet<>()).size();
...@@ -1840,7 +1846,7 @@ public class VariableNeighborhoodSearch { ...@@ -1840,7 +1846,7 @@ public class VariableNeighborhoodSearch {
for (int i = 1; i <= op.getMachineOptions().size(); i++) { for (int i = 1; i <= op.getMachineOptions().size(); i++) {
if (i != currentMachineSeq) { if (i != currentMachineSeq) {
availableMachines.add(i); availableMachines.add(i);
machineOptions.add(op.getMachineOptions().get(i)); machineOptions.add(op.getMachineOptions().get(i-1));
} }
} }
......
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