public class StableMatching extends SatisfactionProblem
Modifier and Type | Field and Description |
---|---|
IntVar[] |
company |
IntVar[] |
companyPref |
int |
n |
int[][] |
rankCompanies |
int[][] |
rankStudents |
IntVar[] |
student |
IntVar[] |
studentPref |
dfs
Constructor and Description |
---|
StableMatching(java.lang.String instanceFilePath) |
Modifier and Type | Method and Description |
---|---|
void |
buildModel()
Creates a model for the optimization
A CP model is composed of the variables + a search procedure
This method should set the values for
SatisfactionProblem.dfs
such that SatisfactionProblem.solve() can be called afterwards |
static void |
main(java.lang.String[] args) |
SearchStatistics |
solve(boolean verbose,
java.util.function.Predicate<SearchStatistics> limit)
Runs the search defined in the
SatisfactionProblem.dfs and possibly prints each found solution |
getNSolutions, resetNSolutions, solve, solve, solve
public final int n
public final int[][] rankCompanies
public final int[][] rankStudents
public IntVar[] student
public IntVar[] company
public IntVar[] studentPref
public IntVar[] companyPref
public void buildModel()
SatisfactionProblem
SatisfactionProblem.dfs
such that SatisfactionProblem.solve()
can be called afterwardsbuildModel
in class SatisfactionProblem
public SearchStatistics solve(boolean verbose, java.util.function.Predicate<SearchStatistics> limit)
SatisfactionProblem
SatisfactionProblem.dfs
and possibly prints each found solutionsolve
in class SatisfactionProblem
verbose
- if true, prints the number of found solutions each time a new one is foundlimit
- a predicate called at each node that stops the search when it becomes truepublic static void main(java.lang.String[] args)