All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.ortools.constraintsolver.RoutingModel Maven / Gradle / Ivy

The newest version!
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.10
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package com.google.ortools.constraintsolver;

public class RoutingModel {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected RoutingModel(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(RoutingModel obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        operations_research_constraint_solverJNI.delete_RoutingModel(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public static int getKFirstNode() {
  return operations_research_constraint_solverJNI.RoutingModel_kFirstNode_get();
}

  public static int getKInvalidNodeIndex() {
  return operations_research_constraint_solverJNI.RoutingModel_kInvalidNodeIndex_get();
}

  public static SWIGTYPE_p_RoutingDisjunctionIndex getKNoDisjunction() {
    return new SWIGTYPE_p_RoutingDisjunctionIndex(operations_research_constraint_solverJNI.RoutingModel_kNoDisjunction_get(), true);
  }

  public static SWIGTYPE_p_RoutingDimensionIndex getKNoDimension() {
    return new SWIGTYPE_p_RoutingDimensionIndex(operations_research_constraint_solverJNI.RoutingModel_kNoDimension_get(), true);
  }

  public RoutingModel(int nodes, int vehicles, int depot) {
    this(operations_research_constraint_solverJNI.new_RoutingModel__SWIG_0(nodes, vehicles, depot), true);
  }

  public RoutingModel(int nodes, int vehicles, int depot, com.google.ortools.constraintsolver.RoutingModelParameters parameters) {
    this(operations_research_constraint_solverJNI.new_RoutingModel__SWIG_1(nodes, vehicles, depot, parameters.toByteArray()), true);
  }

  public RoutingModel(int nodes, int vehicles, SWIGTYPE_p_std__vectorT_std__pairT_RoutingNodeIndex_RoutingNodeIndex_t_t start_end, com.google.ortools.constraintsolver.RoutingModelParameters parameters) {
    this(operations_research_constraint_solverJNI.new_RoutingModel__SWIG_2(nodes, vehicles, SWIGTYPE_p_std__vectorT_std__pairT_RoutingNodeIndex_RoutingNodeIndex_t_t.getCPtr(start_end), parameters.toByteArray()), true);
  }

  public RoutingModel(int nodes, int vehicles, int[] starts, int[] ends) {
    this(operations_research_constraint_solverJNI.new_RoutingModel__SWIG_3(nodes, vehicles, starts, ends), true);
  }

  public RoutingModel(int nodes, int vehicles, int[] starts, int[] ends, com.google.ortools.constraintsolver.RoutingModelParameters parameters) {
    this(operations_research_constraint_solverJNI.new_RoutingModel__SWIG_4(nodes, vehicles, starts, ends, parameters.toByteArray()), true);
  }

  public static com.google.ortools.constraintsolver.RoutingModelParameters defaultModelParameters() {
  byte[] buf = operations_research_constraint_solverJNI.RoutingModel_defaultModelParameters();
  if (buf == null || buf.length == 0) {
    return null;
  }
  try {
    return com.google.ortools.constraintsolver.RoutingModelParameters.parseFrom(buf);
  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    throw new RuntimeException(
        "Unable to parse com.google.ortools.constraintsolver.RoutingModelParameters protocol message.");
  }
}

  public static com.google.ortools.constraintsolver.RoutingSearchParameters defaultSearchParameters() {
  byte[] buf = operations_research_constraint_solverJNI.RoutingModel_defaultSearchParameters();
  if (buf == null || buf.length == 0) {
    return null;
  }
  try {
    return com.google.ortools.constraintsolver.RoutingSearchParameters.parseFrom(buf);
  } catch (com.google.protobuf.InvalidProtocolBufferException e) {
    throw new RuntimeException(
        "Unable to parse com.google.ortools.constraintsolver.RoutingSearchParameters protocol message.");
  }
}

  public boolean addDimension(NodeEvaluator2 evaluator, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addDimension(swigCPtr, this, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(evaluator.getPermanentCallback()), evaluator, slack_max, capacity, fix_start_cumul_to_zero, name);
  }

  public boolean addDimensionWithVehicleTransits(NodeEvaluator2[] evaluators, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addDimensionWithVehicleTransits(swigCPtr, this, evaluators, slack_max, capacity, fix_start_cumul_to_zero, name);
  }

  public boolean addDimensionWithVehicleCapacity(NodeEvaluator2 evaluator, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addDimensionWithVehicleCapacity(swigCPtr, this, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(evaluator.getPermanentCallback()), evaluator, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name);
  }

  public boolean addDimensionWithVehicleTransitAndCapacity(NodeEvaluator2[] evaluators, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addDimensionWithVehicleTransitAndCapacity(swigCPtr, this, evaluators, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name);
  }

  public boolean AddConstantDimensionWithSlack(long value, long capacity, long slack_max, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_AddConstantDimensionWithSlack(swigCPtr, this, value, capacity, slack_max, fix_start_cumul_to_zero, name);
  }

  public boolean addConstantDimension(long value, long capacity, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addConstantDimension(swigCPtr, this, value, capacity, fix_start_cumul_to_zero, name);
  }

  public boolean addVectorDimension(long[] values, long capacity, boolean fix_start_cumul_to_zero, String name) {
    return operations_research_constraint_solverJNI.RoutingModel_addVectorDimension(swigCPtr, this, values, capacity, fix_start_cumul_to_zero, name);
  }

  public SWIGTYPE_p_std__vectorT_std__string_t GetAllDimensionNames() {
    return new SWIGTYPE_p_std__vectorT_std__string_t(operations_research_constraint_solverJNI.RoutingModel_GetAllDimensionNames(swigCPtr, this), true);
  }

  public boolean HasDimension(String dimension_name) {
    return operations_research_constraint_solverJNI.RoutingModel_HasDimension(swigCPtr, this, dimension_name);
  }

  public RoutingDimension getDimensionOrDie(String dimension_name) {
    return new RoutingDimension(operations_research_constraint_solverJNI.RoutingModel_getDimensionOrDie(swigCPtr, this, dimension_name), false);
  }

  public RoutingDimension getMutableDimension(String dimension_name) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_getMutableDimension(swigCPtr, this, dimension_name);
    return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
  }

  public void SetPrimaryConstrainedDimension(String dimension_name) {
    operations_research_constraint_solverJNI.RoutingModel_SetPrimaryConstrainedDimension(swigCPtr, this, dimension_name);
  }

  public String GetPrimaryConstrainedDimension() {
    return operations_research_constraint_solverJNI.RoutingModel_GetPrimaryConstrainedDimension(swigCPtr, this);
  }

  public void addAllActive() {
    operations_research_constraint_solverJNI.RoutingModel_addAllActive(swigCPtr, this);
  }

  public void addDisjunction(int[] nodes) {
    operations_research_constraint_solverJNI.RoutingModel_addDisjunction__SWIG_0(swigCPtr, this, nodes);
  }

  public void addDisjunction(int[] nodes, long penalty) {
    operations_research_constraint_solverJNI.RoutingModel_addDisjunction__SWIG_1(swigCPtr, this, nodes, penalty);
  }

  public void addDisjunction(int[] nodes, long penalty, long max_cardinality) {
    operations_research_constraint_solverJNI.RoutingModel_addDisjunction__SWIG_2(swigCPtr, this, nodes, penalty, max_cardinality);
  }

  public SWIGTYPE_p_std__vectorT_RoutingDisjunctionIndex_t GetDisjunctionIndicesFromNode(int node) {
    return new SWIGTYPE_p_std__vectorT_RoutingDisjunctionIndex_t(operations_research_constraint_solverJNI.RoutingModel_GetDisjunctionIndicesFromNode(swigCPtr, this, node), false);
  }

  public SWIGTYPE_p_std__vectorT_RoutingDisjunctionIndex_t GetDisjunctionIndicesFromVariableIndex(long index) {
    return new SWIGTYPE_p_std__vectorT_RoutingDisjunctionIndex_t(operations_research_constraint_solverJNI.RoutingModel_GetDisjunctionIndicesFromVariableIndex(swigCPtr, this, index), false);
  }

  public int[] GetDisjunctionIndices(SWIGTYPE_p_RoutingDisjunctionIndex index) {
  return operations_research_constraint_solverJNI.RoutingModel_GetDisjunctionIndices(swigCPtr, this, SWIGTYPE_p_RoutingDisjunctionIndex.getCPtr(index));
}

  public long GetDisjunctionPenalty(SWIGTYPE_p_RoutingDisjunctionIndex index) {
    return operations_research_constraint_solverJNI.RoutingModel_GetDisjunctionPenalty(swigCPtr, this, SWIGTYPE_p_RoutingDisjunctionIndex.getCPtr(index));
  }

  public long GetDisjunctionMaxCardinality(SWIGTYPE_p_RoutingDisjunctionIndex index) {
    return operations_research_constraint_solverJNI.RoutingModel_GetDisjunctionMaxCardinality(swigCPtr, this, SWIGTYPE_p_RoutingDisjunctionIndex.getCPtr(index));
  }

  public int GetNumberOfDisjunctions() {
    return operations_research_constraint_solverJNI.RoutingModel_GetNumberOfDisjunctions(swigCPtr, this);
  }

  public SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t GetPerfectBinaryDisjunctions() {
    return new SWIGTYPE_p_std__vectorT_std__pairT_int_int_t_t(operations_research_constraint_solverJNI.RoutingModel_GetPerfectBinaryDisjunctions(swigCPtr, this), true);
  }

  public void IgnoreDisjunctionsAlreadyForcedToZero() {
    operations_research_constraint_solverJNI.RoutingModel_IgnoreDisjunctionsAlreadyForcedToZero(swigCPtr, this);
  }

  public void AddSoftSameVehicleConstraint(int[] nodes, long cost) {
    operations_research_constraint_solverJNI.RoutingModel_AddSoftSameVehicleConstraint(swigCPtr, this, nodes, cost);
  }

  public void AddPickupAndDelivery(int node1, int node2) {
    operations_research_constraint_solverJNI.RoutingModel_AddPickupAndDelivery(swigCPtr, this, node1, node2);
  }

  public long UnperformedPenalty(long var_index) {
    return operations_research_constraint_solverJNI.RoutingModel_UnperformedPenalty(swigCPtr, this, var_index);
  }

  public long UnperformedPenaltyOrValue(long default_value, long var_index) {
    return operations_research_constraint_solverJNI.RoutingModel_UnperformedPenaltyOrValue(swigCPtr, this, default_value, var_index);
  }

  public long GetDepot() {
    return operations_research_constraint_solverJNI.RoutingModel_GetDepot(swigCPtr, this);
  }

  public void setArcCostEvaluatorOfAllVehicles(NodeEvaluator2 evaluator) {
    operations_research_constraint_solverJNI.RoutingModel_setArcCostEvaluatorOfAllVehicles(swigCPtr, this, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(evaluator.getPermanentCallback()), evaluator);
  }

  public void setArcCostEvaluatorOfVehicle(NodeEvaluator2 evaluator, int vehicle) {
    operations_research_constraint_solverJNI.RoutingModel_setArcCostEvaluatorOfVehicle(swigCPtr, this, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(evaluator.getPermanentCallback()), evaluator, vehicle);
  }

  public void SetFixedCostOfAllVehicles(long cost) {
    operations_research_constraint_solverJNI.RoutingModel_SetFixedCostOfAllVehicles(swigCPtr, this, cost);
  }

  public void SetFixedCostOfVehicle(long cost, int vehicle) {
    operations_research_constraint_solverJNI.RoutingModel_SetFixedCostOfVehicle(swigCPtr, this, cost, vehicle);
  }

  public long GetFixedCostOfVehicle(int vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_GetFixedCostOfVehicle(swigCPtr, this, vehicle);
  }

  public void setFirstSolutionEvaluator(LongLongToLong evaluator) {
    operations_research_constraint_solverJNI.RoutingModel_setFirstSolutionEvaluator(swigCPtr, this, evaluator);
  }

  public void addLocalSearchOperator(LocalSearchOperator ls_operator) {
    operations_research_constraint_solverJNI.RoutingModel_addLocalSearchOperator(swigCPtr, this, LocalSearchOperator.getCPtr(ls_operator), ls_operator);
  }

  public void addSearchMonitor(SearchMonitor monitor) {
    operations_research_constraint_solverJNI.RoutingModel_addSearchMonitor(swigCPtr, this, SearchMonitor.getCPtr(monitor), monitor);
  }

  public void AddAtSolutionCallback(VoidToVoid callback) {
    operations_research_constraint_solverJNI.RoutingModel_AddAtSolutionCallback(swigCPtr, this, callback);
  }

  public void AddVariableMinimizedByFinalizer(IntVar var) {
    operations_research_constraint_solverJNI.RoutingModel_AddVariableMinimizedByFinalizer(swigCPtr, this, IntVar.getCPtr(var), var);
  }

  public void AddVariableMaximizedByFinalizer(IntVar var) {
    operations_research_constraint_solverJNI.RoutingModel_AddVariableMaximizedByFinalizer(swigCPtr, this, IntVar.getCPtr(var), var);
  }

  public void closeModel() {
    operations_research_constraint_solverJNI.RoutingModel_closeModel(swigCPtr, this);
  }

  public void CloseModelWithParameters(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    operations_research_constraint_solverJNI.RoutingModel_CloseModelWithParameters(swigCPtr, this, search_parameters.toByteArray());
  }

  public Assignment solve(Assignment assignment) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_solve__SWIG_0(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment solve() {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_solve__SWIG_1(swigCPtr, this);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment solveWithParameters(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_solveWithParameters(swigCPtr, this, search_parameters.toByteArray());
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment solveFromAssignmentWithParameters(Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_solveFromAssignmentWithParameters(swigCPtr, this, Assignment.getCPtr(assignment), assignment, search_parameters.toByteArray());
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public long ComputeLowerBound() {
    return operations_research_constraint_solverJNI.RoutingModel_ComputeLowerBound(swigCPtr, this);
  }

  public int status() {
    return operations_research_constraint_solverJNI.RoutingModel_status(swigCPtr, this);
  }

  public IntVar applyLocks(int[] locks) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_applyLocks(swigCPtr, this, locks);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public boolean ApplyLocksToAllVehicles(int[][] locks, boolean close_routes) {
    return operations_research_constraint_solverJNI.RoutingModel_ApplyLocksToAllVehicles(swigCPtr, this, locks, close_routes);
  }

  public Assignment preAssignment() {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_preAssignment(swigCPtr, this);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment MutablePreAssignment() {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_MutablePreAssignment(swigCPtr, this);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public boolean writeAssignment(String file_name) {
    return operations_research_constraint_solverJNI.RoutingModel_writeAssignment(swigCPtr, this, file_name);
  }

  public Assignment readAssignment(String file_name) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_readAssignment(swigCPtr, this, file_name);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment RestoreAssignment(Assignment solution) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_RestoreAssignment(swigCPtr, this, Assignment.getCPtr(solution), solution);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment ReadAssignmentFromRoutes(int[][] routes, boolean ignore_inactive_nodes) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_ReadAssignmentFromRoutes(swigCPtr, this, routes, ignore_inactive_nodes);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public boolean routesToAssignment(int[][] routes, boolean ignore_inactive_nodes, boolean close_routes, Assignment assignment) {
    return operations_research_constraint_solverJNI.RoutingModel_routesToAssignment(swigCPtr, this, routes, ignore_inactive_nodes, close_routes, Assignment.getCPtr(assignment), assignment);
  }

  public void AssignmentToRoutes(Assignment assignment, SWIGTYPE_p_std__vectorT_std__vectorT_RoutingNodeIndex_t_t routes) {
    operations_research_constraint_solverJNI.RoutingModel_AssignmentToRoutes(swigCPtr, this, Assignment.getCPtr(assignment), assignment, SWIGTYPE_p_std__vectorT_std__vectorT_RoutingNodeIndex_t_t.getCPtr(routes));
  }

  public Assignment compactAssignment(Assignment assignment) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_compactAssignment(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public Assignment CompactAndCheckAssignment(Assignment assignment) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_CompactAndCheckAssignment(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
    return (cPtr == 0) ? null : new Assignment(cPtr, false);
  }

  public void addToAssignment(IntVar var) {
    operations_research_constraint_solverJNI.RoutingModel_addToAssignment(swigCPtr, this, IntVar.getCPtr(var), var);
  }

  public void AddIntervalToAssignment(IntervalVar interval) {
    operations_research_constraint_solverJNI.RoutingModel_AddIntervalToAssignment(swigCPtr, this, IntervalVar.getCPtr(interval), interval);
  }

  public void AddLocalSearchFilter(LocalSearchFilter filter) {
    operations_research_constraint_solverJNI.RoutingModel_AddLocalSearchFilter(swigCPtr, this, LocalSearchFilter.getCPtr(filter), filter);
  }

  public long start(int vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_start(swigCPtr, this, vehicle);
  }

  public long end(int vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_end(swigCPtr, this, vehicle);
  }

  public boolean isStart(long index) {
    return operations_research_constraint_solverJNI.RoutingModel_isStart(swigCPtr, this, index);
  }

  public boolean isEnd(long index) {
    return operations_research_constraint_solverJNI.RoutingModel_isEnd(swigCPtr, this, index);
  }

  public long next(Assignment assignment, long index) {
    return operations_research_constraint_solverJNI.RoutingModel_next(swigCPtr, this, Assignment.getCPtr(assignment), assignment, index);
  }

  public boolean isVehicleUsed(Assignment assignment, int vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_isVehicleUsed(swigCPtr, this, Assignment.getCPtr(assignment), assignment, vehicle);
  }

  public IntVar[] nexts() {
  return operations_research_constraint_solverJNI.RoutingModel_nexts(swigCPtr, this);
}

  public IntVar[] vehicleVars() {
  return operations_research_constraint_solverJNI.RoutingModel_vehicleVars(swigCPtr, this);
}

  public IntVar nextVar(long index) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_nextVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar activeVar(long index) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_activeVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar vehicleVar(long index) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_vehicleVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar costVar() {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_costVar(swigCPtr, this);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public long getArcCostForVehicle(long from_index, long to_index, long vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_getArcCostForVehicle(swigCPtr, this, from_index, to_index, vehicle);
  }

  public boolean CostsAreHomogeneousAcrossVehicles() {
    return operations_research_constraint_solverJNI.RoutingModel_CostsAreHomogeneousAcrossVehicles(swigCPtr, this);
  }

  public long GetHomogeneousCost(long from_index, long to_index) {
    return operations_research_constraint_solverJNI.RoutingModel_GetHomogeneousCost(swigCPtr, this, from_index, to_index);
  }

  public long GetArcCostForFirstSolution(long from_index, long to_index) {
    return operations_research_constraint_solverJNI.RoutingModel_GetArcCostForFirstSolution(swigCPtr, this, from_index, to_index);
  }

  public long GetArcCostForClass(long from_index, long to_index, long cost_class_index) {
    return operations_research_constraint_solverJNI.RoutingModel_GetArcCostForClass(swigCPtr, this, from_index, to_index, cost_class_index);
  }

  public SWIGTYPE_p_RoutingCostClassIndex GetCostClassIndexOfVehicle(long vehicle) {
    return new SWIGTYPE_p_RoutingCostClassIndex(operations_research_constraint_solverJNI.RoutingModel_GetCostClassIndexOfVehicle(swigCPtr, this, vehicle), true);
  }

  public int GetCostClassesCount() {
    return operations_research_constraint_solverJNI.RoutingModel_GetCostClassesCount(swigCPtr, this);
  }

  public int GetNonZeroCostClassesCount() {
    return operations_research_constraint_solverJNI.RoutingModel_GetNonZeroCostClassesCount(swigCPtr, this);
  }

  public SWIGTYPE_p_RoutingVehicleClassIndex GetVehicleClassIndexOfVehicle(long vehicle) {
    return new SWIGTYPE_p_RoutingVehicleClassIndex(operations_research_constraint_solverJNI.RoutingModel_GetVehicleClassIndexOfVehicle(swigCPtr, this, vehicle), true);
  }

  public int GetVehicleClassesCount() {
    return operations_research_constraint_solverJNI.RoutingModel_GetVehicleClassesCount(swigCPtr, this);
  }

  public int[] GetSameVehicleIndicesOfIndex(int node) {
  return operations_research_constraint_solverJNI.RoutingModel_GetSameVehicleIndicesOfIndex(swigCPtr, this, node);
}

  public boolean ArcIsMoreConstrainedThanArc(long from, long to1, long to2) {
    return operations_research_constraint_solverJNI.RoutingModel_ArcIsMoreConstrainedThanArc(swigCPtr, this, from, to1, to2);
  }

  public String DebugOutputAssignment(Assignment solution_assignment, String dimension_to_print) {
    return operations_research_constraint_solverJNI.RoutingModel_DebugOutputAssignment(swigCPtr, this, Assignment.getCPtr(solution_assignment), solution_assignment, dimension_to_print);
  }

  public Solver solver() {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_solver(swigCPtr, this);
    return (cPtr == 0) ? null : new Solver(cPtr, false);
  }

  public int nodes() {
    return operations_research_constraint_solverJNI.RoutingModel_nodes(swigCPtr, this);
  }

  public int vehicles() {
    return operations_research_constraint_solverJNI.RoutingModel_vehicles(swigCPtr, this);
  }

  public long size() {
    return operations_research_constraint_solverJNI.RoutingModel_size(swigCPtr, this);
  }

  public int IndexToNode(long index) {
  return operations_research_constraint_solverJNI.RoutingModel_IndexToNode(swigCPtr, this, index);
}

  public long NodeToIndex(int node) {
    return operations_research_constraint_solverJNI.RoutingModel_NodeToIndex(swigCPtr, this, node);
  }

  public boolean HasIndex(int node) {
    return operations_research_constraint_solverJNI.RoutingModel_HasIndex(swigCPtr, this, node);
  }

  public long GetNumberOfDecisionsInFirstSolution(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    return operations_research_constraint_solverJNI.RoutingModel_GetNumberOfDecisionsInFirstSolution(swigCPtr, this, search_parameters.toByteArray());
  }

  public long GetNumberOfRejectsInFirstSolution(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
    return operations_research_constraint_solverJNI.RoutingModel_GetNumberOfRejectsInFirstSolution(swigCPtr, this, search_parameters.toByteArray());
  }

  public static void InitializeBuilders(Solver solver) {
    operations_research_constraint_solverJNI.RoutingModel_InitializeBuilders(Solver.getCPtr(solver), solver);
  }

  public void setCost(NodeEvaluator2 e) {
    operations_research_constraint_solverJNI.RoutingModel_setCost(swigCPtr, this, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(e.getPermanentCallback()), e);
  }

  public void setVehicleCost(int v, NodeEvaluator2 e) {
    operations_research_constraint_solverJNI.RoutingModel_setVehicleCost(swigCPtr, this, v, SWIGTYPE_p_ResultCallback2T_long_long_RoutingNodeIndex_RoutingNodeIndex_t.getCPtr(e.getPermanentCallback()), e);
  }

  public long GetRouteFixedCost() {
    return operations_research_constraint_solverJNI.RoutingModel_GetRouteFixedCost(swigCPtr, this);
  }

  public void SetRouteFixedCost(long c) {
    operations_research_constraint_solverJNI.RoutingModel_SetRouteFixedCost(swigCPtr, this, c);
  }

  public long GetVehicleFixedCost(int v) {
    return operations_research_constraint_solverJNI.RoutingModel_GetVehicleFixedCost(swigCPtr, this, v);
  }

  public void SetVehicleFixedCost(int v, long c) {
    operations_research_constraint_solverJNI.RoutingModel_SetVehicleFixedCost(swigCPtr, this, v, c);
  }

  public boolean homogeneous_costs() {
    return operations_research_constraint_solverJNI.RoutingModel_homogeneous_costs(swigCPtr, this);
  }

  public int GetVehicleCostCount() {
    return operations_research_constraint_solverJNI.RoutingModel_GetVehicleCostCount(swigCPtr, this);
  }

  public long GetCost(long i, long j, long v) {
    return operations_research_constraint_solverJNI.RoutingModel_GetCost(swigCPtr, this, i, j, v);
  }

  public long GetVehicleClassCost(long i, long j, long c) {
    return operations_research_constraint_solverJNI.RoutingModel_GetVehicleClassCost(swigCPtr, this, i, j, c);
  }

  public void setDimensionTransitCost(String d, long c) {
    operations_research_constraint_solverJNI.RoutingModel_setDimensionTransitCost(swigCPtr, this, d, c);
  }

  public long getDimensionTransitCost(String d) {
    return operations_research_constraint_solverJNI.RoutingModel_getDimensionTransitCost(swigCPtr, this, d);
  }

  public void setDimensionSpanCost(String d, long c) {
    operations_research_constraint_solverJNI.RoutingModel_setDimensionSpanCost(swigCPtr, this, d, c);
  }

  public long getDimensionSpanCost(String d) {
    return operations_research_constraint_solverJNI.RoutingModel_getDimensionSpanCost(swigCPtr, this, d);
  }

  public long GetTransitValue(String d, long from, long to, long vehicle) {
    return operations_research_constraint_solverJNI.RoutingModel_GetTransitValue(swigCPtr, this, d, from, to, vehicle);
  }

  public IntVar cumulVar(long index, String dimension_name) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_cumulVar(swigCPtr, this, index, dimension_name);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar transitVar(long index, String dimension_name) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_transitVar(swigCPtr, this, index, dimension_name);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar slackVar(long index, String dimension_name) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_slackVar(swigCPtr, this, index, dimension_name);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public void setCumulVarSoftUpperBound(int arg0, String arg1, long arg2, long arg3) {
    operations_research_constraint_solverJNI.RoutingModel_setCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1, arg2, arg3);
  }

  public boolean HasCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_HasCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long getCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_getCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long getCumulVarSoftUpperBoundCoefficient(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_getCumulVarSoftUpperBoundCoefficient(swigCPtr, this, arg0, arg1);
  }

  public void SetStartCumulVarSoftUpperBound(int arg0, String arg1, long arg2, long arg3) {
    operations_research_constraint_solverJNI.RoutingModel_SetStartCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1, arg2, arg3);
  }

  public boolean HasStartCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_HasStartCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long GetStartCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_GetStartCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long GetStartCumulVarSoftUpperBoundCoefficient(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_GetStartCumulVarSoftUpperBoundCoefficient(swigCPtr, this, arg0, arg1);
  }

  public void SetEndCumulVarSoftUpperBound(int arg0, String arg1, long arg2, long arg3) {
    operations_research_constraint_solverJNI.RoutingModel_SetEndCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1, arg2, arg3);
  }

  public boolean HasEndCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_HasEndCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long GetEndCumulVarSoftUpperBound(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_GetEndCumulVarSoftUpperBound(swigCPtr, this, arg0, arg1);
  }

  public long GetEndCumulVarSoftUpperBoundCoefficient(int arg0, String arg1) {
    return operations_research_constraint_solverJNI.RoutingModel_GetEndCumulVarSoftUpperBoundCoefficient(swigCPtr, this, arg0, arg1);
  }

  public DecisionBuilder MakeGuidedSlackFinalizer(RoutingDimension dimension, LongToLong initializer) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_MakeGuidedSlackFinalizer(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension, initializer);
    return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
  }

  public DecisionBuilder MakeSelfDependentDimensionFinalizer(RoutingDimension dimension) {
    long cPtr = operations_research_constraint_solverJNI.RoutingModel_MakeSelfDependentDimensionFinalizer(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension);
    return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
  }

  public void addMatrixDimension(long[][] values, long capacity, boolean fix_start_cumul_to_zero, String name) {
    operations_research_constraint_solverJNI.RoutingModel_addMatrixDimension(swigCPtr, this, values, capacity, fix_start_cumul_to_zero, name);
  }

  // Status 
  public final static int ROUTING_NOT_SOLVED = operations_research_constraint_solverJNI.RoutingModel_ROUTING_NOT_SOLVED_get();
  public final static int ROUTING_SUCCESS = operations_research_constraint_solverJNI.RoutingModel_ROUTING_SUCCESS_get();
  public final static int ROUTING_FAIL = operations_research_constraint_solverJNI.RoutingModel_ROUTING_FAIL_get();
  public final static int ROUTING_FAIL_TIMEOUT = operations_research_constraint_solverJNI.RoutingModel_ROUTING_FAIL_TIMEOUT_get();
  public final static int ROUTING_INVALID = operations_research_constraint_solverJNI.RoutingModel_ROUTING_INVALID_get();

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy