|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.studentsct.OnlineSectProof
public class OnlineSectProof
A test class to demonstrate and compare different online sectioning approaches.
It assumes only a single course with just one instructional type (subpart) and
that we know the correct expected demand in advance.
With the given configuration (e.g., two sections of size 5), it tries all
combinations of students how they can be enrolled and compute average and worst
case scenarios.
Execution:
java -cp cpsolver-all-1.1.jar
net.sf.cpsolver.studentsct.OnlineSectProof n1 n2 n3 ...
where n1, n2, etc. are the sizes of particular sections, e.g., 10 10 for two sections of size 10.
Nested Class Summary | |
---|---|
static class |
OnlineSectProof.CatCmp
Comparison of two categories |
static class |
OnlineSectProof.Counter
Simple integer counter |
static class |
OnlineSectProof.Sequence
A representation of a long number of given base. |
static class |
OnlineSectProof.StudentSequence
Extension of OnlineSectProof.Sequence that represents an ordered set of students as they are to be enrolled into a course (given set of sections). |
Field Summary | |
---|---|
static String[] |
sOnlineAlgs
Implemented online algorithms (heuristics) |
Constructor Summary | |
---|---|
OnlineSectProof()
|
Method Summary | |
---|---|
static int |
checkOnline(OnlineSectProof.StudentSequence sq,
boolean computeExpectations,
int alg,
boolean debug)
Section given sequence of students into the course and return the number of students that cannot be sectioned. |
static void |
main(String[] args)
Test given course (set of sections) |
static double |
onlineObjective(double limit,
double used,
double expected,
int alg)
Implementation of the sectioning algorithms. |
static boolean |
skip(boolean computeExpectations,
int alg,
boolean allTheSame)
Return true, if the given heuristics should be skipped (not evaluated). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static String[] sOnlineAlgs
Constructor Detail |
---|
public OnlineSectProof()
Method Detail |
---|
public static boolean skip(boolean computeExpectations, int alg, boolean allTheSame)
computeExpectations
- true, if expected demand should be computed in advancealg
- online algorithm (see sOnlineAlgs
)allTheSame
- true, if all the sections are of the same size
public static double onlineObjective(double limit, double used, double expected, int alg)
limit
- section limitused
- number of space already usedexpected
- expected demand for the given sectionalg
- online algorithm (see sOnlineAlgs
)
public static int checkOnline(OnlineSectProof.StudentSequence sq, boolean computeExpectations, int alg, boolean debug)
sq
- sequence of studendscomputeExpectations
- true, if expected demand for each section should be computed in advance (otherwise, it is initially set to zero)alg
- online algorithm (see sOnlineAlgs
)debug
- if true, some debug messages are printed
public static void main(String[] args)
args
- set of integers -- limits of each sections
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |