Class main
- java.lang.Object
-
- com.google.ortools.constraintsolver.main
-
- All Implemented Interfaces:
mainConstants
public class main extends java.lang.Object implements 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 Constructor Description main()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanareAllBooleans(IntVar[] vars)static booleanareAllBound(IntVar[] vars)static booleanareAllBoundTo(IntVar[] vars, long value)Returns true if all variables are assigned to 'value'.static longCpRandomSeed()static RoutingModelParametersdefaultRoutingModelParameters()static RoutingSearchParametersdefaultRoutingSearchParameters()static java.lang.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.
-
-
-
Method Detail
-
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
public static boolean areAllBound(IntVar[] vars)
-
areAllBooleans
public static boolean areAllBooleans(IntVar[] vars)
-
areAllBoundTo
public static boolean areAllBoundTo(IntVar[] vars, long value)
Returns true if all variables are assigned to 'value'.
-
maxVarArray
public static long maxVarArray(IntVar[] vars)
-
minVarArray
public static long minVarArray(IntVar[] vars)
-
posIntDivUp
public static long posIntDivUp(long e, long v)
-
posIntDivDown
public static long posIntDivDown(long e, long v)
-
defaultRoutingModelParameters
public static RoutingModelParameters defaultRoutingModelParameters()
-
defaultRoutingSearchParameters
public static RoutingSearchParameters defaultRoutingSearchParameters()
-
findErrorInRoutingSearchParameters
public static java.lang.String findErrorInRoutingSearchParameters(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.
-
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.
-
-