Commit 9dbee6c0 authored by Tong Li's avatar Tong Li

bom

parent dbe81dd1
......@@ -280,7 +280,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
public void decode(Chromosome chromosome) {
// List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
if(_globalParam.isIsCheckSf()) {
int isnew= generateGlobalOpList(chromosome);
......@@ -444,7 +444,11 @@ if(finishedOrder==null||finishedOrder.size()==0)
double t= machineOption.getRuntime().doubleValue()/machineOption.getSingleOut().doubleValue()*(operation.getQuantity());
processingTimeTotal =(int)Math.ceil (t);
}
int days=(int) ((processingTimeTotal)/24/3600);
if(days>600)
{
throw new RuntimeException("工序总加工时长"+days+"天超出限制");
}
if(machine==null||operation.getMachineOptions()==null)
{
return 0;
......@@ -534,10 +538,7 @@ if(finishedOrder==null||finishedOrder.size()==0)
earliestStartTime=bomtime;
}
}
if(machine.getId()==2063)
{
int i=0;
}
......
......@@ -520,10 +520,7 @@ public class MachineCalculator {
CopyOnWriteArrayList<TimeSegment> timeSegments2= new CopyOnWriteArrayList<>(timeSegments.subList(1,timeSegments.size()-1));
if(timeSegments2==null||timeSegments2.size()==0)
{
int i=0;
}
LocalDateTime effectiveStart=timeSegments2.get(0).getStart();
......@@ -543,16 +540,19 @@ public class MachineCalculator {
times.add(time);
TimeSegment shiftlast= timeSegments.get(timeSegments.size()-1);
Map<Integer, Object> outMaplast= CreateScheduleResultDetail(shiftlast,st,remainingTime,oneTime);
remainingTime=(int)outMaplast.get(1);
ScheduleResultDetail timelast=(ScheduleResultDetail)outMaplast.get(2);
times.add(timelast);
CopyOnWriteArrayList<TimeSegment> usedSegments2 = RemoveMachineAvailable(machine, timelast,shiftlast);
if (usedSegments2 != null && usedSegments2.size() > 0) {
usedSegments.addAll(usedSegments2);
}
if (usedSegments != null && usedSegments.size() > 0) {
machine.getAvailability().addAll(usedSegments);
machine.getAvailability().sort(Comparator.comparing(TimeSegment::getStart));
......@@ -581,8 +581,11 @@ public class MachineCalculator {
// 添加时间详情
ScheduleResultDetail time = new ScheduleResultDetail();
time.setKey(shift.getKey());
time.setStartTime((int) ChronoUnit.SECONDS.between(baseTime, effectiveStart));
time.setEndTime((int) ChronoUnit.SECONDS.between(baseTime, currentTime));
// time.setStartTime( (int)Duration.between(baseTime, effectiveStart).getSeconds());
// time.setEndTime( (int)Duration.between(baseTime, currentTime).getSeconds());
time.setStartTime(Math.abs ((int) ChronoUnit.SECONDS.between(baseTime, effectiveStart)));
time.setEndTime(Math.abs ((int) ChronoUnit.SECONDS.between(baseTime, currentTime)));
time.setQuantity((int)(processable/oneTime));
time.setOneTime(oneTime);
Map<Integer, Object> outMap=new HashMap<>();
......
......@@ -39,7 +39,7 @@ public class PlanResultServiceTest {
// TestSortService sortService=new TestSortService();
// sortService.test1();
// nsgaiiUtils.Test();
// planResultService.execute2("1BC8FFD1A7D54AE7AA75D2CBC7C08080");
planResultService.execute2("1BC8FFD1A7D54AE7AA75D2CBC7C08080");
// planResultService.execute2("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
......@@ -51,11 +51,11 @@ public class PlanResultServiceTest {
// planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93");
// planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l);
MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
maintenanceWindow.setStartTime(LocalDateTime.of(2026, 2, 4, 0, 0, 0));
maintenanceWindow.setEndTime(LocalDateTime.of(2025, 2, 5, 0, 0, 0));
planResultService.AddMaintenanceWindow("00E0C5D3E4AD4F36B56C39395906618D",2492l,maintenanceWindow);
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
// MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
// maintenanceWindow.setStartTime(LocalDateTime.of(2026, 2, 4, 0, 0, 0));
// maintenanceWindow.setEndTime(LocalDateTime.of(2025, 2, 5, 0, 0, 0));
// planResultService.AddMaintenanceWindow("00E0C5D3E4AD4F36B56C39395906618D",2492l,maintenanceWindow);
// // planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
// planResultService.SpiltOrder("A41D662EE0764D008173C5A0E42B15F6","5f9d5383-b89a-4a4f-8805-2f617c711968",new Double[]{500d, 500d});
}
......
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