Skip to main content
Namespace: OpenTD.Results.Dataset
Assembly: OpenTD.Results.dll
Use to compare two Datasets.

Inheritance

object ← Comparer

Implements

IComparerInput, IComparerOutput

Inherited Members

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

Constructors

Comparer(IDataset, IDataset)

Initializes a new instance of the Comparer class.

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.

Property Value

bool

CompareFTieNames

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

Property Value

bool

CompareFluidSubmodels

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

Property Value

bool

CompareIFaceNames

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

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.

Property Value

bool

CompareLumpNames

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

Property Value

bool

CompareNodeNames

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

Property Value

bool

ComparePathNames

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

Property Value

bool

CompareRecords

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

Property Value

bool

CompareRegisterNames

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

Property Value

bool

CompareThermalSubmodels

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

Property Value

bool

CompareTieNames

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

Property Value

bool

CompareTimes

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

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.

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.

Property Value

List<FullStandardDataSubtype>

See Also

FullStandardDataSubtype

DatasetA

One of the datasets to compare.

Property Value

IDataset

DatasetB

One of the datasets to compare.

Property Value

IDataset

DefaultComparisonMethod

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

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.

Property Value

Dictionary<DataSubtype, List<Exceedance>>

See Also

FullStandardDataSubtype, Exceedance

Message

Run() outputs a report to this string.

Property Value

string

RecNumsA

A list of the record numbers in DatasetA.

Property Value

List<long>

RecNumsB

A list of the record numbers in DatasetB.

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.

Property Value

List<string>

TimePercentTol

Tolerance for comparison of time series.

Property Value

double

TimesA

A list of the times in DatasetA.

Property Value

List<double>

TimesB

A list of the times in DatasetB.

Property Value

List<double>

Methods

CloseDatasets()

GetExceedancePlots(int, IEnumerable<DataSubtype>)

Parameters

maxPerSubtype int subtypes IEnumerable<DataSubtype>

Returns

List<ExceedancePlot>

PlotExceedances(int, IEnumerable<DataSubtype>)

Parameters

maxPerSubtype int subtypes IEnumerable<DataSubtype>

Returns

List<ExceedancePlot>

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.

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>)

Parameters

directoryPath string resultMsg string prefix string maxPerSubtype int subtypes IEnumerable<DataSubtype>

Returns

bool

ToString()

Returns a string that represents the current object.

Returns

string A string that represents the current object.

_markdiff(string)

Do not use.

Parameters

msg string

_writeline(string)

Do not use.

Parameters

msg string

_writesuccess(string)

Do not use.

Parameters

msg string

See Also

Dataset