|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.studentsct.Test
public class Test
A main class for running of the student sectioning solver from command line.
Usage:
java -Xmx1024m -jar studentsct-1.1.jar config.properties [input_file]
[output_folder] [batch|online|simple]
Modes:
batch ... batch sectioning mode (default mode -- IFS solver with
StudentSctNeighbourSelection
is used)
online ... online sectioning mode (students are sectioned one by
one, sectioning info (expected/held space) is used)
simple ... simple sectioning mode (students are sectioned one by
one, sectioning info is not used)
See http://www.unitime.org for example configuration files and benchmark data
sets.
The test does the following steps:
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). |
Nested Class Summary | |
---|---|
static class |
Test.ExtraStudentFilter
|
static class |
Test.TestSolutionListener
|
Constructor Summary | |
---|---|
Test()
|
Method Summary | |
---|---|
static Solution<Request,Enrollment> |
batchSectioning(DataProperties cfg)
Batch sectioning test |
static StudentSectioningModel |
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(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 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 StudentSectioningModel |
loadModel(DataProperties cfg)
Load student sectioning model |
static void |
loadStudentInfoXml(StudentSectioningModel model,
File xml)
Load student infos from a given XML file. |
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,
HashMap<String,String> extra,
File file)
Save solution info as XML |
static Solution<Request,Enrollment> |
solveModel(StudentSectioningModel model,
DataProperties cfg)
Solve the student sectioning problem using IFS solver |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Test()
Method Detail |
---|
public static StudentSectioningModel loadModel(DataProperties cfg)
public static Solution<Request,Enrollment> batchSectioning(DataProperties cfg)
public static Solution<Request,Enrollment> onlineSectioning(DataProperties cfg) throws Exception
Exception
public static double[] getMinMaxEnrollmentPenalty(CourseRequest request)
Enrollment.getPenalty()
of all enrollments
public static double[] getMinMaxAvailableEnrollmentPenalty(CourseRequest request)
Enrollment.getPenalty()
of all available enrollments
public static String getPerc(double value, double min, double max)
value
- current valuemin
- minimal boundmax
- maximal bound
public 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()
)runChecks
- true, if checks OverlapCheck
and
SectionLimitCheck
are to be performed as wellpublic static Solution<Request,Enrollment> solveModel(StudentSectioningModel model, DataProperties cfg)
public 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 course
public static void loadLastLikeCourseDemandsXml(StudentSectioningModel model, File xml)
public 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 loadStudentInfoXml(StudentSectioningModel model, File xml)
public static void saveInfoToXML(Solution<Request,Enrollment> solution, HashMap<String,String> extra, File file)
public static StudentSectioningModel combineStudents(DataProperties cfg, File lastLikeStudentData, File realStudentData)
public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |