Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <constraint_solver.h>
Public Types | |
typedef AssignmentContainer< IntVar, IntVarElement > | IntContainer |
typedef AssignmentContainer< IntervalVar, IntervalVarElement > | IntervalContainer |
typedef AssignmentContainer< SequenceVar, SequenceVarElement > | SequenceContainer |
Public Member Functions | |
Assignment (Solver *solver) | |
Assignment (const Assignment *copy) | |
--— Assignment --— | |
Assignment (const Assignment &)=delete | |
This type is neither copyable nor movable. | |
Assignment & | operator= (const Assignment &)=delete |
~Assignment () override | |
void | Clear () |
bool | Empty () const |
int | Size () const |
int | NumIntVars () const |
int | NumIntervalVars () const |
int | NumSequenceVars () const |
void | Store () |
void | Restore () |
bool | Load (const std::string &filename) |
bool | Load (File *file) |
void | Load (const AssignmentProto &assignment_proto) |
if !defined(SWIG) | |
bool | Save (const std::string &filename) const |
Saves the assignment to a file. | |
bool | Save (File *file) const |
void | Save (AssignmentProto *assignment_proto) const |
void | AddObjective (IntVar *const v) |
void | AddObjectives (const std::vector< IntVar * > &vars) |
void | ClearObjective () |
int | NumObjectives () const |
IntVar * | Objective () const |
IntVar * | ObjectiveFromIndex (int index) const |
bool | HasObjective () const |
bool | HasObjectiveFromIndex (int index) const |
int64_t | ObjectiveMin () const |
int64_t | ObjectiveMax () const |
int64_t | ObjectiveValue () const |
bool | ObjectiveBound () const |
void | SetObjectiveMin (int64_t m) |
void | SetObjectiveMax (int64_t m) |
void | SetObjectiveValue (int64_t value) |
void | SetObjectiveRange (int64_t l, int64_t u) |
int64_t | ObjectiveMinFromIndex (int index) const |
int64_t | ObjectiveMaxFromIndex (int index) const |
int64_t | ObjectiveValueFromIndex (int index) const |
bool | ObjectiveBoundFromIndex (int index) const |
void | SetObjectiveMinFromIndex (int index, int64_t m) |
void | SetObjectiveMaxFromIndex (int index, int64_t m) |
void | SetObjectiveValueFromIndex (int index, int64_t value) |
void | SetObjectiveRangeFromIndex (int index, int64_t l, int64_t u) |
IntVarElement * | Add (IntVar *var) |
void | Add (const std::vector< IntVar * > &vars) |
IntVarElement * | FastAdd (IntVar *var) |
Adds without checking if variable has been previously added. | |
int64_t | Min (const IntVar *var) const |
int64_t | Max (const IntVar *var) const |
int64_t | Value (const IntVar *var) const |
bool | Bound (const IntVar *var) const |
void | SetMin (const IntVar *var, int64_t m) |
void | SetMax (const IntVar *var, int64_t m) |
void | SetRange (const IntVar *var, int64_t l, int64_t u) |
void | SetValue (const IntVar *var, int64_t value) |
IntervalVarElement * | Add (IntervalVar *var) |
--— Interval Var --— | |
void | Add (const std::vector< IntervalVar * > &vars) |
IntervalVarElement * | FastAdd (IntervalVar *var) |
Adds without checking if variable has been previously added. | |
int64_t | StartMin (const IntervalVar *var) const |
int64_t | StartMax (const IntervalVar *var) const |
int64_t | StartValue (const IntervalVar *var) const |
int64_t | DurationMin (const IntervalVar *var) const |
int64_t | DurationMax (const IntervalVar *var) const |
int64_t | DurationValue (const IntervalVar *var) const |
int64_t | EndMin (const IntervalVar *var) const |
int64_t | EndMax (const IntervalVar *var) const |
int64_t | EndValue (const IntervalVar *var) const |
int64_t | PerformedMin (const IntervalVar *var) const |
int64_t | PerformedMax (const IntervalVar *var) const |
int64_t | PerformedValue (const IntervalVar *var) const |
void | SetStartMin (const IntervalVar *var, int64_t m) |
void | SetStartMax (const IntervalVar *var, int64_t m) |
void | SetStartRange (const IntervalVar *var, int64_t mi, int64_t ma) |
void | SetStartValue (const IntervalVar *var, int64_t value) |
void | SetDurationMin (const IntervalVar *var, int64_t m) |
void | SetDurationMax (const IntervalVar *var, int64_t m) |
void | SetDurationRange (const IntervalVar *var, int64_t mi, int64_t ma) |
void | SetDurationValue (const IntervalVar *var, int64_t value) |
void | SetEndMin (const IntervalVar *var, int64_t m) |
void | SetEndMax (const IntervalVar *var, int64_t m) |
void | SetEndRange (const IntervalVar *var, int64_t mi, int64_t ma) |
void | SetEndValue (const IntervalVar *var, int64_t value) |
void | SetPerformedMin (const IntervalVar *var, int64_t m) |
void | SetPerformedMax (const IntervalVar *var, int64_t m) |
void | SetPerformedRange (const IntervalVar *var, int64_t mi, int64_t ma) |
void | SetPerformedValue (const IntervalVar *var, int64_t value) |
SequenceVarElement * | Add (SequenceVar *var) |
--— Sequence Var --— | |
void | Add (const std::vector< SequenceVar * > &vars) |
SequenceVarElement * | FastAdd (SequenceVar *var) |
Adds without checking if the variable had been previously added. | |
const std::vector< int > & | ForwardSequence (const SequenceVar *var) const |
const std::vector< int > & | BackwardSequence (const SequenceVar *var) const |
const std::vector< int > & | Unperformed (const SequenceVar *var) const |
void | SetSequence (const SequenceVar *var, const std::vector< int > &forward_sequence, const std::vector< int > &backward_sequence, const std::vector< int > &unperformed) |
void | SetForwardSequence (const SequenceVar *var, const std::vector< int > &forward_sequence) |
void | SetBackwardSequence (const SequenceVar *var, const std::vector< int > &backward_sequence) |
void | SetUnperformed (const SequenceVar *var, const std::vector< int > &unperformed) |
void | Activate (const IntVar *var) |
void | Deactivate (const IntVar *var) |
bool | Activated (const IntVar *var) const |
void | Activate (const IntervalVar *var) |
void | Deactivate (const IntervalVar *var) |
bool | Activated (const IntervalVar *var) const |
void | Activate (const SequenceVar *var) |
void | Deactivate (const SequenceVar *var) |
bool | Activated (const SequenceVar *var) const |
void | ActivateObjective () |
void | DeactivateObjective () |
bool | ActivatedObjective () const |
void | ActivateObjectiveFromIndex (int index) |
void | DeactivateObjectiveFromIndex (int index) |
bool | ActivatedObjectiveFromIndex (int index) const |
std::string | DebugString () const override |
bool | AreAllElementsBound () const |
bool | Contains (const IntVar *var) const |
bool | Contains (const IntervalVar *var) const |
bool | Contains (const SequenceVar *var) const |
void | CopyIntersection (const Assignment *assignment) |
void | Copy (const Assignment *assignment) |
const IntContainer & | IntVarContainer () const |
IntContainer * | MutableIntVarContainer () |
const IntervalContainer & | IntervalVarContainer () const |
IntervalContainer * | MutableIntervalVarContainer () |
const SequenceContainer & | SequenceVarContainer () const |
SequenceContainer * | MutableSequenceVarContainer () |
bool | operator== (const Assignment &assignment) const |
bool | operator!= (const Assignment &assignment) const |
Public Member Functions inherited from operations_research::PropagationBaseObject | |
PropagationBaseObject (Solver *const s) | |
PropagationBaseObject (const PropagationBaseObject &)=delete | |
This type is neither copyable nor movable. | |
PropagationBaseObject & | operator= (const PropagationBaseObject &)=delete |
~PropagationBaseObject () override | |
std::string | DebugString () const override |
Solver * | solver () const |
void | FreezeQueue () |
void | UnfreezeQueue () |
void | EnqueueDelayedDemon (Demon *const d) |
void | EnqueueVar (Demon *const d) |
void | ExecuteAll (const SimpleRevFIFO< Demon * > &demons) |
void | EnqueueAll (const SimpleRevFIFO< Demon * > &demons) |
void | set_action_on_fail (Solver::Action a) |
void | reset_action_on_fail () |
This method clears the failure callback. | |
void | set_variable_to_clean_on_fail (IntVar *v) |
Shortcut for variable cleaner. | |
virtual std::string | name () const |
Object naming. | |
void | set_name (absl::string_view name) |
bool | HasName () const |
Returns whether the object has been named or not. | |
virtual std::string | BaseName () const |
Returns a base name for automatic naming. | |
Public Member Functions inherited from operations_research::BaseObject | |
BaseObject () | |
BaseObject (const BaseObject &)=delete | |
This type is neither copyable nor movable. | |
BaseObject & | operator= (const BaseObject &)=delete |
virtual | ~BaseObject () |
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition at line 5432 of file constraint_solver.h.
Definition at line 5434 of file constraint_solver.h.
AssignmentContainer<IntervalVar, IntervalVarElement> operations_research::Assignment::IntervalContainer |
Definition at line 5436 of file constraint_solver.h.
AssignmentContainer<SequenceVar, SequenceVarElement> operations_research::Assignment::SequenceContainer |
Definition at line 5438 of file constraint_solver.h.
|
explicit |
Definition at line 417 of file assignment.cc.
|
explicit |
--— Assignment --—
Definition at line 410 of file assignment.cc.
|
delete |
This type is neither copyable nor movable.
|
override |
Definition at line 418 of file assignment.cc.
void operations_research::Assignment::Activate | ( | const IntervalVar * | var | ) |
Definition at line 887 of file assignment.cc.
void operations_research::Assignment::Activate | ( | const IntVar * | var | ) |
Definition at line 875 of file assignment.cc.
void operations_research::Assignment::Activate | ( | const SequenceVar * | var | ) |
Definition at line 899 of file assignment.cc.
bool operations_research::Assignment::Activated | ( | const IntervalVar * | var | ) | const |
Definition at line 895 of file assignment.cc.
bool operations_research::Assignment::Activated | ( | const IntVar * | var | ) | const |
Definition at line 883 of file assignment.cc.
bool operations_research::Assignment::Activated | ( | const SequenceVar * | var | ) | const |
Definition at line 907 of file assignment.cc.
|
inline |
Definition at line 5626 of file constraint_solver.h.
|
inline |
Definition at line 5637 of file constraint_solver.h.
|
inline |
Definition at line 5624 of file constraint_solver.h.
|
inline |
Definition at line 5627 of file constraint_solver.h.
void operations_research::Assignment::Add | ( | const std::vector< IntervalVar * > & | vars | ) |
Definition at line 692 of file assignment.cc.
void operations_research::Assignment::Add | ( | const std::vector< IntVar * > & | vars | ) |
Definition at line 644 of file assignment.cc.
void operations_research::Assignment::Add | ( | const std::vector< SequenceVar * > & | vars | ) |
Definition at line 825 of file assignment.cc.
IntervalVarElement * operations_research::Assignment::Add | ( | IntervalVar * | var | ) |
--— Interval Var --—
Definition at line 688 of file assignment.cc.
IntVarElement * operations_research::Assignment::Add | ( | IntVar * | var | ) |
Definition at line 640 of file assignment.cc.
SequenceVarElement * operations_research::Assignment::Add | ( | SequenceVar * | var | ) |
--— Sequence Var --—
Definition at line 821 of file assignment.cc.
|
inline |
Definition at line 5479 of file constraint_solver.h.
|
inline |
Objective can only set once.
Definition at line 5480 of file constraint_solver.h.
|
inline |
Definition at line 5644 of file constraint_solver.h.
const std::vector< int > & operations_research::Assignment::BackwardSequence | ( | const SequenceVar * | var | ) | const |
Definition at line 840 of file assignment.cc.
bool operations_research::Assignment::Bound | ( | const IntVar * | var | ) | const |
Definition at line 666 of file assignment.cc.
void operations_research::Assignment::Clear | ( | ) |
Definition at line 420 of file assignment.cc.
|
inline |
Definition at line 5490 of file constraint_solver.h.
bool operations_research::Assignment::Contains | ( | const IntervalVar * | var | ) | const |
Definition at line 915 of file assignment.cc.
bool operations_research::Assignment::Contains | ( | const IntVar * | var | ) | const |
Definition at line 911 of file assignment.cc.
bool operations_research::Assignment::Contains | ( | const SequenceVar * | var | ) | const |
Definition at line 919 of file assignment.cc.
void operations_research::Assignment::Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
Definition at line 940 of file assignment.cc.
void operations_research::Assignment::CopyIntersection | ( | const Assignment * | assignment | ) |
Copies the intersection of the two assignments to the current assignment.
Definition at line 923 of file assignment.cc.
void operations_research::Assignment::Deactivate | ( | const IntervalVar * | var | ) |
Definition at line 891 of file assignment.cc.
void operations_research::Assignment::Deactivate | ( | const IntVar * | var | ) |
Definition at line 879 of file assignment.cc.
void operations_research::Assignment::Deactivate | ( | const SequenceVar * | var | ) |
Definition at line 903 of file assignment.cc.
|
inline |
Definition at line 5625 of file constraint_solver.h.
|
inline |
Definition at line 5632 of file constraint_solver.h.
|
overridevirtual |
Reimplemented from operations_research::BaseObject.
Definition at line 623 of file assignment.cc.
int64_t operations_research::Assignment::DurationMax | ( | const IntervalVar * | var | ) | const |
Definition at line 718 of file assignment.cc.
int64_t operations_research::Assignment::DurationMin | ( | const IntervalVar * | var | ) | const |
Definition at line 714 of file assignment.cc.
int64_t operations_research::Assignment::DurationValue | ( | const IntervalVar * | var | ) | const |
Definition at line 722 of file assignment.cc.
|
inline |
Definition at line 5452 of file constraint_solver.h.
int64_t operations_research::Assignment::EndMax | ( | const IntervalVar * | var | ) | const |
Definition at line 730 of file assignment.cc.
int64_t operations_research::Assignment::EndMin | ( | const IntervalVar * | var | ) | const |
Definition at line 726 of file assignment.cc.
int64_t operations_research::Assignment::EndValue | ( | const IntervalVar * | var | ) | const |
Definition at line 734 of file assignment.cc.
IntervalVarElement * operations_research::Assignment::FastAdd | ( | IntervalVar * | var | ) |
Adds without checking if variable has been previously added.
Definition at line 698 of file assignment.cc.
IntVarElement * operations_research::Assignment::FastAdd | ( | IntVar * | var | ) |
Adds without checking if variable has been previously added.
Definition at line 650 of file assignment.cc.
SequenceVarElement * operations_research::Assignment::FastAdd | ( | SequenceVar * | var | ) |
Adds without checking if the variable had been previously added.
Definition at line 831 of file assignment.cc.
const std::vector< int > & operations_research::Assignment::ForwardSequence | ( | const SequenceVar * | var | ) | const |
Definition at line 835 of file assignment.cc.
|
inline |
Definition at line 5497 of file constraint_solver.h.
|
inline |
Definition at line 5498 of file constraint_solver.h.
|
inline |
Definition at line 5663 of file constraint_solver.h.
|
inline |
Definition at line 5661 of file constraint_solver.h.
void operations_research::Assignment::Load | ( | const AssignmentProto & | assignment_proto | ) |
if !defined(SWIG)
Definition at line 529 of file assignment.cc.
bool operations_research::Assignment::Load | ( | const std::string & | filename | ) |
Loads an assignment from a file; does not add variables to the assignment (only the variables contained in the assignment are modified).
Definition at line 483 of file assignment.cc.
bool operations_research::Assignment::Load | ( | File * | file | ) |
Definition at line 492 of file assignment.cc.
int64_t operations_research::Assignment::Max | ( | const IntVar * | var | ) | const |
Definition at line 658 of file assignment.cc.
int64_t operations_research::Assignment::Min | ( | const IntVar * | var | ) | const |
Definition at line 654 of file assignment.cc.
|
inline |
Definition at line 5666 of file constraint_solver.h.
|
inline |
Definition at line 5662 of file constraint_solver.h.
|
inline |
Definition at line 5672 of file constraint_solver.h.
|
inline |
Definition at line 5460 of file constraint_solver.h.
|
inline |
Definition at line 5459 of file constraint_solver.h.
|
inline |
Definition at line 5491 of file constraint_solver.h.
|
inline |
Definition at line 5461 of file constraint_solver.h.
|
inline |
Definition at line 5492 of file constraint_solver.h.
|
inline |
Definition at line 5504 of file constraint_solver.h.
|
inline |
Definition at line 5523 of file constraint_solver.h.
|
inline |
Definition at line 5493 of file constraint_solver.h.
|
inline |
Definition at line 5502 of file constraint_solver.h.
|
inline |
Definition at line 5516 of file constraint_solver.h.
|
inline |
Definition at line 5501 of file constraint_solver.h.
|
inline |
Definition at line 5513 of file constraint_solver.h.
|
inline |
Definition at line 5503 of file constraint_solver.h.
|
inline |
Definition at line 5519 of file constraint_solver.h.
|
inline |
Definition at line 5681 of file constraint_solver.h.
|
delete |
|
inline |
Definition at line 5675 of file constraint_solver.h.
int64_t operations_research::Assignment::PerformedMax | ( | const IntervalVar * | var | ) | const |
Definition at line 742 of file assignment.cc.
int64_t operations_research::Assignment::PerformedMin | ( | const IntervalVar * | var | ) | const |
Definition at line 738 of file assignment.cc.
int64_t operations_research::Assignment::PerformedValue | ( | const IntervalVar * | var | ) | const |
Definition at line 746 of file assignment.cc.
void operations_research::Assignment::Restore | ( | ) |
Definition at line 436 of file assignment.cc.
void operations_research::Assignment::Save | ( | AssignmentProto * | assignment_proto | ) | const |
Definition at line 590 of file assignment.cc.
bool operations_research::Assignment::Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
Definition at line 560 of file assignment.cc.
bool operations_research::Assignment::Save | ( | File * | file | ) | const |
Definition at line 569 of file assignment.cc.
|
inline |
Definition at line 5669 of file constraint_solver.h.
void operations_research::Assignment::SetBackwardSequence | ( | const SequenceVar * | var, |
const std::vector< int > & | backward_sequence ) |
Definition at line 864 of file assignment.cc.
void operations_research::Assignment::SetDurationMax | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 771 of file assignment.cc.
void operations_research::Assignment::SetDurationMin | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 767 of file assignment.cc.
void operations_research::Assignment::SetDurationRange | ( | const IntervalVar * | var, |
int64_t | mi, | ||
int64_t | ma ) |
Definition at line 775 of file assignment.cc.
void operations_research::Assignment::SetDurationValue | ( | const IntervalVar * | var, |
int64_t | value ) |
Definition at line 780 of file assignment.cc.
void operations_research::Assignment::SetEndMax | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 788 of file assignment.cc.
void operations_research::Assignment::SetEndMin | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 784 of file assignment.cc.
void operations_research::Assignment::SetEndRange | ( | const IntervalVar * | var, |
int64_t | mi, | ||
int64_t | ma ) |
Definition at line 792 of file assignment.cc.
void operations_research::Assignment::SetEndValue | ( | const IntervalVar * | var, |
int64_t | value ) |
Definition at line 797 of file assignment.cc.
void operations_research::Assignment::SetForwardSequence | ( | const SequenceVar * | var, |
const std::vector< int > & | forward_sequence ) |
Definition at line 858 of file assignment.cc.
void operations_research::Assignment::SetMax | ( | const IntVar * | var, |
int64_t | m ) |
Definition at line 674 of file assignment.cc.
void operations_research::Assignment::SetMin | ( | const IntVar * | var, |
int64_t | m ) |
Definition at line 670 of file assignment.cc.
|
inline |
Definition at line 5506 of file constraint_solver.h.
|
inline |
Definition at line 5532 of file constraint_solver.h.
|
inline |
Definition at line 5505 of file constraint_solver.h.
|
inline |
Definition at line 5527 of file constraint_solver.h.
|
inline |
Definition at line 5510 of file constraint_solver.h.
|
inline |
Definition at line 5542 of file constraint_solver.h.
|
inline |
Definition at line 5507 of file constraint_solver.h.
|
inline |
Definition at line 5537 of file constraint_solver.h.
void operations_research::Assignment::SetPerformedMax | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 805 of file assignment.cc.
void operations_research::Assignment::SetPerformedMin | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 801 of file assignment.cc.
void operations_research::Assignment::SetPerformedRange | ( | const IntervalVar * | var, |
int64_t | mi, | ||
int64_t | ma ) |
Definition at line 809 of file assignment.cc.
void operations_research::Assignment::SetPerformedValue | ( | const IntervalVar * | var, |
int64_t | value ) |
Definition at line 814 of file assignment.cc.
void operations_research::Assignment::SetRange | ( | const IntVar * | var, |
int64_t | l, | ||
int64_t | u ) |
Definition at line 678 of file assignment.cc.
void operations_research::Assignment::SetSequence | ( | const SequenceVar * | var, |
const std::vector< int > & | forward_sequence, | ||
const std::vector< int > & | backward_sequence, | ||
const std::vector< int > & | unperformed ) |
Definition at line 850 of file assignment.cc.
void operations_research::Assignment::SetStartMax | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 754 of file assignment.cc.
void operations_research::Assignment::SetStartMin | ( | const IntervalVar * | var, |
int64_t | m ) |
Definition at line 750 of file assignment.cc.
void operations_research::Assignment::SetStartRange | ( | const IntervalVar * | var, |
int64_t | mi, | ||
int64_t | ma ) |
Definition at line 758 of file assignment.cc.
void operations_research::Assignment::SetStartValue | ( | const IntervalVar * | var, |
int64_t | value ) |
Definition at line 763 of file assignment.cc.
void operations_research::Assignment::SetUnperformed | ( | const SequenceVar * | var, |
const std::vector< int > & | unperformed ) |
Definition at line 870 of file assignment.cc.
void operations_research::Assignment::SetValue | ( | const IntVar * | var, |
int64_t | value ) |
Definition at line 682 of file assignment.cc.
|
inline |
Definition at line 5456 of file constraint_solver.h.
int64_t operations_research::Assignment::StartMax | ( | const IntervalVar * | var | ) | const |
Definition at line 706 of file assignment.cc.
int64_t operations_research::Assignment::StartMin | ( | const IntervalVar * | var | ) | const |
Definition at line 702 of file assignment.cc.
int64_t operations_research::Assignment::StartValue | ( | const IntervalVar * | var | ) | const |
Definition at line 710 of file assignment.cc.
void operations_research::Assignment::Store | ( | ) |
Definition at line 427 of file assignment.cc.
const std::vector< int > & operations_research::Assignment::Unperformed | ( | const SequenceVar * | var | ) | const |
Definition at line 845 of file assignment.cc.
int64_t operations_research::Assignment::Value | ( | const IntVar * | var | ) | const |
Definition at line 662 of file assignment.cc.