Represents a symbolic variable.
- Note
- Expression::Evaluate and Formula::Evaluate methods take a symbolic environment (Variable → double) and a random number generator. When an expression or a formula includes random variables,
Evaluate
methods use the random number generator to draw a number for a random variable from the given distribution. Then this numeric value is used to substitute all the occurrences of the corresponding random variable in an expression or a formula.
#include <drake/common/symbolic/expression/variable.h>
◆ Id
◆ Type
Supported types of symbolic variables.
Enumerator |
---|
CONTINUOUS | A CONTINUOUS variable takes a double value.
|
INTEGER | An INTEGER variable takes an int value.
|
BINARY | A BINARY variable takes an integer value from {0, 1}.
|
BOOLEAN | A BOOLEAN variable takes a bool value.
|
RANDOM_UNIFORM | A random variable whose value will be drawn from uniform real distributed ∈ [0,1).
|
RANDOM_GAUSSIAN | A random variable whose value will be drawn from mean-zero, unit-variance normal.
|
RANDOM_EXPONENTIAL | A random variable whose value will be drawn from exponential distribution with λ=1.
|
◆ Variable() [1/5]
◆ Variable() [2/5]
◆ Variable() [3/5]
Constructs a default variable of type CONTINUOUS with an Id
of zero.
All default-constructed variables are considered the same variable by the equality operator (==). Similarly, a moved-from variable is also identical to a default-constructed variable (in both its name
and its Id
).
◆ Variable() [4/5]
Constructs a default value.
This overload is used by Eigen when EIGEN_INITIALIZE_MATRICES_BY_ZERO is enabled.
◆ Variable() [5/5]
Constructs a variable with a string.
If not specified, it has CONTINUOUS type by default.
◆ ~Variable()
◆ equal_to()
bool equal_to |
( |
const Variable & |
v | ) |
const |
Checks the equality of two variables based on their ID values.
◆ get_id()
◆ get_name()
std::string get_name |
( |
| ) |
const |
◆ get_type()
◆ is_dummy()
Checks if this is the variable created by the default constructor.
◆ less()
Compares two variables based on their ID values.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ to_string()
std::string to_string |
( |
| ) |
const |
◆ hash_append
void hash_append |
( |
HashAlgorithm & |
hasher, |
|
|
const Variable & |
item |
|
) |
| |
|
friend |
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
const Variable & |
var |
|
) |
| |
|
friend |
The documentation for this class was generated from the following file: