C++ Reference
C++ Reference: Routing
Detailed Description
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... | |
Member Typedef Documentation
◆ IntContainer
typedef AssignmentContainer<IntVar, IntVarElement> IntContainer |
Definition at line 5040 of file constraint_solver.h.
◆ IntervalContainer
Definition at line 5042 of file constraint_solver.h.
◆ SequenceContainer
Definition at line 5044 of file constraint_solver.h.
Constructor & Destructor Documentation
◆ Assignment() [1/2]
|
explicit |
◆ Assignment() [2/2]
|
explicit |
◆ ~Assignment()
|
override |
Member Function Documentation
◆ Activate() [1/3]
void Activate | ( | const IntervalVar *const | var | ) |
◆ Activate() [2/3]
void Activate | ( | const IntVar *const | var | ) |
◆ Activate() [3/3]
void Activate | ( | const SequenceVar *const | var | ) |
◆ Activated() [1/3]
bool Activated | ( | const IntervalVar *const | var | ) | const |
◆ Activated() [2/3]
bool Activated | ( | const IntVar *const | var | ) | const |
◆ Activated() [3/3]
bool Activated | ( | const SequenceVar *const | var | ) | const |
◆ ActivatedObjective()
bool ActivatedObjective | ( | ) | const |
◆ ActivateObjective()
void ActivateObjective | ( | ) |
◆ Add() [1/6]
void Add | ( | const std::vector< IntervalVar * > & | vars | ) |
◆ Add() [2/6]
void Add | ( | const std::vector< IntVar * > & | vars | ) |
◆ Add() [3/6]
void Add | ( | const std::vector< SequenceVar * > & | vars | ) |
◆ Add() [4/6]
IntervalVarElement * Add | ( | IntervalVar *const | var | ) |
◆ Add() [5/6]
IntVarElement * Add | ( | IntVar *const | var | ) |
◆ Add() [6/6]
SequenceVarElement * Add | ( | SequenceVar *const | var | ) |
◆ AddObjective()
void AddObjective | ( | IntVar *const | v | ) |
◆ AreAllElementsBound()
|
inline |
Definition at line 5173 of file constraint_solver.h.
◆ BackwardSequence()
const std::vector< int > & BackwardSequence | ( | const SequenceVar *const | var | ) | const |
◆ BaseName()
|
virtualinherited |
Returns a base name for automatic naming.
Reimplemented in BooleanVar.
◆ Bound()
bool Bound | ( | const IntVar *const | var | ) | const |
◆ Clear()
void Clear | ( | ) |
◆ ClearObjective()
|
inline |
Definition at line 5079 of file constraint_solver.h.
◆ Contains() [1/3]
bool Contains | ( | const IntervalVar *const | var | ) | const |
◆ Contains() [2/3]
bool Contains | ( | const IntVar *const | var | ) | const |
◆ Contains() [3/3]
bool Contains | ( | const SequenceVar *const | var | ) | const |
◆ Copy()
void Copy | ( | const Assignment * | assignment | ) |
Copies 'assignment' to the current assignment, clearing its previous content.
◆ CopyIntersection()
void CopyIntersection | ( | const Assignment * | assignment | ) |
Copies the intersection of the two assignments to the current assignment.
◆ Deactivate() [1/3]
void Deactivate | ( | const IntervalVar *const | var | ) |
◆ Deactivate() [2/3]
void Deactivate | ( | const IntVar *const | var | ) |
◆ Deactivate() [3/3]
void Deactivate | ( | const SequenceVar *const | var | ) |
◆ DeactivateObjective()
void DeactivateObjective | ( | ) |
◆ DebugString()
|
overridevirtual |
Reimplemented from PropagationBaseObject.
◆ DurationMax()
int64 DurationMax | ( | const IntervalVar *const | var | ) | const |
◆ DurationMin()
int64 DurationMin | ( | const IntervalVar *const | var | ) | const |
◆ DurationValue()
int64 DurationValue | ( | const IntervalVar *const | var | ) | const |
◆ Empty()
|
inline |
Definition at line 5051 of file constraint_solver.h.
◆ EndMax()
int64 EndMax | ( | const IntervalVar *const | var | ) | const |
◆ EndMin()
int64 EndMin | ( | const IntervalVar *const | var | ) | const |
◆ EndValue()
int64 EndValue | ( | const IntervalVar *const | var | ) | const |
◆ EnqueueAll()
|
inherited |
◆ EnqueueDelayedDemon()
|
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.
◆ EnqueueVar()
|
inlineinherited |
Definition at line 3193 of file constraint_solver.h.
◆ ExecuteAll()
|
inherited |
◆ FastAdd() [1/3]
IntervalVarElement * FastAdd | ( | IntervalVar *const | var | ) |
Adds without checking if variable has been previously added.
◆ FastAdd() [2/3]
IntVarElement * FastAdd | ( | IntVar *const | var | ) |
Adds without checking if variable has been previously added.
◆ FastAdd() [3/3]
SequenceVarElement * FastAdd | ( | SequenceVar *const | var | ) |
Adds without checking if the variable had been previously added.
◆ ForwardSequence()
const std::vector< int > & ForwardSequence | ( | const SequenceVar *const | var | ) | const |
◆ FreezeQueue()
|
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.
◆ HasName()
|
inherited |
Returns whether the object has been named or not.
◆ HasObjective()
|
inline |
Definition at line 5081 of file constraint_solver.h.
◆ IntervalVarContainer()
|
inline |
Definition at line 5191 of file constraint_solver.h.
◆ IntVarContainer()
|
inline |
Definition at line 5189 of file constraint_solver.h.
◆ Load() [1/3]
void Load | ( | const AssignmentProto & | assignment_proto | ) |
#if !defined(SWIG)
◆ Load() [2/3]
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).
◆ Load() [3/3]
bool Load | ( | File * | file | ) |
◆ Max()
int64 Max | ( | const IntVar *const | var | ) | const |
◆ Min()
int64 Min | ( | const IntVar *const | var | ) | const |
◆ MutableIntervalVarContainer()
|
inline |
Definition at line 5194 of file constraint_solver.h.
◆ MutableIntVarContainer()
|
inline |
Definition at line 5190 of file constraint_solver.h.
◆ MutableSequenceVarContainer()
|
inline |
Definition at line 5200 of file constraint_solver.h.
◆ name()
|
virtualinherited |
Object naming.
◆ NumIntervalVars()
|
inline |
Definition at line 5059 of file constraint_solver.h.
◆ NumIntVars()
|
inline |
Definition at line 5058 of file constraint_solver.h.
◆ NumSequenceVars()
|
inline |
Definition at line 5060 of file constraint_solver.h.
◆ Objective()
IntVar * Objective | ( | ) | const |
◆ ObjectiveBound()
bool ObjectiveBound | ( | ) | const |
◆ ObjectiveMax()
int64 ObjectiveMax | ( | ) | const |
◆ ObjectiveMin()
int64 ObjectiveMin | ( | ) | const |
◆ ObjectiveValue()
int64 ObjectiveValue | ( | ) | const |
◆ operator!=()
|
inline |
Definition at line 5209 of file constraint_solver.h.
◆ operator==()
|
inline |
Definition at line 5203 of file constraint_solver.h.
◆ PerformedMax()
int64 PerformedMax | ( | const IntervalVar *const | var | ) | const |
◆ PerformedMin()
int64 PerformedMin | ( | const IntervalVar *const | var | ) | const |
◆ PerformedValue()
int64 PerformedValue | ( | const IntervalVar *const | var | ) | const |
◆ reset_action_on_fail()
|
inlineinherited |
This method clears the failure callback.
Definition at line 3206 of file constraint_solver.h.
◆ Restore()
void Restore | ( | ) |
◆ Save() [1/3]
void Save | ( | AssignmentProto *const | assignment_proto | ) | const |
◆ Save() [2/3]
bool Save | ( | const std::string & | filename | ) | const |
Saves the assignment to a file.
◆ Save() [3/3]
bool Save | ( | File * | file | ) | const |
◆ SequenceVarContainer()
|
inline |
Definition at line 5197 of file constraint_solver.h.
◆ set_action_on_fail()
|
inlineinherited |
Definition at line 3200 of file constraint_solver.h.
◆ set_name()
|
inherited |
◆ set_variable_to_clean_on_fail()
|
inlineinherited |
Shortcut for variable cleaner.
Definition at line 3209 of file constraint_solver.h.
◆ SetBackwardSequence()
void SetBackwardSequence | ( | const SequenceVar *const | var, |
const std::vector< int > & | backward_sequence | ||
) |
◆ SetDurationMax()
void SetDurationMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetDurationMin()
void SetDurationMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetDurationRange()
void SetDurationRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
◆ SetDurationValue()
void SetDurationValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
◆ SetEndMax()
void SetEndMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetEndMin()
void SetEndMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetEndRange()
void SetEndRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
◆ SetEndValue()
void SetEndValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
◆ SetForwardSequence()
void SetForwardSequence | ( | const SequenceVar *const | var, |
const std::vector< int > & | forward_sequence | ||
) |
◆ SetMax()
void SetMax | ( | const IntVar *const | var, |
int64 | m | ||
) |
◆ SetMin()
void SetMin | ( | const IntVar *const | var, |
int64 | m | ||
) |
◆ SetObjectiveMax()
void SetObjectiveMax | ( | int64 | m | ) |
◆ SetObjectiveMin()
void SetObjectiveMin | ( | int64 | m | ) |
◆ SetObjectiveRange()
void SetObjectiveRange | ( | int64 | l, |
int64 | u | ||
) |
◆ SetObjectiveValue()
void SetObjectiveValue | ( | int64 | value | ) |
◆ SetPerformedMax()
void SetPerformedMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetPerformedMin()
void SetPerformedMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetPerformedRange()
void SetPerformedRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
◆ SetPerformedValue()
void SetPerformedValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
◆ SetRange()
void SetRange | ( | const IntVar *const | var, |
int64 | l, | ||
int64 | u | ||
) |
◆ SetSequence()
void SetSequence | ( | const SequenceVar *const | var, |
const std::vector< int > & | forward_sequence, | ||
const std::vector< int > & | backward_sequence, | ||
const std::vector< int > & | unperformed | ||
) |
◆ SetStartMax()
void SetStartMax | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetStartMin()
void SetStartMin | ( | const IntervalVar *const | var, |
int64 | m | ||
) |
◆ SetStartRange()
void SetStartRange | ( | const IntervalVar *const | var, |
int64 | mi, | ||
int64 | ma | ||
) |
◆ SetStartValue()
void SetStartValue | ( | const IntervalVar *const | var, |
int64 | value | ||
) |
◆ SetUnperformed()
void SetUnperformed | ( | const SequenceVar *const | var, |
const std::vector< int > & | unperformed | ||
) |
◆ SetValue()
void SetValue | ( | const IntVar *const | var, |
int64 | value | ||
) |
◆ Size()
|
inline |
Definition at line 5055 of file constraint_solver.h.
◆ solver()
|
inlineinherited |
Definition at line 3179 of file constraint_solver.h.
◆ StartMax()
int64 StartMax | ( | const IntervalVar *const | var | ) | const |
◆ StartMin()
int64 StartMin | ( | const IntervalVar *const | var | ) | const |
◆ StartValue()
int64 StartValue | ( | const IntervalVar *const | var | ) | const |
◆ Store()
void Store | ( | ) |
◆ UnfreezeQueue()
|
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.
◆ Unperformed()
const std::vector< int > & Unperformed | ( | const SequenceVar *const | var | ) | const |
◆ Value()
int64 Value | ( | const IntVar *const | var | ) | const |
The documentation for this class was generated from the following file: