|
CeresEngine 0.2.0
A game development framework
|
A 3-tuple weight for constraint strengths. More...
#include <CeresEngine/Foundation/Constraint/ConstraintStrength.hpp>
Public Member Functions | |
| constexpr | ConstraintSymbolicWeight () |
| constexpr | ConstraintSymbolicWeight (const double w1, const double w2, const double w3) |
| ConstraintSymbolicWeight & | negate () |
| ConstraintSymbolicWeight & | operator*= (double n) |
| ConstraintSymbolicWeight & | operator/= (double n) |
| ConstraintSymbolicWeight & | operator+= (const ConstraintSymbolicWeight &n) |
| ConstraintSymbolicWeight & | operator-= (const ConstraintSymbolicWeight &n) |
| bool | isNegative () const |
| constexpr double | asDouble () const |
| constexpr size_t | levels () const |
Static Public Attributes | |
| static const ConstraintSymbolicWeight | zero |
Private Attributes | |
| Array< double, 3 > | mValues |
Friends | |
| bool | operator< (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
| bool | operator<= (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
| bool | operator== (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
| bool | operator!= (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
| bool | operator> (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
| bool | operator>= (const ConstraintSymbolicWeight &lhs, const ConstraintSymbolicWeight &rhs) |
A 3-tuple weight for constraint strengths.
In the original implementation this was an n-tuple, but it has been fixed at 3 in the framework. The three elements correspond to the strong, medium and weak constraints. Every constraint can also have a weight (1 by default). Symbolic weights are then ordered lexicographically: strong weights always outclass medium weights, no matter what the values. The end effect is that strong constraints are satisfied before the medium ones, and the weak constraints are satisfied last. Within each of the three classes of constraints, you can make further adjustments by changing the weight.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
| bool CeresEngine::Constraint::ConstraintSymbolicWeight::isNegative | ( | ) | const |
|
inlineconstexpr |
| ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::negate | ( | ) |
| ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator*= | ( | double | n | ) |
| ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator+= | ( | const ConstraintSymbolicWeight & | n | ) |
| ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator-= | ( | const ConstraintSymbolicWeight & | n | ) |
| ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator/= | ( | double | n | ) |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
static |