Commit dbe81dd1 authored by Tong Li's avatar Tong Li

bom

parent c5fa84a8
...@@ -6,6 +6,7 @@ import com.aps.entity.Algorithm.IDAndChildID.GroupResult; ...@@ -6,6 +6,7 @@ import com.aps.entity.Algorithm.IDAndChildID.GroupResult;
import com.aps.entity.Algorithm.IDAndChildID.NodeInfo; import com.aps.entity.Algorithm.IDAndChildID.NodeInfo;
import com.aps.entity.basic.*; import com.aps.entity.basic.*;
import com.aps.service.plan.MachineSchedulerService; import com.aps.service.plan.MachineSchedulerService;
import com.aps.service.plan.PlanResultService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.ScopeMetadata; import org.springframework.context.annotation.ScopeMetadata;
...@@ -25,9 +26,12 @@ public class ScheduleOperationService { ...@@ -25,9 +26,12 @@ public class ScheduleOperationService {
private MaterialRequirementService materialRequirementService; private MaterialRequirementService materialRequirementService;
private PlanResultService planResultService;
public ScheduleOperationService(MaterialRequirementService _materialRequirementService) {
public ScheduleOperationService(MaterialRequirementService _materialRequirementService,PlanResultService _planResultService) {
materialRequirementService=_materialRequirementService; materialRequirementService=_materialRequirementService;
planResultService=_planResultService;
} }
/** /**
...@@ -1215,6 +1219,21 @@ if(targetOp.getSequence()>1) { ...@@ -1215,6 +1219,21 @@ if(targetOp.getSequence()>1) {
*/ */
public void redecode(Chromosome chromosome,LocalDateTime baseTime, GlobalParam globalParam) public void redecode(Chromosome chromosome,LocalDateTime baseTime, GlobalParam globalParam)
{ {
List<Material> UseMaterials= materialRequirementService.GetMaterials(chromosome.getScenarioID());
chromosome.setMaterials(new ArrayList<>());
if(UseMaterials==null) {
if (chromosome.getMaterialIds() != null && chromosome.getMaterialIds().size() > 0) {
List<Material> Materials = planResultService.InitMaterial();
UseMaterials = Materials.stream()
.filter(t -> chromosome.getMaterialIds()
.contains(t.getId())).collect(Collectors.toList());
chromosome.setMaterials(UseMaterials);
}
}else {
chromosome.setMaterials(UseMaterials);
}
DelOrder(chromosome); DelOrder(chromosome);
MachineSchedulerService machineScheduler = new MachineSchedulerService(baseTime); MachineSchedulerService machineScheduler = new MachineSchedulerService(baseTime);
...@@ -1254,6 +1273,7 @@ if(targetOp.getSequence()>1) { ...@@ -1254,6 +1273,7 @@ if(targetOp.getSequence()>1) {
// } // }
} }
public void DelOrder(Chromosome chromosome) { public void DelOrder(Chromosome chromosome) {
List<Entry> allOperations = chromosome.getAllOperations(); List<Entry> allOperations = chromosome.getAllOperations();
List<GlobalOperationInfo> globalOpList= chromosome.getGlobalOpList(); List<GlobalOperationInfo> globalOpList= chromosome.getGlobalOpList();
......
...@@ -49,12 +49,12 @@ public class PlanResultServiceTest { ...@@ -49,12 +49,12 @@ public class PlanResultServiceTest {
// opids.add(7); // opids.add(7);
// planResultService.Move("27065EA0ECD14A81B7FAAFEF52273F93",opids,t,1265l,0); // planResultService.Move("27065EA0ECD14A81B7FAAFEF52273F93",opids,t,1265l,0);
// planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93"); // planResultService.Redecode("27065EA0ECD14A81B7FAAFEF52273F93");
planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D"); // planResultService.Redecode("00E0C5D3E4AD4F36B56C39395906618D");
// planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l); // planResultService.Drag("27065EA0ECD14A81B7FAAFEF52273F93",opids,6,false,0l);
// MaintenanceWindow maintenanceWindow=new MaintenanceWindow(); MaintenanceWindow maintenanceWindow=new MaintenanceWindow();
// maintenanceWindow.setStartTime(LocalDateTime.of(2025, 10, 21, 0, 0, 0)); maintenanceWindow.setStartTime(LocalDateTime.of(2026, 2, 4, 0, 0, 0));
// maintenanceWindow.setEndTime(LocalDateTime.of(2025, 10, 31, 0, 0, 0)); maintenanceWindow.setEndTime(LocalDateTime.of(2025, 2, 5, 0, 0, 0));
// planResultService.AddMaintenanceWindow("B6AE363FF5044DDF8DECE32D5FE0F7EA",1245l,maintenanceWindow); planResultService.AddMaintenanceWindow("00E0C5D3E4AD4F36B56C39395906618D",2492l,maintenanceWindow);
// planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7); // planResultService.DelOperation("B6AE363FF5044DDF8DECE32D5FE0F7EA",7);
// planResultService.SpiltOrder("A41D662EE0764D008173C5A0E42B15F6","5f9d5383-b89a-4a4f-8805-2f617c711968",new Double[]{500d, 500d}); // 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