Skip to main content

OpenTD .NET8 reference 2025 R2

OpenTD.Results.Dataset.PercentDifferenceCompareData Class Reference

Last update: 16.07.2025

This ICompareData implementation compares data of a single subtype (T, TL, etc.) for all applicable common entities (nodes or lumps or... etc.) between two datasets by examining the percent difference between pairs of values at each record for each common-named entity. For this comparison, Datasets must have the same number of records. More...

Inheritance diagram for OpenTD.Results.Dataset.PercentDifferenceCompareData:
OpenTD.Results.Dataset.CompareDataOpenTD.Results.Dataset.ICompareDataOpenTD.Results.Dataset.ICompareData

Public Member Functions

 PercentDifferenceCompareData (IComparerInput comparerInput, IComparerOutput comparerOutput)
 
override void Compare (string name, DataSubtype subtype, IEnumerable< string > commonNames, IEnumerable< long > commonIndicesA, IEnumerable< long > commonIndicesB, bool msgOnSuccess=true)
 This method implements the comparison algorithm.
 

Properties

double PercentTol = 1.0 [get, set]
 Percent tolerance to use when comparing doubles. Defaults to 1.0.
 
double Floor = 0.0 [get, set]
 Comparison floor for comparing doubles. If the absolute value of a datapoint in dataset A is less than this value, the percent difference for that comparison is set to zero, resulting in that comparison being ignored. All comparisons are in SI units, so set the floor in SI units. Defaults to 0.
 
IComparerInput ComparerInput [get, set]
 The Comparer will send data from the datasets through this member.
 
IComparerOutput ComparerOutput [get, set]
 Send output from the comparison to the Comparer through this member.
 

Detailed Description

This ICompareData implementation compares data of a single subtype (T, TL, etc.) for all applicable common entities (nodes or lumps or... etc.) between two datasets by examining the percent difference between pairs of values at each record for each common-named entity. For this comparison, Datasets must have the same number of records.

See also
OpenTD.Results.Dataset.ICompareData

Constructor & Destructor Documentation

◆ PercentDifferenceCompareData()

OpenTD.Results.Dataset.PercentDifferenceCompareData.PercentDifferenceCompareData ( IComparerInput comparerInput,
IComparerOutput comparerOutput )
inline

Member Function Documentation

◆ Compare()

override void OpenTD.Results.Dataset.PercentDifferenceCompareData.Compare ( string name,
DataSubtype subtype,
IEnumerable< string > commonNames,
IEnumerable< long > commonIndicesA,
IEnumerable< long > commonIndicesB,
bool msgOnSuccess = true )
inline

This method implements the comparison algorithm.

Parameters
nameThis is a descriptive name for the data being compared. Use it in ComparerOutput messages.
subtypeThis is the type of data (T, TL, etc.) to compare.
commonNamesThis is a list of Sinda names (MAIN.1, WALL.100, etc.) of entities that hold data of subtype and are common to both datasets. For example, if subtype is PL, then commonNames would be names of lumps that are common between the datasets. The comparison should be performed over all of the items in this list.
commonIndicesAThese are the internal indices to the commonNames list for Dataset A.
commonIndicesBThese are the internal indices to the commonNames list for Dataset B.
msgOnSuccessIf true, use ComparerOutput to write a message if this comparison is successful.

Implements OpenTD.Results.Dataset.ICompareData.

Property Documentation

◆ ComparerInput

IComparerInput OpenTD.Results.Dataset.CompareData.ComparerInput
getsetinherited

The Comparer will send data from the datasets through this member.

Implements OpenTD.Results.Dataset.ICompareData.

◆ ComparerOutput

IComparerOutput OpenTD.Results.Dataset.CompareData.ComparerOutput
getsetinherited

Send output from the comparison to the Comparer through this member.

Implements OpenTD.Results.Dataset.ICompareData.

◆ Floor

double OpenTD.Results.Dataset.PercentDifferenceCompareData.Floor = 0.0
getset

Comparison floor for comparing doubles. If the absolute value of a datapoint in dataset A is less than this value, the percent difference for that comparison is set to zero, resulting in that comparison being ignored. All comparisons are in SI units, so set the floor in SI units. Defaults to 0.

◆ PercentTol

double OpenTD.Results.Dataset.PercentDifferenceCompareData.PercentTol = 1.0
getset

Percent tolerance to use when comparing doubles. Defaults to 1.0.


The documentation for this class was generated from the following file:
  • C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/OpenTD/OpenTD.Results/Dataset/PercentDifferenceCompareData.cs

Connect with Ansys