Stay organized with collections
Save and categorize content based on your preferences.
C++ Reference: class IntervalVar
Note: This documentation is automatically generated.
Method |
DebugString | Return type: std::string Returns a debug string.
|
EndExpr | Return type: LinearExpr Returns the end linear expression. Note that this rebuilds the
expression each time this method is called.
|
index | Return type: int Returns the index of the interval constraint in the model.
|
IntervalVar | A default constructed IntervalVar can be used to mean not defined yet.
However, it shouldn't be passed to any of the functions in this file.
Doing so will crash in debug mode and will result in an invalid model in
opt mode.
|
Name | Return type: std::string Returns the name of the interval (or the empty string if not set).
|
PresenceBoolVar | Return type: BoolVar |
SizeExpr | Return type: LinearExpr Returns the size linear expression. Note that this rebuilds the
expression each time this method is called.
|
StartExpr | Return type: LinearExpr Returns the start linear expression. Note that this rebuilds the
expression each time this method is called.
|
WithName | Return type: IntervalVar Arguments: const std::string& name Sets the name of the variable.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[null,null,["Last updated 2024-08-06 UTC."],[[["\u003cp\u003e\u003ccode\u003eIntervalVar\u003c/code\u003e represents an interval constraint within the CP-SAT solver, defining a period with a start, end, and size.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods to access and manipulate the start, end, and size of the interval, expressed as linear expressions.\u003c/p\u003e\n"],["\u003cp\u003eUsers can query the interval's presence, name, debug string, and index within the model.\u003c/p\u003e\n"],["\u003cp\u003eA default-constructed \u003ccode\u003eIntervalVar\u003c/code\u003e is considered undefined and should not be used in constraint creation.\u003c/p\u003e\n"]]],["The `IntervalVar` class in C++ provides methods to interact with interval constraints. Key actions include retrieving properties like the start, end, and size expressions via `StartExpr`, `EndExpr`, and `SizeExpr`. You can also get the interval's index with `index`, name with `Name`, and a debug string via `DebugString`. `WithName` sets the interval's name, and `PresenceBoolVar` to get a BoolVar. `IntervalVar` can be default constructed, but is not meant to be passed to functions.\n"],null,["# IntervalVar\n\nC++ Reference: class IntervalVar\n================================\n\n\nNote: This documentation is automatically generated.\n\n| Method ||\n|-----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [`DebugString`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L489) | Return type: `std::string ` Returns a debug string. |\n| [`EndExpr`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L469) | Return type: `LinearExpr ` Returns the end linear expression. Note that this rebuilds the expression each time this method is called. |\n| [`index`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L492) | Return type: `int ` Returns the index of the interval constraint in the model. |\n| [`IntervalVar`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L451) | A default constructed IntervalVar can be used to mean not defined yet. However, it shouldn't be passed to any of the functions in this file. Doing so will crash in debug mode and will result in an invalid model in opt mode. |\n| [`Name`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L457) | Return type: `std::string ` Returns the name of the interval (or the empty string if not set). |\n| [`PresenceBoolVar`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L476) | Return type: `BoolVar ` \u003cbr /\u003e |\n| [`SizeExpr`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L465) | Return type: `LinearExpr ` Returns the size linear expression. Note that this rebuilds the expression each time this method is called. |\n| [`StartExpr`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L461) | Return type: `LinearExpr ` Returns the start linear expression. Note that this rebuilds the expression each time this method is called. |\n| [`WithName`](https://github.com/google/or-tools/blob/v9.4/ortools/sat/cp_model.h#L454) | Return type: `IntervalVar ` Arguments: `const std::string& name` Sets the name of the variable. |"]]