This commit is contained in:
Laurent Perron
2024-12-03 15:14:06 +01:00
parent 6305c434e9
commit 1a9aada87c
2 changed files with 16 additions and 4 deletions

View File

@@ -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)

View File

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