fix #4465
This commit is contained in:
@@ -25,8 +25,14 @@ public class AutomatonConstraint extends Constraint {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
/// Adds a transitions to the automaton.
|
||||
AutomatonConstraint addTransition(int tail, int head, long label) {
|
||||
/**
|
||||
* Adds a transitions to the automaton.
|
||||
*
|
||||
* @param head the head of the transition
|
||||
* @param label the label of the transition
|
||||
* @return this constraint
|
||||
*/
|
||||
public AutomatonConstraint addTransition(int tail, int head, long label) {
|
||||
getBuilder()
|
||||
.getAutomatonBuilder()
|
||||
.addTransitionTail(tail)
|
||||
|
||||
@@ -19,14 +19,20 @@ import com.google.ortools.sat.NoOverlap2DConstraintProto;
|
||||
/**
|
||||
* Specialized NoOverlap2D constraint.
|
||||
*
|
||||
* <p>This constraint allows adding rectanles to the NoOverlap2D constraint incrementally.
|
||||
* <p>This constraint allows adding rectangles to the NoOverlap2D constraint incrementally.
|
||||
*/
|
||||
public class NoOverlap2dConstraint extends Constraint {
|
||||
public NoOverlap2dConstraint(CpModelProto.Builder builder) {
|
||||
super(builder);
|
||||
}
|
||||
|
||||
/// Adds a rectangle (xInterval, yInterval) to the constraint.
|
||||
/**
|
||||
* Adds a rectangle (xInterval, yInterval) to the constraint.
|
||||
*
|
||||
* @param xInterval the x interval of the rectangle.
|
||||
* @param yInterval the y interval of the rectangle.
|
||||
* @return this constraint
|
||||
*/
|
||||
public NoOverlap2dConstraint addRectangle(IntervalVar xInterval, IntervalVar yInterval) {
|
||||
NoOverlap2DConstraintProto.Builder noOverlap2d = getBuilder().getNoOverlap2DBuilder();
|
||||
noOverlap2d.addXIntervals(xInterval.getIndex());
|
||||
|
||||
Reference in New Issue
Block a user