java.lang.Object
org.maxicp.modeling.constraints.seqvar.Distance
- All Implemented Interfaces:
Constraint
Modeling-level distance constraint on a sequence variable (
SeqVar), maintaining the total travel
distance between consecutive visited nodes in the sequence.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDistance(SeqVar seqVar, int[][] distanceMatrix, IntExpression distance) Creates a constraint maintaining thatdistanceequals the sum of transition distances between consecutive nodes visited inseqVar. -
Method Summary
Modifier and TypeMethodDescriptionCollection<? extends Expression> scope()Returns the scope of the constraint, preferably as an immutable, unique collection.
-
Field Details
-
seqVar
-
distanceMatrix
public final int[][] distanceMatrix -
distance
-
-
Constructor Details
-
Distance
Creates a constraint maintaining thatdistanceequals the sum of transition distances between consecutive nodes visited inseqVar.- Parameters:
seqVar- the sequence variabledistanceMatrix- the distance matrix between nodes (must satisfy the triangle inequality)distance- the expression representing the total travel distance
-
-
Method Details
-
scope
Description copied from interface:ConstraintReturns the scope of the constraint, preferably as an immutable, unique collection.- Specified by:
scopein interfaceConstraint- Returns:
- the scope of the constraint, i.e. all the Expressions it uses. The collection should be immutable.
-