-
Notifications
You must be signed in to change notification settings - Fork 12
/
index.html
181 lines (179 loc) · 6.43 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Good-Enough Golfers</title>
<link rel="stylesheet" href="index.css"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/immutable.min.js"></script>
<script src="index.js" type="text/javascript"></script>
</head>
<body>
<div id="controls">
<h1>Good-Enough Golfers</h1>
<div>
<div class="help-text">
Click the "Recompute" button to get a new solution.
<br />Customize group size, number of groups and number of
rounds with the sliders.
<br />Solutions with more rounds and larger groups take longer
to compute.
<br />"Use Group Leaders?" keeps the first <em>N</em> players
with their respective groups.
</div>
</div>
<button type="button" id="recomputeButton">Recompute!</button>
<table>
<tr>
<th>Number of groups</th>
<td class="sliderLabel">
<input type=""text" id="groupsBox" value="5" />
</td>
<td>
<input id="groupsSlider" type="range" min="1" max="50" step="1" value="5"/>
</td>
</tr>
<tr>
<th>People per group</th>
<td class="sliderLabel"}>
<input type="text" id="ofSizeBox" value="4" />
</td>
<td>
<input id="ofSizeSlider" type="range" min="2" max="15" step="1" value="4"/>
</td>
</tr>
<tr>
<th>Number of rounds</th>
<td class="sliderLabel"}>
<input type="text" id="forRoundsBox" value="5" />
</td>
<td>
<input id="forRoundsSlider" type="range" min="1" max="20" step="1" value="5"/>
</td>
</tr>
<tr>
<th>Use group leaders?</th>
<td class="sliderLabel">
<input id="withGroupLeadersBox" type="checkbox" />
</td>
<td> </td>
</tr>
</table>
<div>
<div>
<strong>Player Names</strong>
</div>
<div class="help-text">
Player names can be provided for convenience.
<br />If player names are omitted, players will be numbered.
<br />Editing player names will update the current solution in
real-time; you don't need to click "Recompute."
<br />
<br /><strong>Privacy:</strong> Names are never sent to our
servers. All processing happens on your own computer.
<br />
<br />If two players have the same name, additional constraints
(below) will apply to both of them.
<br />
<br />Tip: To produce mostly-even groups with an uneven number
of players, create players named <tt>[Empty]</tt> to round out
your roster, and add an <tt>[Empty],[Empty]</tt> constraint
in the next box.
</div>
<div>
<textarea id="playerNames" rows="21">
Alleson
Brad
Charlie
Danielle
Fredric
George
Harriet
Ivan
Jenny
Karen
Laura
Mona
Nathan
Olive
Penelope
Rachel
Stan
Tom
[Empty]
[Empty]
</textarea>
</div>
</div>
<div>
<div>
<strong>Never allow these pairs</strong>
</div>
<div class="help-text">
Players grouped in this box are never grouped by the solver
unless absolutely necessary.
<br />Comma-separate names within a group.
<br />Put groups on separate lines.
</div>
<div>
<textarea id="forbiddenPairs" rows="6">
Brad, Danielle
[Empty], [Empty]
</textarea>
</div>
</div>
<div>
<div>
<strong>Prefer splitting these groups</strong>
</div>
<div class="help-text">
Similar to above, but lower priority.
The solver avoids grouping players if they're already
grouped here, but reducing repeat encounters can take
priority in later rounds.
<br />Tip: You can encourage the solver to gender-balance
groups by listing all players of one gender in a group here.
</div>
<div>
<textarea id="discouragedGroups" rows="6">
Brad,Ivan,Mona,Stan
</textarea>
</div>
</div>
<div>
<div class="help-text">
The <strong>conflict score</strong> is a representation of how
far the solution is from perfect - lower is better.
<br />The <strong>Download CSV</strong> button provides a pivot
view of the solution that makes it easier see the sequence of
groups for a given player.
<br />
<br /><a href="javascript:hideHelp()">Close help.</a>
</div>
</div>
<p>
<em>Good-Enough Golfers</em> is a near-solver for a class of scheduling problems including the
<a href="http://mathworld.wolfram.com/SocialGolferProblem.html">Social Golfer Problem</a>
and
<a href="http://mathworld.wolfram.com/KirkmansSchoolgirlProblem.html">Kirkman's Schoolgirl Problem</a>.
The goal is to schedule <tt>g x p</tt> players into <tt>g</tt> groups of size <tt>p</tt> for
<tt>w</tt> weeks such that no two players meet more than once.
</p>
<p>
Real solutions to these problems can be extremely slow, but approximations are fast and
often good enough for real-world purposes.
</p>
<p>
<a href="http://bradleycbuchanan.com">B Buchanan</a>, 2017
-
<a href="https://github.com/islemaster/good-enough-golfers">View Source</a>
-
<a href="https://ko-fi.com/bcbeng">Tip Jar</a>
-
<a id="show-help-link" href="javascript:showHelp()">Help</a>
<a id="hide-help-link" href="javascript:hideHelp()">Close Help</a>
</p>
</div>
<div id="results">
</div>
</body>
</html>