Skip to main content

OpenTD reference 2026 R1

Class Comparer

Last update: 09.03.2026

Namespace: OpenTD.Results.Dataset
Assembly: OpenTD.Results.dll

Use to compare two Datasets.

public class Comparer : IComparerInput, IComparerOutput

Inheritance

object ← Comparer

Implements

IComparerInput, IComparerOutput

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

Comparer(IDataset, IDataset)

Initializes a new instance of the class.

public Comparer(IDataset a, IDataset b)

Parameters

a IDataset

Dataset A

b IDataset

Dataset B

Properties

CompareConductorNames

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

public bool CompareConductorNames { get; set; }

Property Value

bool

CompareFTieNames

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

public bool CompareFTieNames { get; set; }

Property Value

bool

CompareFluidSubmodels

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

public bool CompareFluidSubmodels { get; set; }

Property Value

bool

CompareIFaceNames

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

public bool CompareIFaceNames { get; set; }

Property Value

bool

CompareJustFinalRecord

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.

public bool CompareJustFinalRecord { get; set; }

Property Value

bool

CompareLumpNames

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

public bool CompareLumpNames { get; set; }

Property Value

bool

CompareNodeNames

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

public bool CompareNodeNames { get; set; }

Property Value

bool

ComparePathNames

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

public bool ComparePathNames { get; set; }

Property Value

bool

CompareRecords

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

public bool CompareRecords { get; set; }

Property Value

bool

CompareRegisterNames

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

public bool CompareRegisterNames { get; set; }

Property Value

bool

CompareThermalSubmodels

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

public bool CompareThermalSubmodels { get; set; }

Property Value

bool

CompareTieNames

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

public bool CompareTieNames { get; set; }

Property Value

bool

CompareTimes

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

public bool CompareTimes { get; set; }

Property Value

bool

ComparisonMethods

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.

public Dictionary<StandardDataSubtypes, ICompareData> ComparisonMethods { get; set; }

Property Value

Dictionary<StandardDataSubtypes, ICompareData>

See Also

DataSubtype, Comparer.DefaultComparisonMethod, StandardDataSubtypes

DataToCompare

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.

public List<FullStandardDataSubtype> DataToCompare { get; set; }

Property Value

List<FullStandardDataSubtype>

See Also

FullStandardDataSubtype

DatasetA

One of the datasets to compare.

public IDataset DatasetA { get; }

Property Value

IDataset

DatasetB

One of the datasets to compare.

public IDataset DatasetB { get; }

Property Value

IDataset

DefaultComparisonMethod

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

public ICompareData DefaultComparisonMethod { get; set; }

Property Value

ICompareData

See Also

DataSubtype, Comparer.ComparisonMethods, StandardDataSubtypes

Exceedances

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.

public Dictionary<DataSubtype, List<Exceedance>> Exceedances { get; }

Property Value

Dictionary<DataSubtype, List<Exceedance>>

See Also

FullStandardDataSubtype, Exceedance

Message

Run() outputs a report to this string.

public string Message { get; }

Property Value

string

RecNumsA

A list of the record numbers in DatasetA.

public List<long> RecNumsA { get; }

Property Value

List<long>

RecNumsB

A list of the record numbers in DatasetB.

public List<long> RecNumsB { get; }

Property Value

List<long>

RegisterDataToCompare

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

public List<string> RegisterDataToCompare { get; set; }

Property Value

List<string>

TimePercentTol

Tolerance for comparison of time series.

public double TimePercentTol { get; set; }

Property Value

double

TimesA

A list of the times in DatasetA.

public List<double> TimesA { get; }

Property Value

List<double>

TimesB

A list of the times in DatasetB.

public List<double> TimesB { get; }

Property Value

List<double>

Methods

CloseDatasets()

public void CloseDatasets()

GetExceedancePlots(int, IEnumerable<DataSubtype>)

public List<ExceedancePlot> GetExceedancePlots(int maxPerSubtype = 1, IEnumerable<DataSubtype> subtypes = null)

Parameters

maxPerSubtype int

subtypes IEnumerable<DataSubtype>

Returns

List<ExceedancePlot>

PlotExceedances(int, IEnumerable<DataSubtype>)

public List<ExceedancePlot> PlotExceedances(int maxPerSubtype = 1, IEnumerable<DataSubtype> subtypes = null)

Parameters

maxPerSubtype int

subtypes IEnumerable<DataSubtype>

Returns

List<ExceedancePlot>

ReOpenDatasets()

public void ReOpenDatasets()

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.

public bool Run()

Returns

bool

true if all tests performed indicate the Datasets are equal, false otherwise.

See Also

Comparer.Message

SaveExceedancePlots(string, out string, string, int, IEnumerable<DataSubtype>)

public bool SaveExceedancePlots(string directoryPath, out string resultMsg, string prefix = "", int maxPerSubtype = 1, IEnumerable<DataSubtype> subtypes = null)

Parameters

directoryPath string

resultMsg string

prefix string

maxPerSubtype int

subtypes IEnumerable<DataSubtype>

Returns

bool

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

_markdiff(string)

Do not use.

public void _markdiff(string msg)

Parameters

msg string

_writeline(string)

Do not use.

public void _writeline(string msg)

Parameters

msg string

_writesuccess(string)

Do not use.

public void _writesuccess(string msg)

Parameters

msg string

See Also

Dataset

Connect with Ansys