Click or drag to resize

StoppingConditionConstraint Class

The definition for a StoppingConditionConstraintEvaluator. These constraints act as additional criteria for a StoppingCondition. The constraints will take the current state of propagation and return a Boolean for if this state is aloud to potentially stop propagation.
Inheritance Hierarchy

Namespace:  AGI.Foundation.StoppingConditions
Assembly:  AGI.Foundation.Models (in AGI.Foundation.Models.dll) Version: 24.1.418.0 (24.1.418.0)
Syntax
public abstract class StoppingConditionConstraint : DefinitionalObject

The StoppingConditionConstraint type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyIsFrozen
Gets a value indicating whether this object is frozen. A frozen object cannot be modified and an ObjectFrozenException will be thrown if an attempt is made to do so.
(Inherited from DefinitionalObject.)
Public propertyName
Gets or sets the optional name of this StoppingConditionConstraint.
Public propertyWhenToCheck
Gets or sets when to check the StoppingConditionConstraint (when a stop is detected or found).
Top
Methods
  NameDescription
Protected methodCheckForSameDefinition(DefinitionalObject)
Checks to determine if another instance has the same definition as this instance and returns if it does. Derived classes MUST override this method and check all new fields introduced by the derived class for definitional equivalence. It is NOT necessary to check base class fields because the base class will already have done that. When overriding this method, you should NOT call the base implementation because it will return for all derived-class instances. Derived classes should check the type of other to preserve the symmetric nature of IsSameDefinition(Object).
(Overrides DefinitionalObjectCheckForSameDefinition(DefinitionalObject).)
Protected methodCheckForSameDefinition(StoppingConditionConstraint)
Checks to determine if another instance has the same definition as this instance and returns if it does. Derived classes MUST override this method and check all new fields introduced by the derived class for definitional equivalence. It is NOT necessary to check base class fields because the base class will already have done that. When overriding this method, you should NOT call the base implementation because it will return for all derived-class instances. Derived classes should check the type of other to preserve the symmetric nature of IsSameDefinition(Object).
Public methodClone
Clones this object using the specified context.
(Inherited from DefinitionalObject.)
Protected methodComputeCurrentDefinitionHashCode
Computes a hash code based on the current properties of this object. Derived classes MUST override this method and compute a hash code that combines: a unique hash code seed, the base implementation result, and the hash codes of all new fields introduced by the derived class which are used in the CheckForSameDefinition(DefinitionalObject) method.
(Overrides DefinitionalObjectComputeCurrentDefinitionHashCode.)
Public methodEnumerateDependencies
Enumerates the dependencies of this object by calling EnumerateT(T) for each object that this object directly depends upon. Derived classes which contain additional dependencies MUST override this method, call the base implementation, and enumerate dependencies introduced by the derived class.
(Inherited from DefinitionalObject.)
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFreeze
Freezes this object. Further attempts to modify it will result in an ObjectFrozenException.
(Inherited from DefinitionalObject.)
Protected methodFreezeAggregatedObjects
Called by Freeze to also freeze any objects that are considered to be a part of this object. Derived classes which contain additional aggregated objects MUST override this method, call the base implementation, and freeze aggregated objects introduced by the derived class. The objects that need to be frozen in this method are frequently created in this object's constructor and are not settable via properties.
(Inherited from DefinitionalObject.)
Public methodGetDefinitionHashCode
Gets a hash code representing the definition of this object.
(Inherited from DefinitionalObject.)
Public methodGetEvaluator
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIsSameDefinition
Determines if this object has the same definition as another object.
(Inherited from DefinitionalObject.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodThrowIfFrozen
Throws ObjectFrozenException if this object IsFrozen. This method should be called from any method or property that modifies this object.
(Inherited from DefinitionalObject.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Often there are times when a StoppingCondition needs additional criteria to truly stop on the desired event. Simply combining StoppingConditions usually wouldn't work; if you would AND two conditions together, they both must have their own relevant events at the exact same time. It is more reasonable to add constraints to a stopping condition that could, instead of stopping at some particular event, could instead signal that some other event has gone by, or has not happened yet.

See the Stopping Conditions topic for more detail on how to use stopping condition constraints.

Although you can create any any constraint as long as it returns or , the common use case of computing some single value from the passed in state and comparing it to a threshold should usually be handled by the ThresholdStoppingConditionConstraint.

See Also