Class PatternWeight
- Namespace
- Cratis.Chronicle.Concepts.Patterns
- Assembly
- Cratis.Chronicle.dll
Represents the recency-weighted strength of a pattern.
public record PatternWeight : ConceptAs<double>, IComparable<ConceptAs<double>>, IComparable<double>, IComparable, IEquatable<ConceptAs<double>>, IEquatable<PatternWeight>
- Inheritance
-
PatternWeight
- Implements
- Inherited Members
- Extension Methods
Remarks
Unlike PatternOccurrences, weight decays as a pattern goes unseen, so a behavior somebody stopped months ago sinks below the threshold and is pruned instead of competing forever with what they do now.
Constructors
PatternWeight(PatternWeight)
protected PatternWeight(PatternWeight original)
Parameters
originalPatternWeight
PatternWeight(double)
Represents the recency-weighted strength of a pattern.
public PatternWeight(double Value)
Parameters
ValuedoubleThe actual value.
Remarks
Unlike PatternOccurrences, weight decays as a pattern goes unseen, so a behavior somebody stopped months ago sinks below the threshold and is pruned instead of competing forever with what they do now.
Fields
None
Represents no weight at all.
public static readonly PatternWeight None
Field Value
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Methods
Deconstruct(out double)
public void Deconstruct(out double Value)
Parameters
Valuedouble
Equals(PatternWeight?)
public virtual bool Equals(PatternWeight? other)
Parameters
otherPatternWeight
Returns
Equals(ConceptAs<double>?)
public override sealed bool Equals(ConceptAs<double>? other)
Parameters
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
Operators
operator ==(PatternWeight?, PatternWeight?)
public static bool operator ==(PatternWeight? left, PatternWeight? right)
Parameters
leftPatternWeightrightPatternWeight
Returns
implicit operator PatternWeight(double)
Implicitly convert from a double to PatternWeight.
public static implicit operator PatternWeight(double value)
Parameters
valuedoubleValue to convert from.
Returns
operator !=(PatternWeight?, PatternWeight?)
public static bool operator !=(PatternWeight? left, PatternWeight? right)
Parameters
leftPatternWeightrightPatternWeight