OpenTD.Results.Dataset.WeightedAverageDataArray Class Reference
Last update: 16.07.2025A DerivedDataArray that returns a weighted average value across its InputCollection for each record. DataArrays in the InputCollection must all be the same length and have the same data subtype. Note: if IgnoreNaNInCalculations is true, NaN in input and weighting arrays will be treated as 0.0. More...

Public Member Functions | |
| WeightedAverageDataArray (DataSubtype dataSubtype, DataSubtype weightingSubtype, ItemIdentifierCollection itemIdentifiers, IDataset dataset) | |
| Create a new WeightedAverageDataArray using data and weighting data from a single dataset. The weighting arrays will be read at each record. | |
| WeightedAverageDataArray (DataArrayCollection inputCollection) | |
| WeightedAverageDataArray () | |
| override List< double > | GetValues (UnitsData units) |
| Gets the data in the units provided. | |
| List< double > | GetValues () |
| Gets the data in the current WorkingUnits. | |
| virtual void | SetValues (IEnumerable< double > values, DataSubtype subtype=null, UnitsData units=null, ItemIdentifier item=null) |
| override string | ToString () |
| IEnumerator< double > | GetEnumerator () |
Static Public Member Functions | |
| static implicit | operator List< double > (DataArray x) |
| static implicit | operator List< DataArray > (DataArray x) |
Protected Member Functions | |
| override string | GetSelfSuggestedName () |
| override void | SetDerivedData () |
| For setting ValuesSI, any other derived data. | |
| override void | CheckData () |
| virtual string | GetSelfSuggestedComment () |
Protected Attributes | |
| List< double > | ValuesSI |
Properties | |
| DataArray | WeightingArray [get, set] |
| One weighting array for all records. | |
| bool | UseMultipleWeightingArrays [get, set] |
| DataArrayCollection | MultipleWeightingArrays [get, set] |
| One weighting array per record. Set UseMultipleWeightingArrays to true to use these. Default is false. | |
| DataArrayCollection | InputCollection [get, set] |
| The collection of DataArrays operated upon to derive data. | |
| bool | IgnoreNaNInCalculations [get, set] |
| override IDataset | SourceDataset [get, set] |
| The source Dataset for the InputCollection. | |
| override ItemIdentifier | SourceItem [get, set] |
| The SourceItem for the InputCollection. | |
| override int | Count [get] |
| override double | this[int index] [get, set] |
| virtual DataSubtype | Subtype [get, set] |
| The DataSubtype (T, TL, PL, GTX, etc.) | |
| DataItemIdentifier | SourceDataItem [get] |
| Combines the SourceItem and Subtype. If either are null, this is null. | |
| UnitsData.UnitsType | Dimension [get] |
| The physical dimension of this data. | |
| bool | IsInteger [get] |
| Returns true if the subtype of this data represents integer data. | |
| AutoNamer | AutoNamer [get, set] |
| string | Name [get, set] |
| string | InternalSuggestedName [get, set] |
| AutoCommenter | AutoCommenter [get, set] |
| string | Comment [get, set] |
| string | InternalSuggestedComment [get, set] |
Detailed Description
A DerivedDataArray that returns a weighted average value across its InputCollection for each record. DataArrays in the InputCollection must all be the same length and have the same data subtype. Note: if IgnoreNaNInCalculations is true, NaN in input and weighting arrays will be treated as 0.0.
Constructor & Destructor Documentation
◆ WeightedAverageDataArray() [1/3]
|
inline |
Create a new WeightedAverageDataArray using data and weighting data from a single dataset. The weighting arrays will be read at each record.
- Parameters
-
dataSubtype weightingSubtype itemIdentifiers dataset
◆ WeightedAverageDataArray() [2/3]
|
inline |
◆ WeightedAverageDataArray() [3/3]
|
inline |
Member Function Documentation
◆ CheckData()
|
inlineprotectedvirtual |
Reimplemented from OpenTD.Results.Dataset.OneSubtypeDerivedDataArray.
◆ GetEnumerator()
|
inlineinherited |
◆ GetSelfSuggestedComment()
|
inlineprotectedvirtualinherited |
◆ GetSelfSuggestedName()
|
inlineprotectedvirtual |
Reimplemented from OpenTD.Results.Dataset.DerivedDataArray.
◆ GetValues() [1/2]
|
inlineinherited |
Gets the data in the current WorkingUnits.
- Returns
- List<System.Double>.
- See also
- OpenTD.Units.WorkingUnits
◆ GetValues() [2/2]
|
inlinevirtualinherited |
Gets the data in the units provided.
- Parameters
-
units The units to return the data in.
- Returns
- List<System.Double>.
Reimplemented from OpenTD.Results.Dataset.DataArray.
Reimplemented in OpenTD.Results.Dataset.SelectOneDataArray.
◆ operator List< DataArray >()
|
inlinestaticinherited |
◆ operator List< double >()
|
inlinestaticinherited |
◆ SetDerivedData()
|
inlineprotectedvirtual |
For setting ValuesSI, any other derived data.
Reimplemented from OpenTD.Results.Dataset.OneSubtypeDerivedDataArray.
◆ SetValues()
|
inlinevirtualinherited |
◆ ToString()
|
inlineinherited |
Member Data Documentation
◆ ValuesSI
|
protectedinherited |
Property Documentation
◆ AutoCommenter
|
getsetprotectedinherited |
◆ AutoNamer
|
getsetprotectedinherited |
◆ Comment
|
getsetinherited |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ Count
|
getinherited |
◆ Dimension
|
getinherited |
The physical dimension of this data.
◆ IgnoreNaNInCalculations
|
getsetinherited |
◆ InputCollection
|
getsetinherited |
The collection of DataArrays operated upon to derive data.
The input collection.
◆ InternalSuggestedComment
|
getsetinherited |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ InternalSuggestedName
|
getsetinherited |
Implements OpenTD.Results.Dataset.IAutoName.
◆ IsInteger
|
getinherited |
Returns true if the subtype of this data represents integer data.
◆ MultipleWeightingArrays
|
getset |
One weighting array per record. Set UseMultipleWeightingArrays to true to use these. Default is false.
◆ Name
|
getsetinherited |
Implements OpenTD.Results.Dataset.IAutoName.
◆ SourceDataItem
|
getinherited |
Combines the SourceItem and Subtype. If either are null, this is null.
◆ SourceDataset
|
getsetinherited |
The source Dataset for the InputCollection.
The source dataset.
- Exceptions
-
OpenTDException Cannot set DerivedDataArray.SourceDataset directly. It will be derived from InputArrays.
◆ SourceItem
|
getsetinherited |
The SourceItem for the InputCollection.
The source item.
- Exceptions
-
OpenTDException Cannot set DerivedDataArray.SourceItem directly. It will be derived from InputArrays.
◆ Subtype
|
getsetinherited |
The DataSubtype (T, TL, PL, GTX, etc.)
◆ this[int index]
|
getsetinherited |
◆ UseMultipleWeightingArrays
|
getset |
◆ WeightingArray
|
getset |
One weighting array for all records.
The documentation for this class was generated from the following file:
- C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/OpenTD/OpenTD.Results/Dataset/WeightedAverageDataArray.cs