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

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

The newest version!
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 3.0.12
 *
 * 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;

// Used to wrap std::function group_delay
// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
import java.util.function.LongBinaryOperator;

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

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

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

  protected void finalize() {
    delete();
  }

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

  public RoutingModel model() {
    long cPtr = mainJNI.RoutingDimension_model(swigCPtr, this);
    return (cPtr == 0) ? null : new RoutingModel(cPtr, false);
  }

  public long getTransitValue(long from_index, long to_index, long vehicle) {
    return mainJNI.RoutingDimension_getTransitValue(swigCPtr, this, from_index, to_index, vehicle);
  }

  public long getTransitValueFromClass(long from_index, long to_index, long vehicle_class) {
    return mainJNI.RoutingDimension_getTransitValueFromClass(swigCPtr, this, from_index, to_index, vehicle_class);
  }

  public IntVar cumulVar(long index) {
    long cPtr = mainJNI.RoutingDimension_cumulVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar transitVar(long index) {
    long cPtr = mainJNI.RoutingDimension_transitVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar fixedTransitVar(long index) {
    long cPtr = mainJNI.RoutingDimension_fixedTransitVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar slackVar(long index) {
    long cPtr = mainJNI.RoutingDimension_slackVar(swigCPtr, this, index);
    return (cPtr == 0) ? null : new IntVar(cPtr, false);
  }

  public IntVar[] cumuls() {
  return mainJNI.RoutingDimension_cumuls(swigCPtr, this);
}

  public IntVar[] fixed_transits() {
  return mainJNI.RoutingDimension_fixed_transits(swigCPtr, this);
}

  public IntVar[] transits() {
  return mainJNI.RoutingDimension_transits(swigCPtr, this);
}

  public IntVar[] slacks() {
  return mainJNI.RoutingDimension_slacks(swigCPtr, this);
}

  public void setSpanUpperBoundForVehicle(long upper_bound, int vehicle) {
    mainJNI.RoutingDimension_setSpanUpperBoundForVehicle(swigCPtr, this, upper_bound, vehicle);
  }

  public void setSpanCostCoefficientForVehicle(long coefficient, int vehicle) {
    mainJNI.RoutingDimension_setSpanCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
  }

  public void setSpanCostCoefficientForAllVehicles(long coefficient) {
    mainJNI.RoutingDimension_setSpanCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
  }

  public void setGlobalSpanCostCoefficient(long coefficient) {
    mainJNI.RoutingDimension_setGlobalSpanCostCoefficient(swigCPtr, this, coefficient);
  }

  public void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient) {
    mainJNI.RoutingDimension_setCumulVarSoftUpperBound(swigCPtr, this, index, upper_bound, coefficient);
  }

  public boolean hasCumulVarSoftUpperBound(long index) {
    return mainJNI.RoutingDimension_hasCumulVarSoftUpperBound(swigCPtr, this, index);
  }

  public long getCumulVarSoftUpperBound(long index) {
    return mainJNI.RoutingDimension_getCumulVarSoftUpperBound(swigCPtr, this, index);
  }

  public long getCumulVarSoftUpperBoundCoefficient(long index) {
    return mainJNI.RoutingDimension_getCumulVarSoftUpperBoundCoefficient(swigCPtr, this, index);
  }

  public void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient) {
    mainJNI.RoutingDimension_setCumulVarSoftLowerBound(swigCPtr, this, index, lower_bound, coefficient);
  }

  public boolean hasCumulVarSoftLowerBound(long index) {
    return mainJNI.RoutingDimension_hasCumulVarSoftLowerBound(swigCPtr, this, index);
  }

  public long getCumulVarSoftLowerBound(long index) {
    return mainJNI.RoutingDimension_getCumulVarSoftLowerBound(swigCPtr, this, index);
  }

  public long getCumulVarSoftLowerBoundCoefficient(long index) {
    return mainJNI.RoutingDimension_getCumulVarSoftLowerBoundCoefficient(swigCPtr, this, index);
  }

  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator) {
    mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_0(swigCPtr, this, breaks, vehicle, pre_travel_evaluator, post_travel_evaluator);
  }

  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits) {
    mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_1(swigCPtr, this, breaks, vehicle, node_visit_transits);
  }

  public void SetBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle) {
    mainJNI.RoutingDimension_SetBreakDistanceDurationOfVehicle(swigCPtr, this, distance, duration, vehicle);
  }

  public void InitializeBreaks() {
    mainJNI.RoutingDimension_InitializeBreaks(swigCPtr, this);
  }

  public boolean HasBreakConstraints() {
    return mainJNI.RoutingDimension_HasBreakConstraints(swigCPtr, this);
  }

  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator group_delays) {
    mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_2(swigCPtr, this, breaks, vehicle, node_visit_transits, group_delays);
  }

  public IntervalVar[] getBreakIntervalsOfVehicle(int vehicle) {
  return mainJNI.RoutingDimension_getBreakIntervalsOfVehicle(swigCPtr, this, vehicle);
}

  public int GetPreTravelEvaluatorOfVehicle(int vehicle) {
    return mainJNI.RoutingDimension_GetPreTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
  }

  public int GetPostTravelEvaluatorOfVehicle(int vehicle) {
    return mainJNI.RoutingDimension_GetPostTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
  }

  public RoutingDimension base_dimension() {
    long cPtr = mainJNI.RoutingDimension_base_dimension(swigCPtr, this);
    return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
  }

  public long shortestTransitionSlack(long node) {
    return mainJNI.RoutingDimension_shortestTransitionSlack(swigCPtr, this, node);
  }

  public String name() {
    return mainJNI.RoutingDimension_name(swigCPtr, this);
  }

  public void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index) {
    mainJNI.RoutingDimension_setPickupToDeliveryLimitFunctionForPair(swigCPtr, this, limit_function, pair_index);
  }

  public boolean hasPickupToDeliveryLimits() {
    return mainJNI.RoutingDimension_hasPickupToDeliveryLimits(swigCPtr, this);
  }

  public void addNodePrecedence(long first_node, long second_node, long offset) {
    mainJNI.RoutingDimension_addNodePrecedence(swigCPtr, this, first_node, second_node, offset);
  }

  public long getSpanUpperBoundForVehicle(int vehicle) {
    return mainJNI.RoutingDimension_getSpanUpperBoundForVehicle(swigCPtr, this, vehicle);
  }

  public long getSpanCostCoefficientForVehicle(int vehicle) {
    return mainJNI.RoutingDimension_getSpanCostCoefficientForVehicle(swigCPtr, this, vehicle);
  }

  public long getGlobalSpanCostCoefficient() {
    return mainJNI.RoutingDimension_getGlobalSpanCostCoefficient(swigCPtr, this);
  }

  public long GetGlobalOptimizerOffset() {
    return mainJNI.RoutingDimension_GetGlobalOptimizerOffset(swigCPtr, this);
  }

  public long GetLocalOptimizerOffsetForVehicle(int vehicle) {
    return mainJNI.RoutingDimension_GetLocalOptimizerOffsetForVehicle(swigCPtr, this, vehicle);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy