Commit f1998b61 authored by Tong Li's avatar Tong Li

变邻域+模拟退火+禁忌搜索

parent 8a7de711
...@@ -156,6 +156,11 @@ public class Order { ...@@ -156,6 +156,11 @@ public class Order {
* 是否新创建,默认值:false * 是否新创建,默认值:false
*/ */
private boolean newCreate = false; private boolean newCreate = false;
/**
* 是否新创建半成品,默认值:false
*/
private boolean newSfCreate = false;
/** /**
* 是否创建BOM,默认值:false * 是否创建BOM,默认值:false
......
...@@ -25,6 +25,10 @@ public class GeneticOperations { ...@@ -25,6 +25,10 @@ public class GeneticOperations {
private static ScheduleParams param; private static ScheduleParams param;
public GeneticOperations() {
}
public GeneticOperations(GlobalParam globalParam,List<Entry> _allOperations,ScheduleParams _param) { public GeneticOperations(GlobalParam globalParam,List<Entry> _allOperations,ScheduleParams _param) {
_GlobalParam=globalParam; _GlobalParam=globalParam;
allOperations = _allOperations; allOperations = _allOperations;
...@@ -424,10 +428,12 @@ public class GeneticOperations { ...@@ -424,10 +428,12 @@ public class GeneticOperations {
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();
if(chromosome.getOrders()==null||chromosome.getOrders().size()==0)
return;
List<Order> orders = chromosome.getOrders(); List<Order> orders = chromosome.getOrders();
List<Integer> OperationSequencing= chromosome.getOperationSequencing(); List<Integer> OperationSequencing= chromosome.getOperationSequencing();
List<Integer> newoorderids= orders.stream() List<Integer> newoorderids= orders.stream()
.filter(t->t.isNewCreate()) .filter(t->t.isNewSfCreate())
.map(Order::getId) .map(Order::getId)
.sorted(Comparator.reverseOrder()) .sorted(Comparator.reverseOrder())
.collect(Collectors.toList()); .collect(Collectors.toList());
......
...@@ -894,7 +894,7 @@ public class MaterialRequirementServicebf { ...@@ -894,7 +894,7 @@ public class MaterialRequirementServicebf {
childorder.setQuantity((int) orderMaterial.getQjQty()); childorder.setQuantity((int) orderMaterial.getQjQty());
childorder.setFinishOrderId(new ArrayList<>()); childorder.setFinishOrderId(new ArrayList<>());
childorder.getFinishOrderId().add(forder.getId()); childorder.getFinishOrderId().add(forder.getId());
childorder.setNewCreate(true); childorder.setNewSfCreate(true);
childorder.setTargetFinishedOperationId(new ArrayList<>()); childorder.setTargetFinishedOperationId(new ArrayList<>());
childorder.getTargetFinishedOperationId().add(operation.getId()); childorder.getTargetFinishedOperationId().add(operation.getId());
childorder.setSerie(forder.getSerie()); childorder.setSerie(forder.getSerie());
......
...@@ -238,7 +238,7 @@ public class PlanResultService { ...@@ -238,7 +238,7 @@ public class PlanResultService {
_sceneService.saveChromosomeToFile(chromosome, SceneId); _sceneService.saveChromosomeToFile(chromosome, SceneId);
WriteScheduleSummary(chromosome); // WriteScheduleSummary(chromosome);
return chromosome; return chromosome;
......
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