CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::Constraint::ConstraintSymbolicWeight Class Referencefinal

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)
 
ConstraintSymbolicWeightnegate ()
 
ConstraintSymbolicWeightoperator*= (double n)
 
ConstraintSymbolicWeightoperator/= (double n)
 
ConstraintSymbolicWeightoperator+= (const ConstraintSymbolicWeight &n)
 
ConstraintSymbolicWeightoperator-= (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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ConstraintSymbolicWeight() [1/2]

constexpr CeresEngine::Constraint::ConstraintSymbolicWeight::ConstraintSymbolicWeight ( )
inlineconstexpr

◆ ConstraintSymbolicWeight() [2/2]

constexpr CeresEngine::Constraint::ConstraintSymbolicWeight::ConstraintSymbolicWeight ( const double  w1,
const double  w2,
const double  w3 
)
inlineconstexpr

Member Function Documentation

◆ asDouble()

constexpr double CeresEngine::Constraint::ConstraintSymbolicWeight::asDouble ( ) const
inlineconstexpr

◆ isNegative()

bool CeresEngine::Constraint::ConstraintSymbolicWeight::isNegative ( ) const

◆ levels()

constexpr size_t CeresEngine::Constraint::ConstraintSymbolicWeight::levels ( ) const
inlineconstexpr

◆ negate()

ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::negate ( )

◆ operator*=()

ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator*= ( double  n)

◆ operator+=()

ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator+= ( const ConstraintSymbolicWeight n)

◆ operator-=()

ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator-= ( const ConstraintSymbolicWeight n)

◆ operator/=()

ConstraintSymbolicWeight & CeresEngine::Constraint::ConstraintSymbolicWeight::operator/= ( double  n)

Friends And Related Symbol Documentation

◆ operator!=

◆ operator<

◆ operator<=

◆ operator==

◆ operator>

◆ operator>=

Member Data Documentation

◆ mValues

Array<double, 3> CeresEngine::Constraint::ConstraintSymbolicWeight::mValues
private

◆ zero

const ConstraintSymbolicWeight CeresEngine::Constraint::ConstraintSymbolicWeight::zero
static

The documentation for this class was generated from the following file: