Skip to main content

OpenTD .NET8 reference 2025 R2

OpenTD.Results.Dataset.Comparer Class Reference

Last update: 16.07.2025

Use to compare two Datasets. More...

Inheritance diagram for OpenTD.Results.Dataset.Comparer:
OpenTD.Results.Dataset.IComparerInputOpenTD.Results.Dataset.IComparerOutput

Public Member Functions

 Comparer (IDataset a, IDataset b)
 Initializes a new instance of the Comparer class.
 
void CloseDatasets ()
 
void ReOpenDatasets ()
 
bool Run ()
 Compares the datasets. Writes a report to the string Message. Returns true if the Datasets are found to be equal for all of the tests performed.
 
List< ExceedancePlot > PlotExceedances (int maxPerSubtype=1, IEnumerable< DataSubtype > subtypes=null)
 
bool SaveExceedancePlots (string directoryPath, out string resultMsg, string prefix="", int maxPerSubtype=1, IEnumerable< DataSubtype > subtypes=null)
 
List< ExceedancePlot > GetExceedancePlots (int maxPerSubtype=1, IEnumerable< DataSubtype > subtypes=null)
 
override string ToString ()
 
void _writeline (string msg)
 Do not use.
 
void _writesuccess (string msg)
 Do not use.
 
void _markdiff (string msg)
 Do not use.
 

Properties

IDataset DatasetA [get]
 One of the datasets to compare.
 
IDataset DatasetB [get]
 One of the datasets to compare.
 
List< long > RecNumsA [get]
 A list of the record numbers in DatasetA.
 
List< long > RecNumsB [get]
 A list of the record numbers in DatasetB.
 
List< double > TimesA [get]
 A list of the times in DatasetA.
 
List< double > TimesB [get]
 A list of the times in DatasetB.
 
Dictionary< StandardDataSubtypes, ICompareData > ComparisonMethods [get, set]
 This dispatch table determines what comparison methods will be used for each StandardDataSubtype (T, TL, etc.). All others not listed will use the DefaultComparisonMethod algorithm.
 
ICompareData DefaultComparisonMethod [get, set]
 For StandardDataSubtypes (T, TL, etc.) not listed in the ComparisonMethods dispatch table, use this comparison algorithm.
 
double TimePercentTol [get, set]
 Tolerance for comparison of time series.
 
bool CompareRecords [get, set]
 Determines whether Run() will compare the number of records.
 
bool CompareTimes [get, set]
 Determines whether Run() will compare the max and min times.
 
bool CompareThermalSubmodels [get, set]
 Determines whether Run() will compare the names of the thermal submodels.
 
bool CompareNodeNames [get, set]
 Determines whether Run() will compare the ID's of nodes in common thermal submodels.
 
bool CompareConductorNames [get, set]
 Determines whether Run() will compare the ID's of conductors in common thermal submodels.
 
bool CompareFluidSubmodels [get, set]
 Determines whether Run() will compare the names of the fluid submodels.
 
bool CompareLumpNames [get, set]
 Determines whether Run() will compare the ID's of lumps in common fluid submodels.
 
bool ComparePathNames [get, set]
 Determines whether Run() will compare the ID's of paths in common fluid submodels.
 
bool CompareTieNames [get, set]
 Determines whether Run() will compare the ID's of ties in common fluid submodels.
 
bool CompareFTieNames [get, set]
 Determines whether Run() will compare the ID's of FTies in common fluid submodels.
 
bool CompareIFaceNames [get, set]
 Determines whether Run() will compare the ID's of IFaces in common fluid submodels.
 
bool CompareRegisterNames [get, set]
 Determines whether Run() will compare the names of registers.
 
List< FullStandardDataSubtype > DataToCompare [get, set]
 List of FullStandardDataSubtype (T, TL, PL, etc.) to compare for all common-name entities. For example, if TL is in the list, then Run() will find all the lump names that are common between the two Datasets and compare all values of TL for all of them.
 
List< string > RegisterDataToCompare [get, set]
 List of registers to compare, if common between datasets. If list is empty, will compare data for all common registers.
 
bool CompareJustFinalRecord [get, set]
 Determines whether Run() will compare just the final data values in each dataset. If true, will also ignore differences in number of records and won't compare times. Defaults to false.
 
