-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- given classes must be taught on back-to-back dates and in the given order - when prohibited or (strongly) discouraged: given classes must be taught on dates in the given order, with at least one day between the following classes - note: The primary use for this constraint is for classes that meet only once - the constraint cannot be satisfied when one of the meetings falls on a holiday, and the other does not
- Loading branch information
1 parent
14e5d2b
commit 1cd6629
Showing
6 changed files
with
125 additions
and
20 deletions.
There are no files selected for viewing
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
Documentation/Scripts/Create Different Time And Ignore Student Conflicts Constraint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<script name="Distribution Types: Create Different Time + Ignore Student Conflicts Constraint" permission="Distribution Preferences" engine="ECMAScript" created="Thu Dec 19 15:12:22 CET 2024"> | ||
<description><![CDATA[This script creates the Different Time + Ignore Student Conflicts Constraint.<br> | ||
Combination of two constraints, Different Time and Ignore Student Conflicts.<br> | ||
Given classes cannot overlap in time, replacing any student conflicts between these classes.<br> | ||
When prohibited or (strongly) discouraged: every pair of classes in the constraint must overlap in time. Still, student conflicts are ignored.]]></description> | ||
<body><![CDATA[var reqId = hibSession.createQuery('select max(requirementId) from DistributionType').uniqueResult(); | ||
var type = hibSession.createQuery('from DistributionType where reference = :reference').setParameter('reference', 'DIFF_TIME_IGN_STUDS').uniqueResult(); | ||
if (type == null) { | ||
type = new org.unitime.timetable.model.DistributionType(); | ||
type.setReference('DIFF_TIME_IGN_STUDS'); | ||
type.setLabel('Different Time + Ignore Student Conflicts'); | ||
type.setSequencingRequired(false); | ||
type.setRequirementId(++reqId); | ||
type.setAllowedPref('P43210R'); | ||
type.setDescr('Combination of two constraints, Different Time and Ignore Student Conflicts.<br>' + | ||
'Given classes cannot overlap in time, replacing any student conflicts between these classes.<br>' + | ||
'When prohibited or (strongly) discouraged: every pair of classes in the constraint must overlap in time. Still, student conflicts are ignored.' | ||
); | ||
type.setAbbreviation('Diff Time No Stds'); | ||
type.setInstructorPref(true); | ||
type.setExamPref(false); | ||
type.setVisible(true); | ||
hibSession.saveOrUpdate(type); | ||
log.info('Different Time + Ignore Student Conflicts distribution type created.'); | ||
} else { | ||
log.warn('Different Time + Ignore Student Conflicts distribution type already exists.'); | ||
} | ||
log.info('All done.');]]></body> | ||
</script> |
33 changes: 33 additions & 0 deletions
33
Documentation/Scripts/Create Following Dates Constraint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<script name="Distribution Types: Create Following Dates Constraint" permission="Distribution Preferences" engine="ECMAScript" created="Thu Dec 19 14:53:46 CET 2024"> | ||
<description><![CDATA[This script creates the Following Dates Constraint.<br> | ||
Given classes must be taught on back-to-back dates and in the given order.<br> | ||
When prohibited or (strongly) discouraged: given classes must be taught on dates in the given order, with at least one day between the following classes.<br> | ||
Note: The primary use for this constraint is for classes that meet only once. The constraint cannot be satisfied when one of the meetings falls on a holiday, and the other does not.]]></description> | ||
<body><![CDATA[var reqId = hibSession.createQuery('select max(requirementId) from DistributionType').uniqueResult(); | ||
var type = hibSession.createQuery('from DistributionType where reference = :reference').setParameter('reference', 'FOLLOWING_DATES').uniqueResult(); | ||
if (type == null) { | ||
type = new org.unitime.timetable.model.DistributionType(); | ||
type.setReference('FOLLOWING_DATES'); | ||
type.setLabel('Following Dates'); | ||
type.setSequencingRequired(false); | ||
type.setRequirementId(++reqId); | ||
type.setAllowedPref('P43210R'); | ||
type.setDescr('Given classes must be taught on back-to-back dates and in the given order.<br>' + | ||
'When prohibited or (strongly) discouraged: given classes must be taught on dates in the given order, with at least one day between the following classes.<br>' + | ||
'Note: The primary use for this constraint is for classes that meet only once. The constraint cannot be satisfied when one of the meetings falls on a holiday, and the other does not.' | ||
); | ||
type.setAbbreviation('Following Dates'); | ||
type.setInstructorPref(true); | ||
type.setExamPref(false); | ||
type.setVisible(true); | ||
hibSession.saveOrUpdate(type); | ||
log.info('Following Dates distribution type created.'); | ||
} else { | ||
log.warn('Following Dates distribution type already exists.'); | ||
} | ||
log.info('All done.');]]></body> | ||
</script> |
33 changes: 33 additions & 0 deletions
33
Documentation/Scripts/Create Same Students No Distance Constraint.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<script name="Distribution Types: Create Same Students No Distance Constraint" permission="Distribution Preferences" engine="ECMAScript" created="Thu Dec 19 15:05:10 CET 2024"> | ||
<description><![CDATA[This script creates the Same Students No Distance Constraint.<br> | ||
This distribution is the same as the Same Students distribution, except there is no distance conflict checking and no work-day limit.<br> | ||
Also, the distribution gets ignored when there is the Ignore Student Conflicts distribution between the two classes.]]></description> | ||
<body><![CDATA[var reqId = hibSession.createQuery('select max(requirementId) from DistributionType').uniqueResult(); | ||
var type = hibSession.createQuery('from DistributionType where reference = :reference').setParameter('reference', 'SAME_STUD_NODST').uniqueResult(); | ||
if (type == null) { | ||
type = new org.unitime.timetable.model.DistributionType(); | ||
type.setReference('SAME_STUD_NODST'); | ||
type.setLabel('Same Students No Distance'); | ||
type.setSequencingRequired(false); | ||
type.setRequirementId(++reqId); | ||
type.setAllowedPref('210R'); | ||
type.setDescr('This distribution is the same as the Same Students distribution, except there is no distance conflict checking and no work-day limit.<br>' + | ||
'Also, the distribution gets ignored when there is the Ignore Student Conflicts distribution between the two classes.<br>' + | ||
'This constraint can be used as the Same Student Constraint in the solver configuration, e.g., in the interactive mode, ' + | ||
'replacing the Different Time constraint which does not ignore cases when there is the Ignore Student Conflicts between two classes in a parent-child relation.' | ||
); | ||
type.setAbbreviation('Same Studs No Dist'); | ||
type.setInstructorPref(true); | ||
type.setExamPref(false); | ||
type.setVisible(true); | ||
hibSession.saveOrUpdate(type); | ||
log.info('Same Students No Distance distribution type created.'); | ||
} else { | ||
log.warn('Same Students No Distance distribution type already exists.'); | ||
} | ||
log.info('All done.');]]></body> | ||
</script> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters