Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ private void listView(XSSFSheet listSheet, List<Lesson> validLessons, List<Lesso
* Helper function to print out every lesson
*/
private int listViewPrntHlpr(XSSFSheet listSheet, List<Lesson> lessons, int rowIdx) {

lessons = sortLessons(lessons);

for(Lesson lesson: lessons){
final Timeslot lsTs = lesson.getTimeslot();
Timeslot.test_minSetUp("1");
Expand Down Expand Up @@ -289,6 +292,9 @@ private int listViewPrntHlpr(XSSFSheet listSheet, List<Lesson> lessons, int rowI
* list view helper for printing out the skipped lessons
*/
private int listViewSkipHelper(XSSFSheet listSheet, List<Lesson> lessons, int rowIdx){

lessons = sortLessons(lessons);

for(Lesson lesson: lessons){
Row row = listSheet.createRow(rowIdx++);
Object[] vals = new Object[]{lesson.getCourseName(), "N/A", lesson.getModifiers(),
Expand Down Expand Up @@ -318,6 +324,22 @@ else if (val instanceof Boolean){
}
}


private List<Lesson> sortLessons(List<Lesson> list){
//sort the list so it look neat to look at; sort by course name
//make the list mutable for sorting
List<Lesson> toSort = new ArrayList<>(list);
toSort.sort((a, b) -> {
String nameA = a.getCourseName();
String nameB = b.getCourseName();

return nameA.compareTo(nameB);
});

return toSort;
}


/**
* driver function for printing out the teacher view Excel sheet
*/
Expand Down
2 changes: 1 addition & 1 deletion java/hello-world/src/main/resources/solverConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!--stricter modes cause the solver to become slower, but can be used in dev for error-detection;
use NON_REPRODUCIBLE if you don't reproducibility. For dev use PHASE_ASSERT (the default) or just comment
out the environment mode; see https://docs.timefold.ai/timefold-solver/latest/using-timefold-solver/running-the-solver#environmentModeBestPractices-->
<environmentMode>NON_REPRODUCIBLE</environmentMode>
<!-- <environmentMode>NON_REPRODUCIBLE</environmentMode>-->
<termination>
<secondsSpentLimit>100</secondsSpentLimit>
</termination>
Expand Down
Loading