Skip to content

Commit

Permalink
Default Solver Configuration
Browse files Browse the repository at this point in the history
- added ability to change the default solver configuration by changing the unitime.solverConfig.defaultXxx application property
  • Loading branch information
tomas-muller committed Nov 21, 2023
1 parent 535cc9a commit d0eaeb2
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 6 deletions.
31 changes: 31 additions & 0 deletions JavaSource/org/unitime/timetable/defaults/ApplicationProperty.java
Original file line number Diff line number Diff line change
Expand Up @@ -3294,6 +3294,7 @@ public enum ApplicationProperty {
@Since(4.7)
InstructorsCopyToSubSubparts("unitime.instructors.copyToSubSubparts"),

<<<<<<< HEAD
@Type(Boolean.class)
@DefaultValue("false")
@Description("Email Notifications: automatically email instructors about their schedule changes")
Expand Down Expand Up @@ -3350,6 +3351,36 @@ public enum ApplicationProperty {
@Since(4.8)
NotificationsInstructorChangesIncludeLink("unitime.notifications.instructorChanges.includeLink"),

@Type(String.class)
@DefaultValue("Default.Interactive")
@Description("Solver Configuration: Reference of the default interactive configuration (Saved Timetables page)")
@Since(4.8)
SolverConfigDefaultInteractive("unitime.solverConfig.defaultInteractive"),

@Type(String.class)
@DefaultValue("Default.Solver")
@Description("Solver Configuration: Reference of the default course timetabling configuration (Solver page)")
@Since(4.8)
SolverConfigDefaultCourse("unitime.solverConfig.defaultCourse"),

@Type(String.class)
@DefaultValue("Exam.Default")
@Description("Solver Configuration: Reference of the default examination timetabling configuration (Examination Timetabling Solver page)")
@Since(4.8)
SolverConfigDefaultExam("unitime.solverConfig.defaultExam"),

@Type(String.class)
@DefaultValue("StudentSct.Default")
@Description("Solver Configuration: Reference of the default student scheduling configuration (Student Scheduling Solver page)")
@Since(4.8)
SolverConfigDefaultStudentSct("unitime.solverConfig.defaultStudentSct"),

@Type(String.class)
@DefaultValue("InstrSchd.Default")
@Description("Solver Configuration: Reference of the default instructor scheduling configuration (Instructor Scheduling Solver page)")
@Since(4.8)
SolverConfigDefaultInstrSchd("unitime.solverConfig.defaultInstrSchd"),

;

String iKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ protected void fillHosts(ListSolutionsResponse response, SessionContext context)

protected void fillConfigurations(ListSolutionsResponse response, SessionContext context) {
int appearance = SolverPredefinedSetting.Appearance.TIMETABLES.ordinal();
String defaultConfig = "Interactive";
String defaultConfig = ApplicationProperty.SolverConfigDefaultInteractive.value();

List<SolverPredefinedSetting> configs = SolverPredefinedSettingDAO.getInstance().getSession().createQuery(
"from SolverPredefinedSetting s where s.appearance = :appearance", SolverPredefinedSetting.class
"from SolverPredefinedSetting s where s.appearance = :appearance order by s.description", SolverPredefinedSetting.class
).setParameter("appearance", appearance).setCacheable(true).list();

for (SolverPredefinedSetting config: configs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,25 +418,25 @@ protected void fillParameters(SessionContext context, SolverPageRequest request,
type = SolverParameterGroup.SolverType.COURSE;
group = "Basic";
appearance = SolverPredefinedSetting.Appearance.SOLVER;
defaultConfig = "Default.Solver";
defaultConfig = ApplicationProperty.SolverConfigDefaultCourse.value();
break;
case EXAM:
type = SolverParameterGroup.SolverType.EXAM;
group = "ExamBasic";
appearance = SolverPredefinedSetting.Appearance.EXAM_SOLVER;
defaultConfig = "Exam.Default";
defaultConfig = ApplicationProperty.SolverConfigDefaultExam.value();
break;
case STUDENT:
type = SolverParameterGroup.SolverType.STUDENT;
group = "StudentSctBasic";
appearance = SolverPredefinedSetting.Appearance.STUDENT_SOLVER;
defaultConfig = "StudentSct.Default";
defaultConfig = ApplicationProperty.SolverConfigDefaultStudentSct.value();
break;
case INSTRUCTOR:
type = SolverParameterGroup.SolverType.INSTRUCTOR;
group = "InstrSchd.Basic";
appearance = SolverPredefinedSetting.Appearance.INSTRUCTOR_SOLVER;
defaultConfig = "InstrSchd.Default";
defaultConfig = ApplicationProperty.SolverConfigDefaultInstrSchd.value();
break;
default:
throw new IllegalArgumentException(MESSAGES.errorSolverInvalidType(request.getType().name()));
Expand Down
6 changes: 6 additions & 0 deletions WebContent/help/Release-Notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,12 @@
<line>These can be added on the Administration &gt; Defaults &gt; User Settings, name property (and then selected on Preferences &gt; Settings).</line>
</description>
</item>
<item>
<name>Default Solver Configuration</name>
<description>
<line>Added ability to change the default solver configuration by changing the unitime.solverConfig.defaultXxx application property.</line>
</description>
</item>
</category>
<category>
<title>Bug Fixes</title>
Expand Down

0 comments on commit d0eaeb2

Please sign in to comment.