--— Assignment --— More...
#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 *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) |
| 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) |
| This method sets a callback that will be called if a failure happens during the propagation of the queue. More... | |
| 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... | |
--— Assignment --—
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition at line 5005 of file constraint_solver.h.
Definition at line 5007 of file constraint_solver.h.
| typedef AssignmentContainer<IntervalVar, IntervalVarElement> operations_research::Assignment::IntervalContainer |
Definition at line 5009 of file constraint_solver.h.
| typedef AssignmentContainer<SequenceVar, SequenceVarElement> operations_research::Assignment::SequenceContainer |
Definition at line 5011 of file constraint_solver.h.
|
explicit |
|
explicit |
|
override |
| void operations_research::Assignment::Activate | ( | const IntVar *const | var | ) |
| void operations_research::Assignment::Activate | ( | const IntervalVar *const | var | ) |
| void operations_research::Assignment::Activate | ( | const SequenceVar *const | var | ) |
| bool operations_research::Assignment::Activated | ( | const IntVar *const | var | ) | const |
| bool operations_research::Assignment::Activated | ( | const IntervalVar *const | var | ) | const |
| bool operations_research::Assignment::Activated | ( | const SequenceVar *const | var | ) | const |
| bool operations_research::Assignment::ActivatedObjective | ( | ) | const |
| void operations_research::Assignment::ActivateObjective | ( | ) |
| IntVarElement* operations_research::Assignment::Add | ( | IntVar *const | var | ) |
| void operations_research::Assignment::Add | ( | const std::vector< IntVar * > & | vars | ) |
| IntervalVarElement* operations_research::Assignment::Add | ( | IntervalVar *const | var | ) |
| void operations_research::Assignment::Add | ( | const std::vector< IntervalVar * > & | vars | ) |
| SequenceVarElement* operations_research::Assignment::Add | ( | SequenceVar *const | var | ) |
| void operations_research::Assignment::Add | ( | const std::vector< SequenceVar * > & | vars | ) |
| void operations_research::Assignment::AddObjective | ( | IntVar *const | v | ) |
|
inline |
Definition at line 5140 of file constraint_solver.h.
| const std::vector<int>& operations_research::Assignment::BackwardSequence | ( | const SequenceVar *const | var | ) | const |
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in operations_research::BooleanVar.
| bool operations_research::Assignment::Bound | ( | const IntVar *const | var | ) | const |
| void operations_research::Assignment::Clear | ( | ) |
|
inline |
Definition at line 5046 of file constraint_solver.h.
| bool operations_research::Assignment::Contains | ( | const IntVar *const | var | ) | const |
| bool operations_research::Assignment::Contains | ( | const IntervalVar *const | var | ) | const |
| bool operations_research::Assignment::Contains | ( | const SequenceVar *const | var | ) | const |
| void operations_research::Assignment::Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
| void operations_research::Assignment::CopyIntersection | ( | const Assignment * | assignment | ) |
Copies the intersection of the two assignments to the current assignment.
| void operations_research::Assignment::Deactivate | ( | const IntVar *const | var | ) |
| void operations_research::Assignment::Deactivate | ( | const IntervalVar *const | var | ) |
| void operations_research::Assignment::Deactivate | ( | const SequenceVar *const | var | ) |
| void operations_research::Assignment::DeactivateObjective | ( | ) |
|
overridevirtual |
Reimplemented from operations_research::PropagationBaseObject.
| int64 operations_research::Assignment::DurationMax | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::DurationMin | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::DurationValue | ( | const IntervalVar *const | var | ) | const |
|
inline |
Definition at line 5018 of file constraint_solver.h.
| int64 operations_research::Assignment::EndMax | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::EndMin | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::EndValue | ( | const IntervalVar *const | var | ) | const |
|
inherited |
|
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 3173 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3174 of file constraint_solver.h.
|
inherited |
| IntVarElement* operations_research::Assignment::FastAdd | ( | IntVar *const | var | ) |
Adds without checking if variable has been previously added.
| IntervalVarElement* operations_research::Assignment::FastAdd | ( | IntervalVar *const | var | ) |
Adds without checking if variable has been previously added.
| SequenceVarElement* operations_research::Assignment::FastAdd | ( | SequenceVar *const | var | ) |
Adds without checking if the variable had been previously added.
| const std::vector<int>& operations_research::Assignment::ForwardSequence | ( | const SequenceVar *const | var | ) | const |
|
inlineinherited |
This method freezes the propagation queue.
It is useful when you need to apply multiple modifications at once.
Definition at line 3164 of file constraint_solver.h.
|
inherited |
Returns whether the object has been named or not.
|
inline |
Definition at line 5048 of file constraint_solver.h.
|
inline |
Definition at line 5158 of file constraint_solver.h.
|
inline |
Definition at line 5156 of file constraint_solver.h.
| 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).
| bool operations_research::Assignment::Load | ( | File * | file | ) |
| void operations_research::Assignment::Load | ( | const AssignmentProto & | assignment_proto | ) |
| int64 operations_research::Assignment::Max | ( | const IntVar *const | var | ) | const |
| int64 operations_research::Assignment::Min | ( | const IntVar *const | var | ) | const |
|
inline |
Definition at line 5161 of file constraint_solver.h.
|
inline |
Definition at line 5157 of file constraint_solver.h.
|
inline |
Definition at line 5167 of file constraint_solver.h.
|
virtualinherited |
Object naming.
|
inline |
Definition at line 5026 of file constraint_solver.h.
|
inline |
Definition at line 5025 of file constraint_solver.h.
|
inline |
Definition at line 5027 of file constraint_solver.h.
| IntVar* operations_research::Assignment::Objective | ( | ) | const |
| bool operations_research::Assignment::ObjectiveBound | ( | ) | const |
| int64 operations_research::Assignment::ObjectiveMax | ( | ) | const |
| int64 operations_research::Assignment::ObjectiveMin | ( | ) | const |
| int64 operations_research::Assignment::ObjectiveValue | ( | ) | const |
|
inline |
Definition at line 5176 of file constraint_solver.h.
|
inline |
Definition at line 5170 of file constraint_solver.h.
| int64 operations_research::Assignment::PerformedMax | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::PerformedMin | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::PerformedValue | ( | const IntervalVar *const | var | ) | const |
|
inlineinherited |
This method clears the failure callback.
Definition at line 3187 of file constraint_solver.h.
| void operations_research::Assignment::Restore | ( | ) |
| bool operations_research::Assignment::Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
| bool operations_research::Assignment::Save | ( | File * | file | ) | const |
| void operations_research::Assignment::Save | ( | AssignmentProto *const | assignment_proto | ) | const |
|
inline |
Definition at line 5164 of file constraint_solver.h.
|
inlineinherited |
This method sets a callback that will be called if a failure happens during the propagation of the queue.
Definition at line 3181 of file constraint_solver.h.
|
inherited |
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3190 of file constraint_solver.h.
| void operations_research::Assignment::SetBackwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | backward_sequence | ||
| ) |
| void operations_research::Assignment::SetDurationMax | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetDurationMin | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetDurationRange | ( | const IntervalVar *const | var, |
| int64 | mi, | ||
| int64 | ma | ||
| ) |
| void operations_research::Assignment::SetDurationValue | ( | const IntervalVar *const | var, |
| int64 | value | ||
| ) |
| void operations_research::Assignment::SetEndMax | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetEndMin | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetEndRange | ( | const IntervalVar *const | var, |
| int64 | mi, | ||
| int64 | ma | ||
| ) |
| void operations_research::Assignment::SetEndValue | ( | const IntervalVar *const | var, |
| int64 | value | ||
| ) |
| void operations_research::Assignment::SetForwardSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | forward_sequence | ||
| ) |
| void operations_research::Assignment::SetMax | ( | const IntVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetMin | ( | const IntVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetObjectiveMax | ( | int64 | m | ) |
| void operations_research::Assignment::SetObjectiveMin | ( | int64 | m | ) |
| void operations_research::Assignment::SetObjectiveRange | ( | int64 | l, |
| int64 | u | ||
| ) |
| void operations_research::Assignment::SetObjectiveValue | ( | int64 | value | ) |
| void operations_research::Assignment::SetPerformedMax | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetPerformedMin | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetPerformedRange | ( | const IntervalVar *const | var, |
| int64 | mi, | ||
| int64 | ma | ||
| ) |
| void operations_research::Assignment::SetPerformedValue | ( | const IntervalVar *const | var, |
| int64 | value | ||
| ) |
| void operations_research::Assignment::SetRange | ( | const IntVar *const | var, |
| int64 | l, | ||
| int64 | u | ||
| ) |
| void operations_research::Assignment::SetSequence | ( | const SequenceVar *const | var, |
| const std::vector< int > & | forward_sequence, | ||
| const std::vector< int > & | backward_sequence, | ||
| const std::vector< int > & | unperformed | ||
| ) |
| void operations_research::Assignment::SetStartMax | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetStartMin | ( | const IntervalVar *const | var, |
| int64 | m | ||
| ) |
| void operations_research::Assignment::SetStartRange | ( | const IntervalVar *const | var, |
| int64 | mi, | ||
| int64 | ma | ||
| ) |
| void operations_research::Assignment::SetStartValue | ( | const IntervalVar *const | var, |
| int64 | value | ||
| ) |
| void operations_research::Assignment::SetUnperformed | ( | const SequenceVar *const | var, |
| const std::vector< int > & | unperformed | ||
| ) |
| void operations_research::Assignment::SetValue | ( | const IntVar *const | var, |
| int64 | value | ||
| ) |
|
inline |
Definition at line 5022 of file constraint_solver.h.
|
inlineinherited |
Definition at line 3161 of file constraint_solver.h.
| int64 operations_research::Assignment::StartMax | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::StartMin | ( | const IntervalVar *const | var | ) | const |
| int64 operations_research::Assignment::StartValue | ( | const IntervalVar *const | var | ) | const |
| void operations_research::Assignment::Store | ( | ) |
|
inlineinherited |
This method unfreezes the propagation queue.
All modifications that happened when the queue was frozen will be processed.
Definition at line 3168 of file constraint_solver.h.
| const std::vector<int>& operations_research::Assignment::Unperformed | ( | const SequenceVar *const | var | ) | const |
| int64 operations_research::Assignment::Value | ( | const IntVar *const | var | ) | const |