Commit 96d69acd authored by Tong Li's avatar Tong Li

速度优化

parent 76572cbe
...@@ -185,12 +185,12 @@ public class MachineCalculator { ...@@ -185,12 +185,12 @@ public class MachineCalculator {
List<TimeSegment> timeSegments= findAvailableSegments(machine, currentTime, machineTasks, remainingTime, isInterrupt); List<TimeSegment> timeSegments= findAvailableSegments(machine, currentTime, machineTasks, remainingTime, isInterrupt);
int estimateIndex= (int) Math.ceil(remainingTime / (double) ONE_DAY_MINUTES); int estimateIndex= (int) Math.ceil(remainingTime / (double) ONE_DAY_MINUTES);
List<TimeSegment> timeSegments1=null; List<TimeSegment> timeSegments1=null;
if(estimateIndex>10) // if(estimateIndex>10)
{ // {
timeSegments1= getEnoughSegmentsByEstimateIndex(timeSegments,currentTime,remainingTime); // timeSegments1= getEnoughSegmentsByEstimateIndex(timeSegments,currentTime,remainingTime);
} // }
if(timeSegments1==null) { // if(timeSegments1==null) {
int i = 0; int i = 0;
while (remainingTime > 0) { while (remainingTime > 0) {
TimeSegment shift = timeSegments.get(i); TimeSegment shift = timeSegments.get(i);
...@@ -203,9 +203,9 @@ public class MachineCalculator { ...@@ -203,9 +203,9 @@ public class MachineCalculator {
RemoveMachineAvailable(machine, time,shift); RemoveMachineAvailable(machine, time,shift);
i++; i++;
} }
}else { // }else {
times= CaldScheduleResultDetail(timeSegments1,machine,st,remainingTime,oneTime); // times= CaldScheduleResultDetail(timeSegments1,machine,st,remainingTime,oneTime);
} // }
return times; return times;
} }
...@@ -1014,7 +1014,7 @@ public class MachineCalculator { ...@@ -1014,7 +1014,7 @@ public class MachineCalculator {
} }
} }
private void RemoveMachineAvailable1(Machine machine, ScheduleResultDetail geneDetails) { private void RemoveMachineAvailable1(Machine machine, ScheduleResultDetail geneDetails,TimeSegment targetSegment1) {
List<TimeSegment> timeSegments = new ArrayList<>(); List<TimeSegment> timeSegments = new ArrayList<>();
List<TimeSegment> availabilitySnapshot = new ArrayList<>(machine.getAvailability()); List<TimeSegment> availabilitySnapshot = new ArrayList<>(machine.getAvailability());
......
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