Dictionary< DataSubtype, List< Exceedance > > Exceedances [get]
 After calling Run(), contains information about data items that exceeded the allowable percent tolerance. Contains a dictionary with one entry for each FullStandardDataSubtype (T, TL, PL, etc.) tested. The entries are lists of all items that exceed the percent tolerance, in descending order by exceedance amount.
 
string Message [get]
 Run() outputs a report to this string.
 

Detailed Description

Use to compare two Datasets.

See also
OpenTD.Results.Dataset.Dataset

= 1.0;

Constructor & Destructor Documentation

◆ Comparer()

OpenTD.Results.Dataset.Comparer.Comparer ( IDataset a,
IDataset b )
inline

Initializes a new instance of the Comparer class.

Parameters
aDataset A
bDataset B

Member Function Documentation

◆ _markdiff()

void OpenTD.Results.Dataset.Comparer._markdiff ( string msg)
inline

Do not use.

Parameters
msg

Implements OpenTD.Results.Dataset.IComparerOutput.

◆ _writeline()

void OpenTD.Results.Dataset.Comparer._writeline ( string msg)
inline

Do not use.

Parameters
msg

Implements OpenTD.Results.Dataset.IComparerOutput.

◆ _writesuccess()

void OpenTD.Results.Dataset.Comparer._writesuccess ( string msg)
inline

Do not use.

Parameters
msg

Implements OpenTD.Results.Dataset.IComparerOutput.

◆ CloseDatasets()

void OpenTD.Results.Dataset.Comparer.CloseDatasets ( )
inline

◆ GetExceedancePlots()

List< ExceedancePlot > OpenTD.Results.Dataset.Comparer.GetExceedancePlots ( int maxPerSubtype = 1,
IEnumerable< DataSubtype > subtypes = null )
inline

◆ PlotExceedances()

List< ExceedancePlot > OpenTD.Results.Dataset.Comparer.PlotExceedances ( int maxPerSubtype = 1,
IEnumerable< DataSubtype > subtypes = null )
inline

◆ ReOpenDatasets()

void OpenTD.Results.Dataset.Comparer.ReOpenDatasets ( )
inline

◆ Run()

bool OpenTD.Results.Dataset.Comparer.Run ( )
inline

Compares the datasets. Writes a report to the string Message. Returns true if the Datasets are found to be equal for all of the tests performed.

Returns
true if all tests performed indicate the Datasets are equal, false otherwise.
See also
OpenTD.Results.Dataset.Comparer.Message

◆ SaveExceedancePlots()

bool OpenTD.Results.Dataset.Comparer.SaveExceedancePlots ( string directoryPath,
out string resultMsg,
string prefix = "",
int maxPerSubtype = 1,
IEnumerable< DataSubtype > subtypes = null )
inline

◆ ToString()

override string OpenTD.Results.Dataset.Comparer.ToString ( )
inline

Property Documentation

◆ CompareConductorNames

bool OpenTD.Results.Dataset.Comparer.CompareConductorNames
getset

Determines whether Run() will compare the ID's of conductors in common thermal submodels.

◆ CompareFluidSubmodels

bool OpenTD.Results.Dataset.Comparer.CompareFluidSubmodels
getset

Determines whether Run() will compare the names of the fluid submodels.

◆ CompareFTieNames

bool OpenTD.Results.Dataset.Comparer.CompareFTieNames
getset

Determines whether Run() will compare the ID's of FTies in common fluid submodels.

◆ CompareIFaceNames

bool OpenTD.Results.Dataset.Comparer.CompareIFaceNames
getset

Determines whether Run() will compare the ID's of IFaces in common fluid submodels.

◆ CompareJustFinalRecord

bool OpenTD.Results.Dataset.Comparer.CompareJustFinalRecord
getset

Determines whether Run() will compare just the final data values in each dataset. If true, will also ignore differences in number of records and won't compare times. Defaults to false.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ CompareLumpNames

bool OpenTD.Results.Dataset.Comparer.CompareLumpNames
getset

Determines whether Run() will compare the ID's of lumps in common fluid submodels.

◆ CompareNodeNames

bool OpenTD.Results.Dataset.Comparer.CompareNodeNames
getset

Determines whether Run() will compare the ID's of nodes in common thermal submodels.

◆ ComparePathNames

bool OpenTD.Results.Dataset.Comparer.ComparePathNames
getset

Determines whether Run() will compare the ID's of paths in common fluid submodels.

◆ CompareRecords

bool OpenTD.Results.Dataset.Comparer.CompareRecords
getset

Determines whether Run() will compare the number of records.

◆ CompareRegisterNames

bool OpenTD.Results.Dataset.Comparer.CompareRegisterNames
getset

Determines whether Run() will compare the names of registers.

◆ CompareThermalSubmodels

bool OpenTD.Results.Dataset.Comparer.CompareThermalSubmodels
getset

Determines whether Run() will compare the names of the thermal submodels.

◆ CompareTieNames

bool OpenTD.Results.Dataset.Comparer.CompareTieNames
getset

Determines whether Run() will compare the ID's of ties in common fluid submodels.

◆ CompareTimes

bool OpenTD.Results.Dataset.Comparer.CompareTimes
getset

Determines whether Run() will compare the max and min times.

◆ ComparisonMethods

Dictionary<StandardDataSubtypes, ICompareData> OpenTD.Results.Dataset.Comparer.ComparisonMethods
getset

This dispatch table determines what comparison methods will be used for each StandardDataSubtype (T, TL, etc.). All others not listed will use the DefaultComparisonMethod algorithm.

See also
OpenTD.Results.Dataset.DataSubtype, OpenTD.Results.Dataset.Comparer.DefaultComparisonMethod, OpenTD.Results.Dataset.StandardDataSubtypes

◆ DatasetA

IDataset OpenTD.Results.Dataset.Comparer.DatasetA
get

One of the datasets to compare.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ DatasetB

IDataset OpenTD.Results.Dataset.Comparer.DatasetB
get

One of the datasets to compare.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ DataToCompare

List<FullStandardDataSubtype> OpenTD.Results.Dataset.Comparer.DataToCompare
getset

List of FullStandardDataSubtype (T, TL, PL, etc.) to compare for all common-name entities. For example, if TL is in the list, then Run() will find all the lump names that are common between the two Datasets and compare all values of TL for all of them.

The data to compare.

See also
OpenTD.Results.DataType.FullStandardDataSubtype

◆ DefaultComparisonMethod

ICompareData OpenTD.Results.Dataset.Comparer.DefaultComparisonMethod
getset

For StandardDataSubtypes (T, TL, etc.) not listed in the ComparisonMethods dispatch table, use this comparison algorithm.

See also
OpenTD.Results.Dataset.DataSubtype, OpenTD.Results.Dataset.Comparer.ComparisonMethods, OpenTD.Results.Dataset.StandardDataSubtypes

◆ Exceedances

Dictionary<DataSubtype, List<Exceedance> > OpenTD.Results.Dataset.Comparer.Exceedances
get

After calling Run(), contains information about data items that exceeded the allowable percent tolerance. Contains a dictionary with one entry for each FullStandardDataSubtype (T, TL, PL, etc.) tested. The entries are lists of all items that exceed the percent tolerance, in descending order by exceedance amount.

See also
OpenTD.Results.DataType.FullStandardDataSubtype, OpenTD.Results.Dataset.Exceedance

Implements OpenTD.Results.Dataset.IComparerOutput.

◆ Message

string OpenTD.Results.Dataset.Comparer.Message
get

Run() outputs a report to this string.

◆ RecNumsA

List<long> OpenTD.Results.Dataset.Comparer.RecNumsA
get

A list of the record numbers in DatasetA.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ RecNumsB

List<long> OpenTD.Results.Dataset.Comparer.RecNumsB
get

A list of the record numbers in DatasetB.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ RegisterDataToCompare

List<string> OpenTD.Results.Dataset.Comparer.RegisterDataToCompare
getset

List of registers to compare, if common between datasets. If list is empty, will compare data for all common registers.

◆ TimePercentTol

double OpenTD.Results.Dataset.Comparer.TimePercentTol
getset

Tolerance for comparison of time series.

◆ TimesA

List<double> OpenTD.Results.Dataset.Comparer.TimesA
get

A list of the times in DatasetA.

Implements OpenTD.Results.Dataset.IComparerInput.

◆ TimesB

List<double> OpenTD.Results.Dataset.Comparer.TimesB
get

A list of the times in DatasetB.

Implements OpenTD.Results.Dataset.IComparerInput.


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

Connect with Ansys