public class Test extends Object
StudentSctNeighbourSelection
is used)DataProperties
).
StudentSectioningXMLLoader.load()
).
Solver
).
StudentSectioningXMLSaver.save()
.
CourseConflictTable
and
DistanceConflictTable
) are created in the output folder.
Parameter | Type | Comment |
---|---|---|
Test.LastLikeCourseDemands | String |
Load last-like course demands from the given XML file (in the format that is being used for last like course demand table in the timetabling application) |
Test.StudentInfos | String |
Load last-like course demands from the given XML file (in the format that is being used for last like course demand table in the timetabling application) |
Test.CrsReq | String |
Load student requests from the given semi-colon separated list files (in the format that is being used by the old MSF system) |
Test.EtrChk | String |
Load student information (academic area, classification, major, minor) from the given semi-colon separated list files (in the format that is being used by the old MSF system) |
Sectioning.UseStudentPreferencePenalties | Boolean |
If true, StudentPreferencePenalties are used (applicable only for
online sectioning) |
Test.StudentOrder | String |
A class that is used for ordering of students (must be an interface of
StudentOrder , default is StudentRandomOrder , not applicable
only for batch sectioning) |
Test.CombineStudents | File |
If provided, students are combined from the input file (last-like students) and the provided file (real students). Real non-freshmen students are taken from real data, last-like data are loaded on top of the real data (all students, but weighted to occupy only the remaining space). |
Test.CombineStudentsLastLike | File |
If provided (together with Test.CombineStudents), students are combined from the this file (last-like students) and Test.CombineStudents file (real students). Real non-freshmen students are taken from real data, last-like data are loaded on top of the real data (all students, but weighted to occupy only the remaining space). |
Test.CombineAcceptProb | Double |
Used in combining students, probability of a non-freshmen real student to be taken into the combined file (default is 1.0 -- all real non-freshmen students are taken). |
Test.FixPriorities | Boolean |
If true, course/free time request priorities are corrected (to go from zero, without holes or duplicates). |
Test.ExtraStudents | File |
If provided, students are loaded from the given file on top of the students loaded from the ordinary input file (students with the same id are skipped). |
Modifier and Type | Class and Description |
---|---|
static class |
Test.ExtraStudentFilter |
static class |
Test.TestSolutionListener |
Constructor and Description |
---|
Test() |
Modifier and Type | Method and Description |
---|---|
static Solution<Request,Enrollment> |
batchSectioning(DataProperties cfg)
Batch sectioning test
|
static Solution<Request,Enrollment> |
combineStudents(DataProperties cfg,
File lastLikeStudentData,
File realStudentData)
Combine students from the provided two files
|
static void |
fixPriorities(StudentSectioningModel model) |
static double |
getLastLikeStudentWeight(Course course,
int real,
int lastLike)
Compute last-like student weight for the given course
|
static double[] |
getMinMaxAvailableEnrollmentPenalty(Assignment<Request,Enrollment> assignment,
CourseRequest request)
Minimum and maximum available enrollment penalty, i.e.,
Enrollment.getPenalty() of all available enrollments |
static double[] |
getMinMaxEnrollmentPenalty(CourseRequest request)
Minimum and maximum enrollment penalty, i.e.,
Enrollment.getPenalty() of all enrollments |
static String |
getPerc(double value,
double min,
double max)
Compute percentage
|
static Solution<Request,Enrollment> |
load(DataProperties cfg)
Load student sectioning model
|
static void |
loadCrsReqFiles(StudentSectioningModel model,
String files)
Load course request from the given files (in the format being used by the
old MSF system)
|
static void |
loadLastLikeCourseDemandsXml(StudentSectioningModel model,
File xml)
Load last-like students from an XML file (the one that is used to load
last like course demands table in the timetabling application)
|
static void |
main(String[] args)
Main
|
static Solution<Request,Enrollment> |
onlineSectioning(DataProperties cfg)
Online sectioning test
|
static void |
printInfo(Solution<Request,Enrollment> solution,
boolean computeTables,
boolean computeSectInfos,
boolean runChecks)
Print some information about the solution
|
static void |
saveInfoToXML(Solution<Request,Enrollment> solution,
Map<String,String> extra,
File file)
Save solution info as XML
|
static Solution<Request,Enrollment> |
solve(Solution<Request,Enrollment> solution,
DataProperties cfg)
Solve the student sectioning problem using IFS solver
|
public Test()
public static Solution<Request,Enrollment> load(DataProperties cfg)
cfg
- solver configurationpublic static Solution<Request,Enrollment> batchSectioning(DataProperties cfg)
cfg
- solver configurationpublic static Solution<Request,Enrollment> onlineSectioning(DataProperties cfg) throws Exception
cfg
- solver configurationException
- thrown when the sectioning failspublic static double[] getMinMaxEnrollmentPenalty(CourseRequest request)
Enrollment.getPenalty()
of all enrollmentsrequest
- a course requestpublic static double[] getMinMaxAvailableEnrollmentPenalty(Assignment<Request,Enrollment> assignment, CourseRequest request)
Enrollment.getPenalty()
of all available enrollmentsassignment
- current assignmentrequest
- a course requestpublic static String getPerc(double value, double min, double max)
value
- current valuemin
- minimal boundmax
- maximal boundpublic static void printInfo(Solution<Request,Enrollment> solution, boolean computeTables, boolean computeSectInfos, boolean runChecks)
solution
- given solutioncomputeTables
- true, if reports CourseConflictTable
and
DistanceConflictTable
are to be computed as wellcomputeSectInfos
- true, if online sectioning infou is to be computed as well
(see
StudentSectioningModel.computeOnlineSectioningInfos(Assignment)
)runChecks
- true, if checks OverlapCheck
and
SectionLimitCheck
are to be performed as wellpublic static Solution<Request,Enrollment> solve(Solution<Request,Enrollment> solution, DataProperties cfg)
solution
- current solutioncfg
- solver configurationpublic static double getLastLikeStudentWeight(Course course, int real, int lastLike)
course
- given coursereal
- number of real students for the courselastLike
- number of last-like students for the coursepublic static void loadLastLikeCourseDemandsXml(StudentSectioningModel model, File xml)
model
- problem modelxml
- an XML filepublic static void loadCrsReqFiles(StudentSectioningModel model, String files)
model
- student sectioning model (with offerings loaded)files
- semi-colon separated list of files to be loadedpublic static void fixPriorities(StudentSectioningModel model)
public static void saveInfoToXML(Solution<Request,Enrollment> solution, Map<String,String> extra, File file)
solution
- current solutionextra
- solution extra infofile
- file to writepublic static Solution<Request,Enrollment> combineStudents(DataProperties cfg, File lastLikeStudentData, File realStudentData)
cfg
- solver configurationlastLikeStudentData
- a file containing last-like student datarealStudentData
- a file containing real student data