-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolverConfig.xml
More file actions
81 lines (73 loc) · 4.01 KB
/
Copy pathsolverConfig.xml
File metadata and controls
81 lines (73 loc) · 4.01 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<solver>
<solutionClass>org.acme.schooltimetabling.domain.Timetable</solutionClass>
<entityClass>org.acme.schooltimetabling.domain.lesson.Lesson</entityClass>
<scoreDirectorFactory>
<constraintProviderClass>org.acme.schooltimetabling.solver.TimetableConstraintProvider</constraintProviderClass>
</scoreDirectorFactory>
<!--Random seed is used for heuristics and meta heuristics; setting it doesn't really matter I think-->
<randomSeed>auto</randomSeed>
<!--stricter modes cause the solver to become slower, but can be used in dev for error-detection;
use NON_REPRODUCIBLE if you don't reproducibility. For dev use PHASE_ASSERT (the default) or just comment
out the environment mode; see https://docs.timefold.ai/timefold-solver/latest/using-timefold-solver/running-the-solver#environmentModeBestPractices-->
<!-- <environmentMode>NON_REPRODUCIBLE</environmentMode>-->
<termination>
<secondsSpentLimit>100</secondsSpentLimit>
</termination>
<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
<entitySorterManner>DESCENDING_IF_AVAILABLE</entitySorterManner>
<!-- Cartesian product scales poorly, but I doubt it will ever be a problem for something of our size,
However, if it ever does, just remove it and you still get a good starting state-->
<cartesianProductMoveSelector>
<changeMoveSelector>
<valueSelector variableName="timeslot"/>
</changeMoveSelector>
<changeMoveSelector>
<valueSelector variableName="room"/>
</changeMoveSelector>
</cartesianProductMoveSelector>
</constructionHeuristic>
<!--This phase is meant to get to a solution that has no hard score violations-->
<localSearch>
<!-- terminate after all hard constraints are solved, with any medium or soft score-->
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<bestScoreLimit>0hard/*medium/*soft</bestScoreLimit>
<unimprovedSecondsSpentLimit>30</unimprovedSecondsSpentLimit>
</termination>
<acceptor>
<!-- adding entity tabu helps a lot, the lower, the better. Using entity size rather than ratio is better
from my experiments. Upon the semester switch adding tabu could harm the solution quality-->
<entityTabuSize>1</entityTabuSize>
<simulatedAnnealingStartingTemperature>2hard/10medium/20soft</simulatedAnnealingStartingTemperature>
</acceptor>
<!-- from experiments, the lower this number the better, but too low seems to end up in hard constraints violated-->
<!-- 10 seems to be around the sweet spot -->
<forager>
<acceptedCountLimit>10</acceptedCountLimit>
</forager>
</localSearch>
<!--This phase is for improving the medium score. In other words, trying to get professors their time
preferences-->
<localSearch>
<termination>
<terminationCompositionStyle>OR</terminationCompositionStyle>
<diminishedReturns />
<unimprovedSecondsSpentLimit>30</unimprovedSecondsSpentLimit>
<!--The solver already heavily favors time outside primetime, so we only look to increase
the medium score-->
<unimprovedScoreDifferenceThreshold>0hard/1medium/*soft</unimprovedScoreDifferenceThreshold>
</termination>
<acceptor>
<!--I honestly can't tell if adding in Tabu really makes a difference; I think it's better off w/o it-->
<entityTabuSize>1</entityTabuSize>
<!--using a ration for the values throws an error currently-->
<valueTabuSize>3</valueTabuSize>
<simulatedAnnealingStartingTemperature>3hard/5medium/5soft</simulatedAnnealingStartingTemperature>
</acceptor>
<forager>
<acceptedCountLimit>10</acceptedCountLimit>
</forager>
</localSearch>
</solver>