Each vertex in the graph has a corresponding ConvexSet, and a std::string name.
|
| ~Vertex () |
|
VertexId | id () const |
| Returns the unique identifier associated with this Vertex. More...
|
|
int | ambient_dimension () const |
| Returns the ambient dimension of the ConvexSet. More...
|
|
const std::string & | name () const |
| Returns the name of the vertex. More...
|
|
const VectorX< symbolic::Variable > & | x () const |
| Returns a decision variable corresponding to an element of the ConvexSet, which can be used for constructing symbolic::Expression costs and constraints. More...
|
|
const ConvexSet & | set () const |
| Returns a const reference to the underlying ConvexSet. More...
|
|
solvers::Binding< solvers::Cost > | AddCost (const symbolic::Expression &e, const std::unordered_set< Transcription > &use_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) |
| Adds a cost to this vertex, described by a symbolic::Expression e containing only elements of x() as variables. More...
|
|
solvers::Binding< solvers::Cost > | AddCost (const solvers::Binding< solvers::Cost > &binding, const std::unordered_set< Transcription > &use_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) |
| Adds a cost to this vertex. More...
|
|
solvers::Binding< solvers::Constraint > | AddConstraint (const symbolic::Formula &f, const std::unordered_set< Transcription > &use_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) |
| Adds a constraint to this vertex. More...
|
|
solvers::Binding< solvers::Constraint > | AddConstraint (const solvers::Binding< solvers::Constraint > &binding, const std::unordered_set< Transcription > &use_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) |
| Adds a constraint to this vertex. More...
|
|
std::vector< solvers::Binding< solvers::Cost > > | GetCosts (const std::unordered_set< Transcription > &used_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) const |
| Returns costs on this vertex. More...
|
|
std::vector< solvers::Binding< solvers::Constraint > > | GetConstraints (const std::unordered_set< Transcription > &used_in_transcription={ Transcription::kMIP, Transcription::kRelaxation, Transcription::kRestriction}) const |
| Returns constraints on this vertex. More...
|
|
std::optional< double > | GetSolutionCost (const solvers::MathematicalProgramResult &result) const |
| Returns the sum of the costs associated with this vertex in result , or std::nullopt if no solution for this vertex is available. More...
|
|
std::optional< double > | GetSolutionCost (const solvers::MathematicalProgramResult &result, const solvers::Binding< solvers::Cost > &cost) const |
| Returns the cost associated with the cost binding on this vertex in result , or std::nullopt if no solution for this vertex is available. More...
|
|
std::optional< Eigen::VectorXd > | GetSolution (const solvers::MathematicalProgramResult &result) const |
| Returns the solution of x() in result , or std::nullopt if no solution for this vertex is available. More...
|
|
const std::vector< Edge * > & | incoming_edges () const |
|
const std::vector< Edge * > & | outgoing_edges () const |
|
|
| Vertex (const Vertex &)=delete |
|
Vertex & | operator= (const Vertex &)=delete |
|
| Vertex (Vertex &&)=delete |
|
Vertex & | operator= (Vertex &&)=delete |
|
Adds a cost to this vertex, described by a symbolic::Expression e
containing only elements of x() as variables.
For technical reasons relating to being able to "turn-off" the cost on inactive vertices, all costs are eventually implemented with a slack variable and a constraint:
min g(x) ⇒ min ℓ, s.t. ℓ ≥ g(x).
You must use GetSolutionCost() to retrieve the cost of the solution, rather than evaluating the cost directly, in order to get consistent behavior when solving with the different GCS transcriptions.
- Parameters
-
use_in_transcription | specifies the components of the problem to which the constraint should be added. |
- Note
- Linear costs lead to negative costs if decision variables are not properly constrained. Users may want to check that the solution does not contain negative costs.
- Returns
- the added cost, g(x).
- Exceptions
-
std::exception | if e.GetVariables() is not a subset of x(). |
std::exception | if no transcription is specified. |
Adds a cost to this vertex.
binding
must contain only elements of x() as variables. For technical reasons relating to being able to "turn-off" the cost on inactive vertices, all costs are eventually implemented with a slack variable and a constraint:
min g(x) ⇒ min ℓ, s.t. ℓ ≥ g(x).
You must use GetSolutionCost() to retrieve the cost of the solution, rather than evaluating the cost directly, in order to get consistent behavior when solving with the different GCS transcriptions.
- Parameters
-
use_in_transcription | specifies the components of the problem to which the constraint should be added. |
- Note
- Linear costs lead to negative costs if decision variables are not properly constrained. Users may want to check that the solution does not contain negative costs.
- Returns
- the added cost, g(x).
- Exceptions
-
std::exception | if binding.variables() is not a subset of x(). |
std::exception | if no transcription is specified. |