![]() |
OR-Tools
9.3
|
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition at line 5081 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 5083 of file constraint_solver.h.
Definition at line 5085 of file constraint_solver.h.
Definition at line 5087 of file constraint_solver.h.
|
explicit |
Definition at line 416 of file constraint_solver/assignment.cc.
|
explicit |
Definition at line 409 of file constraint_solver/assignment.cc.
|
override |
Definition at line 419 of file constraint_solver/assignment.cc.
| void Activate | ( | const IntervalVar *const | var | ) |
Definition at line 949 of file constraint_solver/assignment.cc.
| void Activate | ( | const IntVar *const | var | ) |
Definition at line 937 of file constraint_solver/assignment.cc.
| void Activate | ( | const SequenceVar *const | var | ) |
Definition at line 961 of file constraint_solver/assignment.cc.
| bool Activated | ( | const IntervalVar *const | var | ) | const |
Definition at line 957 of file constraint_solver/assignment.cc.
| bool Activated | ( | const IntVar *const | var | ) | const |
Definition at line 945 of file constraint_solver/assignment.cc.
| bool Activated | ( | const SequenceVar *const | var | ) | const |
Definition at line 969 of file constraint_solver/assignment.cc.
| bool ActivatedObjective | ( | ) | const |
Definition at line 985 of file constraint_solver/assignment.cc.
| void ActivateObjective | ( | ) |
Definition at line 973 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< IntervalVar * > & | vars | ) |
Definition at line 692 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< IntVar * > & | vars | ) |
Definition at line 644 of file constraint_solver/assignment.cc.
| void Add | ( | const std::vector< SequenceVar * > & | vars | ) |
Definition at line 825 of file constraint_solver/assignment.cc.
| IntervalVarElement * Add | ( | IntervalVar *const | var | ) |
Definition at line 688 of file constraint_solver/assignment.cc.
| IntVarElement * Add | ( | IntVar *const | var | ) |
Definition at line 640 of file constraint_solver/assignment.cc.
| SequenceVarElement * Add | ( | SequenceVar *const | var | ) |
Definition at line 821 of file constraint_solver/assignment.cc.
| void AddObjective | ( | IntVar *const | v | ) |
Definition at line 877 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5216 of file constraint_solver.h.
| const std::vector< int > & BackwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 840 of file constraint_solver/assignment.cc.
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
Definition at line 2521 of file constraint_solver.cc.
| bool Bound | ( | const IntVar *const | var | ) | const |
Definition at line 666 of file constraint_solver/assignment.cc.
| void Clear | ( | ) |
Definition at line 421 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5122 of file constraint_solver.h.
| bool Contains | ( | const IntervalVar *const | var | ) | const |
Definition at line 996 of file constraint_solver/assignment.cc.
| bool Contains | ( | const IntVar *const | var | ) | const |
Definition at line 992 of file constraint_solver/assignment.cc.
| bool Contains | ( | const SequenceVar *const | var | ) | const |
Definition at line 1000 of file constraint_solver/assignment.cc.
| void Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
Definition at line 1013 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 1004 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const IntervalVar *const | var | ) |
Definition at line 953 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const IntVar *const | var | ) |
Definition at line 941 of file constraint_solver/assignment.cc.
| void Deactivate | ( | const SequenceVar *const | var | ) |
Definition at line 965 of file constraint_solver/assignment.cc.
| void DeactivateObjective | ( | ) |
Definition at line 979 of file constraint_solver/assignment.cc.
|
overridevirtual |
Reimplemented from PropagationBaseObject.
Definition at line 626 of file constraint_solver/assignment.cc.
| int64_t DurationMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 718 of file constraint_solver/assignment.cc.
| int64_t DurationMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 714 of file constraint_solver/assignment.cc.
| int64_t DurationValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 722 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5094 of file constraint_solver.h.
| int64_t EndMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 730 of file constraint_solver/assignment.cc.
| int64_t EndMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 726 of file constraint_solver/assignment.cc.
| int64_t EndValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 734 of file constraint_solver/assignment.cc.
|
inherited |
Definition at line 2527 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 3209 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3210 of file constraint_solver.h.
|
inherited |
Definition at line 2523 of file constraint_solver.cc.
| IntervalVarElement * FastAdd | ( | IntervalVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 698 of file constraint_solver/assignment.cc.
| IntVarElement * FastAdd | ( | IntVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 650 of file constraint_solver/assignment.cc.
| SequenceVarElement * FastAdd | ( | SequenceVar *const | var | ) |
Adds without checking if the variable had been previously added.
Definition at line 831 of file constraint_solver/assignment.cc.
| const std::vector< int > & ForwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 835 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 3200 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
Definition at line 2519 of file constraint_solver.cc.
|
inline |
Definition at line 5124 of file constraint_solver.h.
|
inline |
Definition at line 5234 of file constraint_solver.h.
|
inline |
Definition at line 5232 of file constraint_solver.h.
| void Load | ( | const AssignmentProto & | assignment_proto | ) |
if !defined(SWIG)
Definition at line 530 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 484 of file constraint_solver/assignment.cc.
| bool Load | ( | File * | file | ) |
Definition at line 493 of file constraint_solver/assignment.cc.
| int64_t Max | ( | const IntVar *const | var | ) | const |
Definition at line 658 of file constraint_solver/assignment.cc.
| int64_t Min | ( | const IntVar *const | var | ) | const |
Definition at line 654 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5237 of file constraint_solver.h.
|
inline |
Definition at line 5233 of file constraint_solver.h.
|
inline |
Definition at line 5243 of file constraint_solver.h.
|
virtualinherited |
Object naming.
Reimplemented in PiecewiseLinearExpr.
Definition at line 2511 of file constraint_solver.cc.
|
inline |
Definition at line 5102 of file constraint_solver.h.
|
inline |
Definition at line 5101 of file constraint_solver.h.
|
inline |
Definition at line 5103 of file constraint_solver.h.
| IntVar * Objective | ( | ) | const |
Definition at line 883 of file constraint_solver/assignment.cc.
| bool ObjectiveBound | ( | ) | const |
Definition at line 906 of file constraint_solver/assignment.cc.
| int64_t ObjectiveMax | ( | ) | const |
Definition at line 892 of file constraint_solver/assignment.cc.
| int64_t ObjectiveMin | ( | ) | const |
Definition at line 885 of file constraint_solver/assignment.cc.
| int64_t ObjectiveValue | ( | ) | const |
Definition at line 899 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5252 of file constraint_solver.h.
|
inline |
Definition at line 5246 of file constraint_solver.h.
| int64_t PerformedMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 742 of file constraint_solver/assignment.cc.
| int64_t PerformedMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 738 of file constraint_solver/assignment.cc.
| int64_t PerformedValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 746 of file constraint_solver/assignment.cc.
|
inlineinherited |
This method clears the failure callback.
Definition at line 3223 of file constraint_solver.h.
| void Restore | ( | ) |
Definition at line 437 of file constraint_solver/assignment.cc.
| void Save | ( | AssignmentProto *const | assignment_proto | ) | const |
Definition at line 590 of file constraint_solver/assignment.cc.
| bool Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
Definition at line 560 of file constraint_solver/assignment.cc.
| bool Save | ( | File * | file | ) | const |
Definition at line 569 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5240 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3217 of file constraint_solver.h.
|
inherited |
Definition at line 2515 of file constraint_solver.cc.
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3226 of file constraint_solver.h.
| void SetBackwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | backward_sequence | ||
| ) |
Definition at line 864 of file constraint_solver/assignment.cc.
| void SetDurationMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 771 of file constraint_solver/assignment.cc.
| void SetDurationMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 767 of file constraint_solver/assignment.cc.
| void SetDurationRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 775 of file constraint_solver/assignment.cc.
| void SetDurationValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 780 of file constraint_solver/assignment.cc.
| void SetEndMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 788 of file constraint_solver/assignment.cc.
| void SetEndMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 784 of file constraint_solver/assignment.cc.
| void SetEndRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 792 of file constraint_solver/assignment.cc.
| void SetEndValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 797 of file constraint_solver/assignment.cc.
| void SetForwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | forward_sequence | ||
| ) |
Definition at line 858 of file constraint_solver/assignment.cc.
| void SetMax | ( | const IntVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 674 of file constraint_solver/assignment.cc.
| void SetMin | ( | const IntVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 670 of file constraint_solver/assignment.cc.
| void SetObjectiveMax | ( | int64_t | m | ) |
Definition at line 919 of file constraint_solver/assignment.cc.
| void SetObjectiveMin | ( | int64_t | m | ) |
Definition at line 913 of file constraint_solver/assignment.cc.
| void SetObjectiveRange | ( | int64_t | l, |
| int64_t | u | ||
| ) |
Definition at line 925 of file constraint_solver/assignment.cc.
| void SetObjectiveValue | ( | int64_t | value | ) |
Definition at line 931 of file constraint_solver/assignment.cc.
| void SetPerformedMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 805 of file constraint_solver/assignment.cc.
| void SetPerformedMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 801 of file constraint_solver/assignment.cc.
| void SetPerformedRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 809 of file constraint_solver/assignment.cc.
| void SetPerformedValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 814 of file constraint_solver/assignment.cc.
| void SetRange | ( | const IntVar *const | var, |
| int64_t | l, | ||
| int64_t | u | ||
| ) |
Definition at line 678 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 850 of file constraint_solver/assignment.cc.
| void SetStartMax | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 754 of file constraint_solver/assignment.cc.
| void SetStartMin | ( | const IntervalVar *const | var, |
| int64_t | m | ||
| ) |
Definition at line 750 of file constraint_solver/assignment.cc.
| void SetStartRange | ( | const IntervalVar *const | var, |
| int64_t | mi, | ||
| int64_t | ma | ||
| ) |
Definition at line 758 of file constraint_solver/assignment.cc.
| void SetStartValue | ( | const IntervalVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 763 of file constraint_solver/assignment.cc.
| void SetUnperformed | ( | const SequenceVar *const | var, |
| const std::vector< int > & | unperformed | ||
| ) |
Definition at line 870 of file constraint_solver/assignment.cc.
| void SetValue | ( | const IntVar *const | var, |
| int64_t | value | ||
| ) |
Definition at line 682 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5098 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3196 of file constraint_solver.h.
| int64_t StartMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 706 of file constraint_solver/assignment.cc.
| int64_t StartMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 702 of file constraint_solver/assignment.cc.
| int64_t StartValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 710 of file constraint_solver/assignment.cc.
| void Store | ( | ) |
Definition at line 428 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 3204 of file constraint_solver.h.
| const std::vector< int > & Unperformed | ( | const SequenceVar *const | var | ) | const |
Definition at line 845 of file constraint_solver/assignment.cc.
| int64_t Value | ( | const IntVar *const | var | ) | const |
Definition at line 662 of file constraint_solver/assignment.cc.