Skip to content

Commit b373597

Browse files
committed
playing around with some numbers
1 parent b7d5fb9 commit b373597

File tree

5 files changed

+16
-14
lines changed

5 files changed

+16
-14
lines changed

src/Schedule/Schedule.java

+11-9
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,15 @@ public static void main(String[] args) {
115115
System.out.println(dat.tutors[i].name + " " + c / 2);
116116
}
117117

118-
// double s = 0;
119-
// {
120-
// String assign = dat.formattedAssignments();
121-
// double[] r = Evaluator.evaluate (dat, w, false);
122-
// double stdmin = r[0], maxhap = r[1];
123-
// s = r[1];
124-
// System.out.println(assign);
125-
// System.out.println(stdmin + " " + maxhap);
126-
// }
118+
double s = 0;
119+
{
120+
String assign = dat.readableFormattedAssignments();
121+
double[] r = Evaluator.evaluate (dat, w, false);
122+
double stdmin = r[0], maxhap = r[1];
123+
s = r[1];
124+
System.out.println(assign);
125+
System.out.println(stdmin + " " + maxhap);
126+
}
127127

128128
System.out.println("Swapping");
129129
// now do some random swapping to make it stable
@@ -156,6 +156,8 @@ public static void main(String[] args) {
156156
// System.out.println (maxhap - s);
157157
}
158158
System.out.println("DONE");
159+
System.out.println(dat.readableFormattedAssignments());
160+
System.out.println (Arrays.toString(Evaluator.evaluate(dat, w, true)));
159161
} catch (IOException e) {
160162
e.printStackTrace();
161163
} catch (Exception e) {

src/Swapper/Swapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Swapper {
1414
public static Random rand;
1515

1616
public static void stabilize(Data dat, Weighting w) {
17-
stabilize(dat, w, dat.tutors.length * 50000, 1e-10);
17+
stabilize(dat, w, dat.tutors.length * 100000, 1e-10);
1818
}
1919

2020
public static void stabilize(Data dat, Weighting w, int iter, double thresh) {

src/Weighting/Evaluator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static double[] evaluate(Data assign, Weighting w, boolean print) {
4444
for (Slot s : temp) {
4545
d += w.weight(t, s);
4646
if (t.timeSlots[s.sid] == 0) {
47-
score -= PENALTY * 100;
47+
score -= PENALTY;
4848
// System.out.println ("A");
4949
continue outer;
5050
}
@@ -76,7 +76,7 @@ public static double[] evaluate(Data assign, Weighting w, boolean print) {
7676
ok = true;
7777
}
7878
if (!ok)
79-
score -= PENALTY;
79+
score -= 100 * PENALTY;
8080
}
8181
double ave = score / (double) scores.length;
8282
double std = 0;

test/o.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"121":[1065],"122":[1099],"123":[939],"124":[1063],"125":[1225],"126":[1253],"127":[],"128":[939],"129":[1228],"130":[1065],"131":[1228],"132":[1054],"133":[],"134":[],"135":[1231],"136":[1253,1099],"137":[],"138":[1063],"139":[],"140":[1351],"141":[],"142":[1054],"143":[944],"144":[1074],"145":[1231],"146":[1227],"147":[944],"148":[1074],"149":[918],"150":[1237],"151":[1351],"152":[754],"153":[1215],"154":[768],"155":[754],"156":[1103],"157":[],"158":[908],"159":[918],"160":[1215],"161":[1072],"162":[923],"163":[],"164":[768],"165":[923],"166":[1103],"167":[1227],"168":[1071],"169":[],"170":[908],"171":[1072],"172":[1237],"173":[942],"174":[1071],"175":[],"176":[],"177":[942],"178":[1225],"179":[],"180":[]}
1+
{"121":[1074],"122":[754],"123":[944],"124":[1326],"125":[1264],"126":[1054],"127":[1071],"128":[1325],"129":[1099],"130":[1237],"131":[942],"132":[1215],"133":[944],"134":[942],"135":[1351],"136":[1215],"137":[1071],"138":[923],"139":[1072],"140":[1351],"141":[1065],"142":[1337],"143":[1224],"144":[1237],"145":[1228],"146":[1325],"147":[1224],"148":[939],"149":[1231],"150":[1225,1264],"151":[768],"152":[1337],"153":[918],"154":[1103],"155":[1361],"156":[1227,1103],"157":[1072],"158":[1361],"159":[1231],"160":[1227],"161":[768],"162":[939],"163":[918],"164":[1054],"165":[1065],"166":[923,1063],"167":[1323],"168":[1233],"169":[1228],"170":[754,1253],"171":[908],"172":[1063],"173":[1323],"174":[1225],"175":[1099],"176":[1074],"177":[1326],"178":[1233],"179":[908],"180":[1253]}

test/t6.json

+1-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)