Class main
java.lang.Object
com.google.ortools.constraintsolver.main
- All Implemented Interfaces:
mainConstants
-
Field Summary
Fields inherited from interface com.google.ortools.constraintsolver.mainConstants
BOOLEAN_VAR, CONST_VAR, CST_SUB_VAR, DOMAIN_INT_VAR, OPP_VAR, TRACE_VAR, UNSPECIFIED, VAR_ADD_CST, VAR_TIMES_CST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareAllBooleans(IntVar[] vars) static booleanareAllBound(IntVar[] vars) static booleanareAllBoundTo(IntVar[] vars, long value) Returns true if all variables are assigned to 'value'.static longstatic RoutingModelParametersstatic RoutingSearchParametersstatic StringfindErrorInRoutingSearchParameters(RoutingSearchParameters search_parameters) Returns an empty std::string if the routing search parameters are valid, and
a non-empty, human readable error description if they're not.static longmaxVarArray(IntVar[] vars) static longminVarArray(IntVar[] vars) static longOne()This method returns 1static longposIntDivDown(long e, long v) static longposIntDivUp(long e, long v) static voidsetAssignmentFromAssignment(Assignment target_assignment, IntVar[] target_vars, Assignment source_assignment, IntVar[] source_vars) NOLINT
Given a "source_assignment", clears the "target_assignment" and adds
all IntVars in "target_vars", with the values of the variables set according
to the corresponding values of "source_vars" in "source_assignment".
source_vars and target_vars must have the same number of elements.
The source and target assignments can belong to different Solvers.static booleanSolveModelWithSat(RoutingModel model, RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution) Attempts to solve the model using the cp-sat solver.static longzero()NOLINT
This method returns 0.
-
Constructor Details
-
main
public main()
-
-
Method Details
-
CpRandomSeed
public static long CpRandomSeed() -
zero
public static long zero()NOLINT
This method returns 0. It is useful when 0 can be cast either as
a pointer or as an integer value and thus lead to an ambiguous
function call. -
One
public static long One()This method returns 1 -
setAssignmentFromAssignment
public static void setAssignmentFromAssignment(Assignment target_assignment, IntVar[] target_vars, Assignment source_assignment, IntVar[] source_vars) NOLINT
Given a "source_assignment", clears the "target_assignment" and adds
all IntVars in "target_vars", with the values of the variables set according
to the corresponding values of "source_vars" in "source_assignment".
source_vars and target_vars must have the same number of elements.
The source and target assignments can belong to different Solvers. -
areAllBound
-
areAllBooleans
-
areAllBoundTo
Returns true if all variables are assigned to 'value'. -
maxVarArray
-
minVarArray
-
posIntDivUp
public static long posIntDivUp(long e, long v) -
posIntDivDown
public static long posIntDivDown(long e, long v) -
defaultRoutingModelParameters
-
defaultRoutingSearchParameters
-
findErrorInRoutingSearchParameters
Returns an empty std::string if the routing search parameters are valid, and
a non-empty, human readable error description if they're not. -
SolveModelWithSat
public static boolean SolveModelWithSat(RoutingModel model, RoutingSearchParameters search_parameters, Assignment initial_solution, Assignment solution) Attempts to solve the model using the cp-sat solver. As of 5/2019, will
solve the TSP corresponding to the model if it has a single vehicle.
Therefore the resulting solution might not actually be feasible. Will return
false if a solution could not be found.
-