From 1a9aada87c520b7faf31ae71f6a7bbc4981ace28 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Tue, 3 Dec 2024 15:14:06 +0100 Subject: [PATCH] fix #4465 --- .../com/google/ortools/sat/AutomatonConstraint.java | 10 ++++++++-- .../com/google/ortools/sat/NoOverlap2dConstraint.java | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ortools/java/com/google/ortools/sat/AutomatonConstraint.java b/ortools/java/com/google/ortools/sat/AutomatonConstraint.java index 5d610fa1877..1f5d8ebb16e 100644 --- a/ortools/java/com/google/ortools/sat/AutomatonConstraint.java +++ b/ortools/java/com/google/ortools/sat/AutomatonConstraint.java @@ -25,8 +25,14 @@ public AutomatonConstraint(CpModelProto.Builder builder) { 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) diff --git a/ortools/java/com/google/ortools/sat/NoOverlap2dConstraint.java b/ortools/java/com/google/ortools/sat/NoOverlap2dConstraint.java index 4de36e45d53..9a8d90e8a66 100644 --- a/ortools/java/com/google/ortools/sat/NoOverlap2dConstraint.java +++ b/ortools/java/com/google/ortools/sat/NoOverlap2dConstraint.java @@ -19,14 +19,20 @@ /** * Specialized NoOverlap2D constraint. * - *

This constraint allows adding rectanles to the NoOverlap2D constraint incrementally. + *

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());