Class Relation<T>
Generic form of Relation, which provides RateDataMatch and other methods
Inherited Members
Namespace: Unity.MARS
Syntax
public abstract class Relation<T> : Relation, ISimulatable, IRelation<T>, IRelation, IRelationBase, IConditionBase, IRequiresTraits<T>, IRequiresTraits, ICreateFromDataPair
Type Parameters
Name | Description |
---|---|
T | The type of data this relation will be rating |
Methods
ConformToData(TraitDataSnapshot, TraitDataSnapshot)
Modifies the properties so that the data is acceptable for this relation
Declaration
public virtual void ConformToData(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | child1Data | The data for child 1 that should pass this relation after this method is called |
TraitDataSnapshot | child2Data | The data for child 2 that should pass this relation after this method is called |
Implements
FormatDataString(TraitDataSnapshot, TraitDataSnapshot)
Formats data into a string that is human-readable and appropriate for the relation
Declaration
public virtual string FormatDataString(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | child1Data | The data for child 1 |
TraitDataSnapshot | child2Data | The data for child 2 |
Returns
Type | Description |
---|---|
String | The formatted string |
Implements
OptimizeForData(TraitDataSnapshot, TraitDataSnapshot)
Modifies the properties so that the data is the optimal data for this relation
Declaration
public virtual void OptimizeForData(TraitDataSnapshot child1Data, TraitDataSnapshot child2Data)
Parameters
Type | Name | Description |
---|---|---|
TraitDataSnapshot | child1Data | The data that should be optimal for child 1 after this method is called |
TraitDataSnapshot | child2Data | The data that should be optimal for child 2 after this method is called |
Implements
RateDataMatch(ref T, ref T)
Compares the given trait data to the filter function
Declaration
public abstract float RateDataMatch(ref T child1Data, ref T child2Data)
Parameters
Type | Name | Description |
---|---|---|
T | child1Data | The data being filtered against for the first child |
T | child2Data | The data being filtered against for the second child |
Returns
Type | Description |
---|---|
Single | A number from 0 to 1 indicating how well a set of data matches |