Skip to main content

OpenTD reference 2026 R1

Class DerivedDataArray

Last update: 09.03.2026

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

A DerivedDataArray is a DataArray that gets its data by operating on its InputCollection of DataArrays. For example, a SelectMaxDataArray selects the DataArray with the maximum value and returns data from it only. An AverageDataArray returns the average value of its InputCollection at each record. To create your own custom DerivedDataArray, inherit from this class and override at least the SetDerivedData() method.

public abstract class DerivedDataArray : DataArray, IEnumerable<double>, IEnumerable

Inheritance

object ← DataArray ← DerivedDataArray

Derived

FormulaDataArray, OneSubtypeDerivedDataArray, SelectOneDataArray

Implements

IEnumerable<double>, IEnumerable

Inherited Members

DataArray.SetValues(IEnumerable<double>, DataSubtype, UnitsData, ItemIdentifier), DataArray.SourceDataset, DataArray.SourceItem, DataArray.Subtype, DataArray.SourceDataItem, DataArray.Dimension, DataArray.IsInteger, DataArray.GetValues(), DataArray.GetValues(UnitsData), DataArray.Count, DataArray.this[int], DataArray.ValuesSI, DataArray.CheckData(), DataArray.AutoNamer, DataArray.Name, DataArray.InternalSuggestedName, DataArray.GetSelfSuggestedName(), DataArray.ToString(), DataArray.AutoCommenter, DataArray.Comment, DataArray.InternalSuggestedComment, DataArray.GetSelfSuggestedComment(), DataArray.GetEnumerator(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

DerivedDataArray(DataArrayCollection)

public DerivedDataArray(DataArrayCollection inputCollection)

Parameters

inputCollection DataArrayCollection

DerivedDataArray()

public DerivedDataArray()

Properties

Count

The number of items in this DataArray.

public override int Count { get; }

Property Value

int

IgnoreNaNInCalculations

public bool IgnoreNaNInCalculations { get; set; }

Property Value

bool

InputCollection

The collection of DataArrays operated upon to derive data.

public DataArrayCollection InputCollection { get; set; }

Property Value

DataArrayCollection

SourceDataset

The source Dataset for the InputCollection.

public override IDataset SourceDataset { get; }

Property Value

IDataset

Exceptions

OpenTDException

Cannot set DerivedDataArray.SourceDataset directly. It will be derived from InputArrays.

SourceItem

The SourceItem for the InputCollection.

public override ItemIdentifier SourceItem { get; }

Property Value

ItemIdentifier

Exceptions

OpenTDException

Cannot set DerivedDataArray.SourceItem directly. It will be derived from InputArrays.

this[int]

public override double this[int index] { get; set; }

Property Value

double

Methods

CheckData()

protected override void CheckData()

GetSelfSuggestedName()

protected override string GetSelfSuggestedName()

Returns

string

GetValues(UnitsData)

Gets the data in the units provided.

public override List<double> GetValues(UnitsData units)

Parameters

units UnitsData

The units to return the data in.

Returns

List<double>

List<System.Double>.

SetDerivedData()

For setting ValuesSI, any other derived data

protected virtual void SetDerivedData()

See Also

DataArray, SelectMaxDataArray, AverageDataArray

Connect with Ansys