net.sf.cpsolver.studentsct
Class Test

java.lang.Object
  extended by net.sf.cpsolver.studentsct.Test

public class Test
extends Object

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:

Also, a log and some reports (e.g., CourseConflictTable and DistanceConflictTable) are created in the output folder.

Parameters:
ParameterTypeComment
Test.LastLikeCourseDemandsStringLoad 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.StudentInfosStringLoad 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.CrsReqStringLoad student requests from the given semi-colon separated list files (in the format that is being used by the old MSF system)
Test.EtrChkStringLoad 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.UseStudentPreferencePenaltiesBooleanIf true, StudentPreferencePenalties are used (applicable only for online sectioning)
Test.StudentOrderStringA class that is used for ordering of students (must be an interface of StudentOrder, default is StudentRandomOrder, not applicable only for batch sectioning)
Test.CombineStudentsFileIf 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.CombineStudentsLastLikeFileIf 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.CombineAcceptProbDoubleUsed 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.FixPrioritiesBooleanIf true, course/free time request priorities are corrected (to go from zero, without holes or duplicates).
Test.ExtraStudentsFileIf 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).


Version:
StudentSct 1.1 (Student Sectioning)
Copyright (C) 2007 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Nested Class Summary
static class Test.ExtraStudentFilter
           
static class Test.TestSolutionListener
           
 
Constructor Summary
Test()
           
 
Method Summary
static Solution 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 onlineSectioning(DataProperties cfg)
          Online sectioning test
static void printInfo(Solution solution, boolean computeTables, boolean computeSectInfos, boolean runChecks)
          Print some information about the solution
static void saveInfoToXML(Solution solution, Hashtable extra, File file)
          Save solution info as XML
static Solution 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

Test

public Test()
Method Detail

loadModel

public static StudentSectioningModel loadModel(DataProperties cfg)
Load student sectioning model


batchSectioning

public static Solution batchSectioning(DataProperties cfg)
Batch sectioning test


onlineSectioning

public static Solution onlineSectioning(DataProperties cfg)
                                 throws Exception
Online sectioning test

Throws:
Exception

getMinMaxEnrollmentPenalty

public static double[] getMinMaxEnrollmentPenalty(CourseRequest request)
Minimum and maximum enrollment penalty, i.e., Enrollment.getPenalty() of all enrollments


getMinMaxAvailableEnrollmentPenalty

public static double[] getMinMaxAvailableEnrollmentPenalty(CourseRequest request)
Minimum and maximum available enrollment penalty, i.e., Enrollment.getPenalty() of all available enrollments


getPerc

public static String getPerc(double value,
                             double min,
                             double max)
Compute percentage

Parameters:
value - current value
min - minimal bound
max - maximal bound
Returns:
(value-min)/(max-min)

printInfo

public static void printInfo(Solution solution,
                             boolean computeTables,
                             boolean computeSectInfos,
                             boolean runChecks)
Print some information about the solution

Parameters:
solution - given solution
computeTables - true, if reports CourseConflictTable and DistanceConflictTable are to be computed as well
computeSectInfos - 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 well

solveModel

public static Solution solveModel(StudentSectioningModel model,
                                  DataProperties cfg)
Solve the student sectioning problem using IFS solver


getLastLikeStudentWeight

public static double getLastLikeStudentWeight(Course course,
                                              int real,
                                              int lastLike)
Compute last-like student weight for the given course

Parameters:
course - given course
real - number of real students for the course
lastLike - number of last-like students for the course
Returns:
weight of a student request for the given course

loadLastLikeCourseDemandsXml

public 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)


loadCrsReqFiles

public static void loadCrsReqFiles(StudentSectioningModel model,
                                   String files)
Load course request from the given files (in the format being used by the old MSF system)

Parameters:
model - student sectioning model (with offerings loaded)
files - semi-colon separated list of files to be loaded

fixPriorities

public static void fixPriorities(StudentSectioningModel model)

loadStudentInfoXml

public static void loadStudentInfoXml(StudentSectioningModel model,
                                      File xml)
Load student infos from a given XML file.


saveInfoToXML

public static void saveInfoToXML(Solution solution,
                                 Hashtable extra,
                                 File file)
Save solution info as XML


combineStudents

public static StudentSectioningModel combineStudents(DataProperties cfg,
                                                     File lastLikeStudentData,
                                                     File realStudentData)
Combine students from the provided two files


main

public static void main(String[] args)
Main