![]() |
OR-Tools
9.6
|
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition at line 5171 of file 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 *const s) | |
| Assignment (const Assignment *const copy) | |
| ~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) |
| Loads an assignment from a file; does not add variables to the assignment (only the variables contained in the assignment are modified). More... | |
| bool | Load (File *file) |
| void | Load (const AssignmentProto &assignment_proto) |
| if !defined(SWIG) More... | |
| bool | Save (const std::string &filename) const |
| Saves the assignment to a file. More... | |
| bool | Save (File *file) const |
| void | Save (AssignmentProto *const assignment_proto) const |
| void | AddObjective (IntVar *const v) |
| void | ClearObjective () |
| IntVar * | Objective () const |
| bool | HasObjective () 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) |
| IntVarElement * | Add (IntVar *const var) |
| void | Add (const std::vector< IntVar * > &vars) |
| IntVarElement * | FastAdd (IntVar *const var) |
| Adds without checking if variable has been previously added. More... | |
| int64_t | Min (const IntVar *const var) const |
| int64_t | Max (const IntVar *const var) const |
| int64_t | Value (const IntVar *const var) const |
| bool | Bound (const IntVar *const var) const |
| void | SetMin (const IntVar *const var, int64_t m) |
| void | SetMax (const IntVar *const var, int64_t m) |
| void | SetRange (const IntVar *const var, int64_t l, int64_t u) |
| void | SetValue (const IntVar *const var, int64_t value) |
| IntervalVarElement * | Add (IntervalVar *const var) |
| void | Add (const std::vector< IntervalVar * > &vars) |
| IntervalVarElement * | FastAdd (IntervalVar *const var) |
| Adds without checking if variable has been previously added. More... | |
| int64_t | StartMin (const IntervalVar *const var) const |
| int64_t | StartMax (const IntervalVar *const var) const |
| int64_t | StartValue (const IntervalVar *const var) const |
| int64_t | DurationMin (const IntervalVar *const var) const |
| int64_t | DurationMax (const IntervalVar *const var) const |
| int64_t | DurationValue (const IntervalVar *const var) const |
| int64_t | EndMin (const IntervalVar *const var) const |
| int64_t | EndMax (const IntervalVar *const var) const |
| int64_t | EndValue (const IntervalVar *const var) const |
| int64_t | PerformedMin (const IntervalVar *const var) const |
| int64_t | PerformedMax (const IntervalVar *const var) const |
| int64_t | PerformedValue (const IntervalVar *const var) const |
| void | SetStartMin (const IntervalVar *const var, int64_t m) |
| void | SetStartMax (const IntervalVar *const var, int64_t m) |
| void | SetStartRange (const IntervalVar *const var, int64_t mi, int64_t ma) |
| void | SetStartValue (const IntervalVar *const var, int64_t value) |
| void | SetDurationMin (const IntervalVar *const var, int64_t m) |
| void | SetDurationMax (const IntervalVar *const var, int64_t m) |
| void | SetDurationRange (const IntervalVar *const var, int64_t mi, int64_t ma) |
| void | SetDurationValue (const IntervalVar *const var, int64_t value) |
| void | SetEndMin (const IntervalVar *const var, int64_t m) |
| void | SetEndMax (const IntervalVar *const var, int64_t m) |
| void | SetEndRange (const IntervalVar *const var, int64_t mi, int64_t ma) |
| void | SetEndValue (const IntervalVar *const var, int64_t value) |
| void | SetPerformedMin (const IntervalVar *const var, int64_t m) |
| void | SetPerformedMax (const IntervalVar *const var, int64_t m) |
| void | SetPerformedRange (const IntervalVar *const var, int64_t mi, int64_t ma) |
| void | SetPerformedValue (const IntervalVar *const var, int64_t value) |
| SequenceVarElement * | Add (SequenceVar *const var) |
| void | Add (const std::vector< SequenceVar * > &vars) |
| SequenceVarElement * | FastAdd (SequenceVar *const var) |
| Adds without checking if the variable had been previously added. More... | |
| const std::vector< int > & | ForwardSequence (const SequenceVar *const var) const |
| const std::vector< int > & | BackwardSequence (const SequenceVar *const var) const |
| const std::vector< int > & | Unperformed (const SequenceVar *const var) const |
| void | SetSequence (const SequenceVar *const var, const std::vector< int > &forward_sequence, const std::vector< int > &backward_sequence, const std::vector< int > &unperformed) |
| void | SetForwardSequence (const SequenceVar *const var, const std::vector< int > &forward_sequence) |
| void | SetBackwardSequence (const SequenceVar *const var, const std::vector< int > &backward_sequence) |
| void | SetUnperformed (const SequenceVar *const var, const std::vector< int > &unperformed) |
| void | Activate (const IntVar *const var) |
| void | Deactivate (const IntVar *const var) |
| bool | Activated (const IntVar *const var) const |
| void | Activate (const IntervalVar *const var) |
| void | Deactivate (const IntervalVar *const var) |
| bool | Activated (const IntervalVar *const var) const |
| void | Activate (const SequenceVar *const var) |
| void | Deactivate (const SequenceVar *const var) |
| bool | Activated (const SequenceVar *const var) const |
| void | ActivateObjective () |
| void | DeactivateObjective () |
| bool | ActivatedObjective () const |
| std::string | DebugString () const override |
| bool | AreAllElementsBound () const |
| bool | Contains (const IntVar *const var) const |
| bool | Contains (const IntervalVar *const var) const |
| bool | Contains (const SequenceVar *const var) const |
| void | CopyIntersection (const Assignment *assignment) |
| Copies the intersection of the two assignments to the current assignment. More... | |
| void | Copy (const Assignment *assignment) |
| Copies 'assignment' to the current assignment, clearing its previous content. More... | |
| 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 |
| Solver * | solver () const |
| void | FreezeQueue () |
| This method freezes the propagation queue. More... | |
| void | UnfreezeQueue () |
| This method unfreezes the propagation queue. More... | |
| void | EnqueueDelayedDemon (Demon *const d) |
| This method pushes the demon onto the propagation queue. More... | |
| 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. More... | |
| void | set_variable_to_clean_on_fail (IntVar *v) |
| Shortcut for variable cleaner. More... | |
| virtual std::string | name () const |
| Object naming. More... | |
| void | set_name (const std::string &name) |
| bool | HasName () const |
| Returns whether the object has been named or not. More... | |
| virtual std::string | BaseName () const |
| Returns a base name for automatic naming. More... | |
| typedef AssignmentContainer<IntVar, IntVarElement> IntContainer |
Definition at line 5173 of file constraint_solver.h.
Definition at line 5175 of file constraint_solver.h.
Definition at line 5177 of file constraint_solver.h.
|
explicit |
Definition at line 417 of file constraint_solver/assignment.cc.
|
explicit |
Definition at line 410 of file constraint_solver/assignment.cc.
|
override |
Definition at line 420 of file constraint_solver/assignment.cc.
| void Activate | ( | const IntervalVar *const | var | ) |
Definition at line 942 of file constraint_solver/assignment.cc.
| void Activate | ( | const IntVar *const | var | ) |
Definition at line 930 of file constraint_solver/assignment.cc.
| void Activate | ( | const SequenceVar *const | var | ) |
Definition at line 954 of file constraint_solver/assignment.cc.
| bool Activated | ( | const IntervalVar *const | var | ) | const |
Definition at line 950 of file constraint_solver/assignment.cc.
| bool Activated | ( | const IntVar *const | var | ) | const |
Definition at line 938 of file constraint_solver/assignment.cc.
| bool Activated | ( | const SequenceVar *const | var | ) | const |
Definition at line 962 of file constraint_solver/assignment.cc.
| bool ActivatedObjective | ( | ) | const |
Definition at line 978 of file constraint_solver/assignment.cc.
| void ActivateObjective | ( | ) |
Definition at line 966 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< IntervalVar * > & | vars | ) |
Definition at line 693 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< IntVar * > & | vars | ) |
Definition at line 645 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< SequenceVar * > & | vars | ) |
Definition at line 826 of file constraint_solver/assignment.cc.
| IntervalVarElement * Add | ( | IntervalVar *const | var | ) |
Definition at line 689 of file constraint_solver/assignment.cc.
| IntVarElement * Add | ( | IntVar *const | var | ) |
Definition at line 641 of file constraint_solver/assignment.cc.
| SequenceVarElement * Add | ( | SequenceVar *const | var | ) |
Definition at line 822 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5211 of file constraint_solver.h.
|
inline |
Definition at line 5310 of file constraint_solver.h.
| const std::vector< int > & BackwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 841 of file constraint_solver/assignment.cc.
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
Definition at line 2549 of file constraint_solver.cc.
| bool Bound | ( | const IntVar *const | var | ) | const |
Definition at line 667 of file constraint_solver/assignment.cc.
| void Clear | ( | ) |
Definition at line 422 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5216 of file constraint_solver.h.
| bool Contains | ( | const IntervalVar *const | var | ) | const |
Definition at line 989 of file constraint_solver/assignment.cc.
| bool Contains | ( | const IntVar *const | var | ) | const |
Definition at line 985 of file constraint_solver/assignment.cc.
| bool Contains | ( | const SequenceVar *const | var | ) | const |
Definition at line 993 of file constraint_solver/assignment.cc.
| void Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
Definition at line 1006 of file constraint_solver/assignment.cc.
| void CopyIntersection | ( | const Assignment * | assignment | ) |
Copies the intersection of the two assignments to the current assignment.
Definition at line 997 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const IntervalVar *const | var | ) |
Definition at line 946 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const IntVar *const | var | ) |
Definition at line 934 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const SequenceVar *const | var | ) |
Definition at line 958 of file constraint_solver/assignment.cc.
| void DeactivateObjective | ( | ) |
Definition at line 972 of file constraint_solver/assignment.cc.
|
overridevirtual |
Reimplemented from PropagationBaseObject.
Definition at line 627 of file constraint_solver/assignment.cc.
| int64_t DurationMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 719 of file constraint_solver/assignment.cc.
| int64_t DurationMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 715 of file constraint_solver/assignment.cc.
| int64_t DurationValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 723 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5184 of file constraint_solver.h.
| int64_t EndMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 731 of file constraint_solver/assignment.cc.
| int64_t EndMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 727 of file constraint_solver/assignment.cc.
| int64_t EndValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 735 of file constraint_solver/assignment.cc.
|
inherited |
Definition at line 2555 of file constraint_solver.cc.
|
inlineinherited |
This method pushes the demon onto the propagation queue.
It will be processed directly if the queue is empty. It will be enqueued according to its priority otherwise.
Definition at line 3287 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3288 of file constraint_solver.h.
|
inherited |
Definition at line 2551 of file constraint_solver.cc.
| IntervalVarElement * FastAdd | ( | IntervalVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 699 of file constraint_solver/assignment.cc.
| IntVarElement * FastAdd | ( | IntVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 651 of file constraint_solver/assignment.cc.
| SequenceVarElement * FastAdd | ( | SequenceVar *const | var | ) |
Adds without checking if the variable had been previously added.
Definition at line 832 of file constraint_solver/assignment.cc.
| const std::vector< int > & ForwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 836 of file constraint_solver/assignment.cc.
|
inlineinherited |
This method freezes the propagation queue.
It is useful when you need to apply multiple modifications at once.
Definition at line 3278 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
Definition at line 2547 of file constraint_solver.cc.
|
inline |
Definition at line 5218 of file constraint_solver.h.
|
inline |
Definition at line 5328 of file constraint_solver.h.
|
inline |
Definition at line 5326 of file constraint_solver.h.
| void Load | ( | const AssignmentProto & | assignment_proto | ) |
if !defined(SWIG)
Definition at line 531 of file constraint_solver/assignment.cc.
| bool 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 485 of file constraint_solver/assignment.cc.
| bool Load | ( | File * | file | ) |
Definition at line 494 of file constraint_solver/assignment.cc.
| int64_t Max | ( | const IntVar *const | var | ) | const |
Definition at line 659 of file constraint_solver/assignment.cc.
| int64_t Min | ( | const IntVar *const | var | ) | const |
Definition at line 655 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5331 of file constraint_solver.h.
|
inline |
Definition at line 5327 of file constraint_solver.h.
|
inline |
Definition at line 5337 of file constraint_solver.h.
|
virtualinherited |
Object naming.
Reimplemented in PiecewiseLinearExpr.
Definition at line 2539 of file constraint_solver.cc.
|
inline |
Definition at line 5192 of file constraint_solver.h.
|
inline |
Definition at line 5191 of file constraint_solver.h.
|
inline |
Definition at line 5193 of file constraint_solver.h.
|
inline |
Definition at line 5217 of file constraint_solver.h.
| bool ObjectiveBound | ( | ) | const |
Definition at line 899 of file constraint_solver/assignment.cc.
| int64_t ObjectiveMax | ( | ) | const |
Definition at line 885 of file constraint_solver/assignment.cc.
| int64_t ObjectiveMin | ( | ) | const |
Definition at line 878 of file constraint_solver/assignment.cc.
| int64_t ObjectiveValue | ( | ) | const |
Definition at line 892 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5346 of file constraint_solver.h.
|
inline |
Definition at line 5340 of file constraint_solver.h.
| int64_t PerformedMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 743 of file constraint_solver/assignment.cc.
| int64_t PerformedMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 739 of file constraint_solver/assignment.cc.
| int64_t PerformedValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 747 of file constraint_solver/assignment.cc.
|
inlineinherited |
This method clears the failure callback.
Definition at line 3301 of file constraint_solver.h.
| void Restore | ( | ) |
Definition at line 438 of file constraint_solver/assignment.cc.
| void Save | ( | AssignmentProto *const | assignment_proto | ) | const |
Definition at line 591 of file constraint_solver/assignment.cc.
| bool Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
Definition at line 561 of file constraint_solver/assignment.cc.
| bool Save | ( | File * | file | ) | const |
Definition at line 570 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5334 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3295 of file constraint_solver.h.
|
inherited |
Definition at line 2543 of file constraint_solver.cc.
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3304 of file constraint_solver.h.
| void SetBackwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | backward_sequence | ||
| ) |
Definition at line 865 of file constraint_solver/assignment.cc.
| void SetDurationMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 772 of file constraint_solver/assignment.cc.
| void SetDurationMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 768 of file constraint_solver/assignment.cc.
| void SetDurationRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 776 of file constraint_solver/assignment.cc.
| void SetDurationValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 781 of file constraint_solver/assignment.cc.
| void SetEndMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 789 of file constraint_solver/assignment.cc.
| void SetEndMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 785 of file constraint_solver/assignment.cc.
| void SetEndRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 793 of file constraint_solver/assignment.cc.
| void SetEndValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 798 of file constraint_solver/assignment.cc.
| void SetForwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | forward_sequence | ||
| ) |
Definition at line 859 of file constraint_solver/assignment.cc.
| void SetMax | ( | const IntVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 675 of file constraint_solver/assignment.cc.
| void SetMin | ( | const IntVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 671 of file constraint_solver/assignment.cc.
| void SetObjectiveMax | ( | int64_t | m | ) |
Definition at line 912 of file constraint_solver/assignment.cc.
| void SetObjectiveMin | ( | int64_t | m | ) |
Definition at line 906 of file constraint_solver/assignment.cc.
| void SetObjectiveRange | ( | int64_t | l, |
| int64_t | u | ||
| ) |
Definition at line 918 of file constraint_solver/assignment.cc.
| void SetObjectiveValue | ( | int64_t | value | ) |
Definition at line 924 of file constraint_solver/assignment.cc.
| void SetPerformedMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 806 of file constraint_solver/assignment.cc.
| void SetPerformedMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 802 of file constraint_solver/assignment.cc.
| void SetPerformedRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 810 of file constraint_solver/assignment.cc.
| void SetPerformedValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 815 of file constraint_solver/assignment.cc.
| void SetRange | ( | const IntVar *const | var, |
| int64_t | l, | ||
| int64_t | u | ||
| ) |
Definition at line 679 of file constraint_solver/assignment.cc.
| void SetSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | forward_sequence, | ||
| const std::vector< int > & | backward_sequence, | ||
| const std::vector< int > & | unperformed | ||
| ) |
Definition at line 851 of file constraint_solver/assignment.cc.
| void SetStartMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 755 of file constraint_solver/assignment.cc.
| void SetStartMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 751 of file constraint_solver/assignment.cc.
| void SetStartRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 759 of file constraint_solver/assignment.cc.
| void SetStartValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 764 of file constraint_solver/assignment.cc.
| void SetUnperformed | ( | const SequenceVar *const | var, |
| const std::vector< int > & | unperformed | ||
| ) |
Definition at line 871 of file constraint_solver/assignment.cc.
| void SetValue | ( | const IntVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 683 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5188 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3274 of file constraint_solver.h.
| int64_t StartMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 707 of file constraint_solver/assignment.cc.
| int64_t StartMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 703 of file constraint_solver/assignment.cc.
| int64_t StartValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 711 of file constraint_solver/assignment.cc.
| void Store | ( | ) |
Definition at line 429 of file constraint_solver/assignment.cc.
|
inlineinherited |
This method unfreezes the propagation queue.
All modifications that happened when the queue was frozen will be processed.
Definition at line 3282 of file constraint_solver.h.
| const std::vector< int > & Unperformed | ( | const SequenceVar *const | var | ) | const |
Definition at line 846 of file constraint_solver/assignment.cc.
| int64_t Value | ( | const IntVar *const | var | ) | const |
Definition at line 663 of file constraint_solver/assignment.cc.