Commit 250695e0 authored by Tong Li's avatar Tong Li

bom

parent d5dfcb6f
...@@ -144,17 +144,24 @@ public class GeneticDecoder { ...@@ -144,17 +144,24 @@ public class GeneticDecoder {
return chromosome; return chromosome;
} }
public void generateGlobalOpList(Chromosome chromosome) { public int generateGlobalOpList(Chromosome chromosome) {
CopyOnWriteArrayList<Entry> allOperations= chromosome.getAllOperations()
.stream()
.filter(t->t.isNewCreate()==true)
.collect(Collectors.toCollection(CopyOnWriteArrayList::new));
if(allOperations==null&&allOperations.size()>0)
{
return 0;
}
List<GlobalOperationInfo> globalOpList = new ArrayList<>(); List<GlobalOperationInfo> globalOpList = new ArrayList<>();
int globalOpId = chromosome.getGlobalOpList() int globalOpId = chromosome.getGlobalOpList()
.stream() .stream()
.mapToInt(GlobalOperationInfo::getGlobalOpId) .mapToInt(GlobalOperationInfo::getGlobalOpId)
.max().orElse(0)+1; .max().orElse(0)+1;
CopyOnWriteArrayList<Entry> allOperations= chromosome.getAllOperations()
.stream()
.filter(t->t.isNewCreate()==true)
.collect(Collectors.toCollection(CopyOnWriteArrayList::new));
for (Entry op : allOperations) { for (Entry op : allOperations) {
GlobalOperationInfo info = new GlobalOperationInfo(); GlobalOperationInfo info = new GlobalOperationInfo();
...@@ -168,7 +175,7 @@ public class GeneticDecoder { ...@@ -168,7 +175,7 @@ public class GeneticDecoder {
Initialization initialization=new Initialization(); Initialization initialization=new Initialization();
initialization.generateInitialSFPopulation(chromosome,globalOpList); initialization.generateInitialSFPopulation(chromosome,globalOpList);
chromosome.getGlobalOpList().addAll(globalOpList); chromosome.getGlobalOpList().addAll(globalOpList);
return 1;
} }
private void CreateNewOpSequence(Chromosome chromosome) private void CreateNewOpSequence(Chromosome chromosome)
...@@ -275,11 +282,13 @@ if(finishedOrder==null||finishedOrder.size()==0) ...@@ -275,11 +282,13 @@ if(finishedOrder==null||finishedOrder.size()==0)
List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam); List<OrderMaterialRequirement> orderMaterials = materialRequirementService.buildMultiLevelRequirementNetwork(chromosome, sceneId, baseTime,_globalParam);
if(orderMaterials!=null&&orderMaterials.size()>0&&_globalParam.isIsCheckSf()) { if(_globalParam.isIsCheckSf()) {
generateGlobalOpList(chromosome); int isnew= generateGlobalOpList(chromosome);
if(isnew==1) {
CreateNewOpSequence(chromosome); CreateNewOpSequence(chromosome);
} }
}
List<GlobalOperationInfo> globalOpList=chromosome.getGlobalOpList(); List<GlobalOperationInfo> globalOpList=chromosome.getGlobalOpList();
List<Entry> allOperations=chromosome.getAllOperations(); List<Entry> allOperations=chromosome.getAllOperations();
......
...@@ -276,6 +276,8 @@ public class MaterialRequirementService { ...@@ -276,6 +276,8 @@ public class MaterialRequirementService {
.eq(Routingsupporting::getIsdeleted, 0); .eq(Routingsupporting::getIsdeleted, 0);
routingsupportings1 = routingsupportingMapper.selectList(routingsupportingwrapper); routingsupportings1 = routingsupportingMapper.selectList(routingsupportingwrapper);
if(routingsupportings1!=null&&routingsupportings1.size()>0)
{
routingsupportings.addAll(routingsupportings1); routingsupportings.addAll(routingsupportings1);
List<String> routingsupportingids = routingsupportings1.stream() List<String> routingsupportingids = routingsupportings1.stream()
...@@ -339,6 +341,7 @@ public class MaterialRequirementService { ...@@ -339,6 +341,7 @@ public class MaterialRequirementService {
} }
} }
} }
}
if(routingIds1!=null) if(routingIds1!=null)
{ {
routingIds.addAll(routingIds1); routingIds.addAll(routingIds1);
......
...@@ -39,7 +39,7 @@ public class PlanResultServiceTest { ...@@ -39,7 +39,7 @@ public class PlanResultServiceTest {
// TestSortService sortService=new TestSortService(); // TestSortService sortService=new TestSortService();
// sortService.test1(); // sortService.test1();
// nsgaiiUtils.Test(); // nsgaiiUtils.Test();
planResultService.execute2("EDDAFBAC0BD84375B7CF89BC85255082"); planResultService.execute2("18E5F8BE09B14EAE822651BFEF100900");
// planResultService.execute2("726D4C1A712B4B1393175BD44B775B66"); // planResultService.execute2("726D4C1A712B4B1393175BD44B775B66");
// planResultService.execute2("265F24B6DF3C40E4B17D193B0CC8AAF2"); // planResultService.execute2("265F24B6DF3C40E4B17D193B0CC8AAF2");
// LocalDateTime t= LocalDateTime.of(2026, 02, 14, 1, 25, 52); // LocalDateTime t= LocalDateTime.of(2026, 02, 14, 1, 25, 52);
......
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