You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,now I can get a result quickly.Look the result:
GL0537→LSS0653, LSS0653→FU0721, FU0721→LSX0754, LSX0754→NH0818, NH0818→LSS0849, LSS0849→FU0918, FU0918→LSX0948, LSX0948→NH1013, NH1013→LH1044
But I want to transfer betweent two flights has some time space >=15 minutes,like:
GL0537→LSS0653, LSS0709→FU0738,
So I change this function below,but it work a long time and get no solution(FlightCrewSolution-null).What can I do?
publiclongcountInvalidConnections() {
// TODO Cache this to improve example performance.// Especially useful for Constraint Streams, by which this is called multiple times per Employee.longcount = 0L;
FlightAssignmentpreviousAssignment = null;
for (FlightAssignmentassignment : flightAssignmentSet) {
if (previousAssignment != null
&& (previousAssignment.getFlight().getArrivalAirport() != assignment.getFlight().getDepartureAirport()||assignment.getFlight().getDepartureUTCDateTime().compareTo(previousAssignment.getFlight().getArrivalUTCDateTime())<15)) {
count++;
}
previousAssignment = assignment;
}
returncount;
}
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Failed writing outputSolutionFile (C:\Users\AppData\Local\Temp\970flights-1days.xlsx14207723011296920002.xlsx) for solution (FlightCrewSolution-null).
at org.optaplanner.examples.flightcrewscheduling.persistence.FlightCrewSchedulingXlsxFileIO.write(FlightCrewSchedulingXlsxFileIO.java:86)
at org.optaplanner.examples.flightcrewscheduling.persistence.FlightCrewSchedulingXlsxFileIO.write(FlightCrewSchedulingXlsxFileIO.java:1)
at org.optaplanner.examples.flightcrewscheduling.swingui.FlightCrewSchedulingPanel.lambda$0(FlightCrewSchedulingPanel.java:54)
at java.desktop/javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1972)
at java.desktop/javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2313)
at java.desktop/javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:405)
at java.desktop/javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:262)
at java.desktop/javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:279)
at java.desktop/java.awt.Component.processMouseEvent(Component.java:6626)
at java.desktop/javax.swing.JComponent.processMouseEvent(JComponent.java:3389)
at java.desktop/java.awt.Component.processEvent(Component.java:6391)
at java.desktop/java.awt.Container.processEvent(Container.java:2266)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5001)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2324)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4948)
at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4575)
at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4516)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2310)
at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2780)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4833)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:97)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:746)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:744)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:743)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IllegalArgumentException: Merged region M3 must contain 2 or more cells
at org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(XSSFSheet.java:339)
at org.apache.poi.xssf.usermodel.XSSFSheet.addMergedRegion(XSSFSheet.java:304)
at org.optaplanner.examples.flightcrewscheduling.persistence.FlightCrewSchedulingXlsxFileIO$FlightCrewSchedulingXlsxWriter.writeEmployeesView(FlightCrewSchedulingXlsxFileIO.java:586)
at org.optaplanner.examples.flightcrewscheduling.persistence.FlightCrewSchedulingXlsxFileIO$FlightCrewSchedulingXlsxWriter.write(FlightCrewSchedulingXlsxFileIO.java:372)
at org.optaplanner.examples.flightcrewscheduling.persistence.FlightCrewSchedulingXlsxFileIO.write(FlightCrewSchedulingXlsxFileIO.java:83)
... 37 more
Hello,now I can get a result quickly.Look the result:
GL0537→LSS0653, LSS0653→FU0721, FU0721→LSX0754, LSX0754→NH0818, NH0818→LSS0849, LSS0849→FU0918, FU0918→LSX0948, LSX0948→NH1013, NH1013→LH1044
But I want to transfer betweent two flights has some time space >=15 minutes,like:
GL0537→LSS0653, LSS0709→FU0738,
So I change this function below,but it work a long time and get no solution(FlightCrewSolution-null).What can I do?
970flights-1days.xlsx
The text was updated successfully, but these errors were encountered: