Java Reference
Java Reference
CpSolverTest.java
Go to the documentation of this file.
281 solver.getParameters().setLogToStdout(false).setLogSearchProgress(true).setNumSearchWorkers(12);
Load native libraries needed for using ortools-java.
Definition: Loader.java:33
static synchronized void loadNativeLibraries()
Definition: Loader.java:104
Constraint addLinearExpressionInDomain(LinearArgument expr, Domain domain)
Adds.
Definition: CpModel.java:217
IntervalVar newOptionalFixedSizeIntervalVar(LinearArgument start, long size, Literal isPresent, String name)
Creates an optional interval variable from an affine expression start, and a fixed size.
Definition: CpModel.java:790
Boolean exportToFile(String file)
Write the model as a protocol buffer to 'file'.
Definition: CpModel.java:997
BoolVar newBoolVar(String name)
Creates a Boolean variable with the given name.
Definition: CpModel.java:88
void maximize(LinearArgument expr)
Adds a maximization objective of a linear expression.
Definition: CpModel.java:934
IntervalVar newFixedInterval(long start, long size, String name)
Creates a fixed interval from its start and its size.
Definition: CpModel.java:743
Constraint addMaxEquality(LinearArgument target, LinearArgument[] exprs)
Adds.
Definition: CpModel.java:608
IntVar newIntVar(long lb, long ub, String name)
Creates an integer variable with domain [lb, ub].
Definition: CpModel.java:72
void minimize(LinearArgument expr)
Adds a minimization objective of a linear expression.
Definition: CpModel.java:913
Constraint addLinearConstraint(LinearArgument expr, long lb, long ub)
Adds.
Definition: CpModel.java:236
Parent class to create a callback called at each solution.
Definition: CpSolverSolutionCallback.java:39
Tests the CpSolver java interface.
Definition: CpSolverTest.java:28
void testCpSolver_invalidModel()
Definition: CpSolverTest.java:90
void testCpModel_crashPresolve()
Definition: CpSolverTest.java:206
void testCpSolver_objectiveValue()
Definition: CpSolverTest.java:179
void testCpSolver_booleanValue()
Definition: CpSolverTest.java:137
void testCpSolver_customLogMultiThread()
Definition: CpSolverTest.java:263
void testCpSolver_customLog()
Definition: CpSolverTest.java:234
void testCpSolver_solve()
Definition: CpSolverTest.java:66
void testCpSolver_searchAllSolutions()
Definition: CpSolverTest.java:155
void testCpSolver_hinting()
Definition: CpSolverTest.java:112
double objectiveValue()
Returns the best objective value found during search.
Definition: CpSolver.java:117
long value(LinearArgument expr)
Returns the value of a linear expression in the last solution found.
Definition: CpSolver.java:130
long numBranches()
Returns the number of branches explored during search.
Definition: CpSolver.java:155
CpSolverStatus solve(CpModel model)
Solves the given model, and returns the solve status.
Definition: CpSolver.java:37
String getSolutionInfo()
Returns some information on how the solution was found, or the reason why the model or the parameters...
Definition: CpSolver.java:197
SatParameters.Builder getParameters()
Returns the builder of the parameters of the SAT solver for modification.
Definition: CpSolver.java:179
void setLogCallback(Consumer< String > cb)
Sets the log callback for the solver.
Definition: CpSolver.java:184
Boolean booleanValue(Literal var)
Returns the Boolean value of a literal in the last solution found.
Definition: CpSolver.java:140
String responseStats()
Returns some statistics on the solution found as a string.
Definition: CpSolver.java:189
CumulativeConstraint addDemands(IntervalVar[] intervals, LinearArgument[] demands)
Adds all pairs (intervals[i], demands[i]) to the constraint.
Definition: CumulativeConstraint.java:54
LinearExprBuilder addSum(LinearArgument[] exprs)
Definition: sat/LinearExprBuilder.java:49
LinearExprBuilder add(LinearArgument expr)
Definition: sat/LinearExprBuilder.java:29
LinearExprBuilder addTerm(LinearArgument expr, long coeff)
Definition: sat/LinearExprBuilder.java:39
A linear expression (sum (ai * xi) + b).
Definition: sat/LinearExpr.java:19
Interface to describe a boolean variable or its negation.
Definition: Literal.java:17