Struct WeightedRelation
This is part of the syntactic sugar used for specifying constraints. This enum should be used as part of a constraint expression. See the module documentation for more information.
public readonly record struct WeightedRelation : IEquatable<WeightedRelation>
- Implements
- Inherited Members
Constructors
WeightedRelation(RelationalOperator, double)
This is part of the syntactic sugar used for specifying constraints. This enum should be used as part of a constraint expression. See the module documentation for more information.
public WeightedRelation(RelationalOperator Operator, double Strength)
Parameters
OperatorRelationalOperatorThe RelationalOperator.
StrengthdoubleThe Strength.
Properties
Operator
The RelationalOperator.
public RelationalOperator Operator { get; init; }
Property Value
Strength
The Strength.
public double Strength { get; init; }
Property Value
Methods
Eq(double)
Create new WeightedRelation with Equal.
public static WeightedRelation Eq(double strength)
Parameters
Returns
- WeightedRelation
New WeightedRelation instance with Operator as Equal and Strength as
strength.
GreaterOrEq(double)
Create new WeightedRelation with GreaterThanOrEqual.
public static WeightedRelation GreaterOrEq(double strength)
Parameters
strengthdoubleThe strength
Returns
- WeightedRelation
New WeightedRelation instance with Operator as LessThanOrEqual and Strength as
strength.
LessOrEq(double)
Create new WeightedRelation with LessThanOrEqual.
public static WeightedRelation LessOrEq(double strength)
Parameters
Returns
- WeightedRelation
New WeightedRelation instance with Operator as LessThanOrEqual and Strength as
strength.
Operators
operator |(double, WeightedRelation)
Create new PartialConstraint based on Expression and WeightedRelation.
public static PartialConstraint operator |(double strength, WeightedRelation relation)
Parameters
strengthdoubleThe strength.
relationWeightedRelationThe WeightedRelation.
Returns
- PartialConstraint
New PartialConstraint instance.
operator |(float, WeightedRelation)
Create new PartialConstraint based on Expression and WeightedRelation.
public static PartialConstraint operator |(float strength, WeightedRelation relation)
Parameters
strengthfloatThe strength.
relationWeightedRelationThe WeightedRelation.
Returns
- PartialConstraint
New PartialConstraint instance.