![]() |
OR-Tools
8.2
|
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition at line 5038 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 | ObjectiveMin () const |
int64 | ObjectiveMax () const |
int64 | ObjectiveValue () const |
bool | ObjectiveBound () const |
void | SetObjectiveMin (int64 m) |
void | SetObjectiveMax (int64 m) |
void | SetObjectiveValue (int64 value) |
void | SetObjectiveRange (int64 l, int64 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 | Min (const IntVar *const var) const |
int64 | Max (const IntVar *const var) const |
int64 | Value (const IntVar *const var) const |
bool | Bound (const IntVar *const var) const |
void | SetMin (const IntVar *const var, int64 m) |
void | SetMax (const IntVar *const var, int64 m) |
void | SetRange (const IntVar *const var, int64 l, int64 u) |
void | SetValue (const IntVar *const var, int64 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 | StartMin (const IntervalVar *const var) const |
int64 | StartMax (const IntervalVar *const var) const |
int64 | StartValue (const IntervalVar *const var) const |
int64 | DurationMin (const IntervalVar *const var) const |
int64 | DurationMax (const IntervalVar *const var) const |
int64 | DurationValue (const IntervalVar *const var) const |
int64 | EndMin (const IntervalVar *const var) const |
int64 | EndMax (const IntervalVar *const var) const |
int64 | EndValue (const IntervalVar *const var) const |
int64 | PerformedMin (const IntervalVar *const var) const |
int64 | PerformedMax (const IntervalVar *const var) const |
int64 | PerformedValue (const IntervalVar *const var) const |
void | SetStartMin (const IntervalVar *const var, int64 m) |
void | SetStartMax (const IntervalVar *const var, int64 m) |
void | SetStartRange (const IntervalVar *const var, int64 mi, int64 ma) |
void | SetStartValue (const IntervalVar *const var, int64 value) |
void | SetDurationMin (const IntervalVar *const var, int64 m) |
void | SetDurationMax (const IntervalVar *const var, int64 m) |
void | SetDurationRange (const IntervalVar *const var, int64 mi, int64 ma) |
void | SetDurationValue (const IntervalVar *const var, int64 value) |
void | SetEndMin (const IntervalVar *const var, int64 m) |
void | SetEndMax (const IntervalVar *const var, int64 m) |
void | SetEndRange (const IntervalVar *const var, int64 mi, int64 ma) |
void | SetEndValue (const IntervalVar *const var, int64 value) |
void | SetPerformedMin (const IntervalVar *const var, int64 m) |
void | SetPerformedMax (const IntervalVar *const var, int64 m) |
void | SetPerformedRange (const IntervalVar *const var, int64 mi, int64 ma) |
void | SetPerformedValue (const IntervalVar *const var, int64 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 5040 of file constraint_solver.h.
Definition at line 5042 of file constraint_solver.h.
Definition at line 5044 of file constraint_solver.h.
|
explicit |
Definition at line 413 of file constraint_solver/assignment.cc.
|
explicit |
Definition at line 406 of file constraint_solver/assignment.cc.
|
override |
Definition at line 416 of file constraint_solver/assignment.cc.
void Activate | ( | const IntervalVar *const | var | ) |
Definition at line 944 of file constraint_solver/assignment.cc.
void Activate | ( | const IntVar *const | var | ) |
Definition at line 932 of file constraint_solver/assignment.cc.
void Activate | ( | const SequenceVar *const | var | ) |
Definition at line 956 of file constraint_solver/assignment.cc.
bool Activated | ( | const IntervalVar *const | var | ) | const |
Definition at line 952 of file constraint_solver/assignment.cc.
bool Activated | ( | const IntVar *const | var | ) | const |
Definition at line 940 of file constraint_solver/assignment.cc.
bool Activated | ( | const SequenceVar *const | var | ) | const |
Definition at line 964 of file constraint_solver/assignment.cc.
bool ActivatedObjective | ( | ) | const |
Definition at line 980 of file constraint_solver/assignment.cc.
void ActivateObjective | ( | ) |
Definition at line 968 of file constraint_solver/assignment.cc.
void Add | ( | const std::vector< IntervalVar * > & | vars | ) |
Definition at line 689 of file constraint_solver/assignment.cc.
void Add | ( | const std::vector< IntVar * > & | vars | ) |
Definition at line 641 of file constraint_solver/assignment.cc.
void Add | ( | const std::vector< SequenceVar * > & | vars | ) |
Definition at line 820 of file constraint_solver/assignment.cc.
IntervalVarElement * Add | ( | IntervalVar *const | var | ) |
Definition at line 685 of file constraint_solver/assignment.cc.
IntVarElement * Add | ( | IntVar *const | var | ) |
Definition at line 637 of file constraint_solver/assignment.cc.
SequenceVarElement * Add | ( | SequenceVar *const | var | ) |
Definition at line 816 of file constraint_solver/assignment.cc.
void AddObjective | ( | IntVar *const | v | ) |
Definition at line 872 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5173 of file constraint_solver.h.
const std::vector< int > & BackwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 835 of file constraint_solver/assignment.cc.
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
Definition at line 2515 of file constraint_solver.cc.
bool Bound | ( | const IntVar *const | var | ) | const |
Definition at line 663 of file constraint_solver/assignment.cc.
void Clear | ( | ) |
Definition at line 418 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5079 of file constraint_solver.h.
bool Contains | ( | const IntervalVar *const | var | ) | const |
Definition at line 991 of file constraint_solver/assignment.cc.
bool Contains | ( | const IntVar *const | var | ) | const |
Definition at line 987 of file constraint_solver/assignment.cc.
bool Contains | ( | const SequenceVar *const | var | ) | const |
Definition at line 995 of file constraint_solver/assignment.cc.
void Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
Definition at line 1008 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 999 of file constraint_solver/assignment.cc.
void Deactivate | ( | const IntervalVar *const | var | ) |
Definition at line 948 of file constraint_solver/assignment.cc.
void Deactivate | ( | const IntVar *const | var | ) |
Definition at line 936 of file constraint_solver/assignment.cc.
void Deactivate | ( | const SequenceVar *const | var | ) |
Definition at line 960 of file constraint_solver/assignment.cc.
void DeactivateObjective | ( | ) |
Definition at line 974 of file constraint_solver/assignment.cc.
|
overridevirtual |
Reimplemented from PropagationBaseObject.
Definition at line 623 of file constraint_solver/assignment.cc.
int64 DurationMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 715 of file constraint_solver/assignment.cc.
int64 DurationMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 711 of file constraint_solver/assignment.cc.
int64 DurationValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 719 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5051 of file constraint_solver.h.
int64 EndMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 727 of file constraint_solver/assignment.cc.
int64 EndMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 723 of file constraint_solver/assignment.cc.
int64 EndValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 731 of file constraint_solver/assignment.cc.
|
inherited |
Definition at line 2521 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 3192 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3193 of file constraint_solver.h.
|
inherited |
Definition at line 2517 of file constraint_solver.cc.
IntervalVarElement * FastAdd | ( | IntervalVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 695 of file constraint_solver/assignment.cc.
IntVarElement * FastAdd | ( | IntVar *const | var | ) |
Adds without checking if variable has been previously added.
Definition at line 647 of file constraint_solver/assignment.cc.
SequenceVarElement * FastAdd | ( | SequenceVar *const | var | ) |
Adds without checking if the variable had been previously added.
Definition at line 826 of file constraint_solver/assignment.cc.
const std::vector< int > & ForwardSequence | ( | const SequenceVar *const | var | ) | const |
Definition at line 830 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 3183 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
Definition at line 2513 of file constraint_solver.cc.
|
inline |
Definition at line 5081 of file constraint_solver.h.
|
inline |
Definition at line 5191 of file constraint_solver.h.
|
inline |
Definition at line 5189 of file constraint_solver.h.
void Load | ( | const AssignmentProto & | assignment_proto | ) |
if !defined(SWIG)
Definition at line 527 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 481 of file constraint_solver/assignment.cc.
bool Load | ( | File * | file | ) |
Definition at line 490 of file constraint_solver/assignment.cc.
Definition at line 655 of file constraint_solver/assignment.cc.
Definition at line 651 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5194 of file constraint_solver.h.
|
inline |
Definition at line 5190 of file constraint_solver.h.
|
inline |
Definition at line 5200 of file constraint_solver.h.
|
virtualinherited |
Object naming.
Reimplemented in PiecewiseLinearExpr.
Definition at line 2505 of file constraint_solver.cc.
|
inline |
Definition at line 5059 of file constraint_solver.h.
|
inline |
Definition at line 5058 of file constraint_solver.h.
|
inline |
Definition at line 5060 of file constraint_solver.h.
IntVar * Objective | ( | ) | const |
Definition at line 878 of file constraint_solver/assignment.cc.
bool ObjectiveBound | ( | ) | const |
Definition at line 901 of file constraint_solver/assignment.cc.
int64 ObjectiveMax | ( | ) | const |
Definition at line 887 of file constraint_solver/assignment.cc.
int64 ObjectiveMin | ( | ) | const |
Definition at line 880 of file constraint_solver/assignment.cc.
int64 ObjectiveValue | ( | ) | const |
Definition at line 894 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5209 of file constraint_solver.h.
|
inline |
Definition at line 5203 of file constraint_solver.h.
int64 PerformedMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 739 of file constraint_solver/assignment.cc.
int64 PerformedMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 735 of file constraint_solver/assignment.cc.
int64 PerformedValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 743 of file constraint_solver/assignment.cc.
|
inlineinherited |
This method clears the failure callback.
Definition at line 3206 of file constraint_solver.h.
void Restore | ( | ) |
Definition at line 434 of file constraint_solver/assignment.cc.
void Save | ( | AssignmentProto *const | assignment_proto | ) | const |
Definition at line 587 of file constraint_solver/assignment.cc.
bool Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
Definition at line 557 of file constraint_solver/assignment.cc.
bool Save | ( | File * | file | ) | const |
Definition at line 566 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5197 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3200 of file constraint_solver.h.
|
inherited |
Definition at line 2509 of file constraint_solver.cc.
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3209 of file constraint_solver.h.
void SetBackwardSequence | ( | const SequenceVar *const | var, |
const std::vector< int > & | backward_sequence | ||
) |
Definition at line 859 of file constraint_solver/assignment.cc.
void SetDurationMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 768 of file constraint_solver/assignment.cc.
void SetDurationMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 764 of file constraint_solver/assignment.cc.
void SetDurationRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
Definition at line 772 of file constraint_solver/assignment.cc.
void SetDurationValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
Definition at line 777 of file constraint_solver/assignment.cc.
void SetEndMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 785 of file constraint_solver/assignment.cc.
void SetEndMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 781 of file constraint_solver/assignment.cc.
void SetEndRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
Definition at line 789 of file constraint_solver/assignment.cc.
void SetEndValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
Definition at line 793 of file constraint_solver/assignment.cc.
void SetForwardSequence | ( | const SequenceVar *const | var, |
const std::vector< int > & | forward_sequence | ||
) |
Definition at line 853 of file constraint_solver/assignment.cc.
Definition at line 671 of file constraint_solver/assignment.cc.
Definition at line 667 of file constraint_solver/assignment.cc.
void SetObjectiveMax | ( | int64 | m | ) |
Definition at line 914 of file constraint_solver/assignment.cc.
void SetObjectiveMin | ( | int64 | m | ) |
Definition at line 908 of file constraint_solver/assignment.cc.
Definition at line 920 of file constraint_solver/assignment.cc.
void SetObjectiveValue | ( | int64 | value | ) |
Definition at line 926 of file constraint_solver/assignment.cc.
void SetPerformedMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 801 of file constraint_solver/assignment.cc.
void SetPerformedMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 797 of file constraint_solver/assignment.cc.
void SetPerformedRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
Definition at line 805 of file constraint_solver/assignment.cc.
void SetPerformedValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
Definition at line 810 of file constraint_solver/assignment.cc.
Definition at line 675 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 845 of file constraint_solver/assignment.cc.
void SetStartMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 751 of file constraint_solver/assignment.cc.
void SetStartMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
Definition at line 747 of file constraint_solver/assignment.cc.
void SetStartRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
Definition at line 755 of file constraint_solver/assignment.cc.
void SetStartValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
Definition at line 760 of file constraint_solver/assignment.cc.
void SetUnperformed | ( | const SequenceVar *const | var, |
const std::vector< int > & | unperformed | ||
) |
Definition at line 865 of file constraint_solver/assignment.cc.
Definition at line 679 of file constraint_solver/assignment.cc.
|
inline |
Definition at line 5055 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3179 of file constraint_solver.h.
int64 StartMax | ( | const IntervalVar *const | var | ) | const |
Definition at line 703 of file constraint_solver/assignment.cc.
int64 StartMin | ( | const IntervalVar *const | var | ) | const |
Definition at line 699 of file constraint_solver/assignment.cc.
int64 StartValue | ( | const IntervalVar *const | var | ) | const |
Definition at line 707 of file constraint_solver/assignment.cc.
void Store | ( | ) |
Definition at line 425 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 3187 of file constraint_solver.h.
const std::vector< int > & Unperformed | ( | const SequenceVar *const | var | ) | const |
Definition at line 840 of file constraint_solver/assignment.cc.
Definition at line 659 of file constraint_solver/assignment.cc.