Options
All
  • Public
  • Public/Protected
  • All
Menu

An output file to mimic the W.I.S.E. stats view. Contains stats from each timestep of a scenarios simulation.

Hierarchy

  • StatsFile

Index

Constructors

constructor

  • Create a new stats file.

    Parameters

    • scen: Scenario

      The name of the scenario to output a stats file for.

    Returns StatsFile

Properties

columns

columns: GlobalStatistics[] = new Array<GlobalStatistics>()

An array of GlobalStatistics that dictates which statistics will be added to the file.

discretize

discretize: number | null = null

The amount to discritize the existing grid to (optional). Must be in [1, 1000].

fileType

fileType: StatsFileType = StatsFileType.AUTO_DETECT

The file format to export to.

filename

filename: string

The name of the output file.

location

location: LatLon | null = null

Protected scenName

scenName: string

shouldStream

shouldStream: boolean

Should the file be streamed/uploaded to an external service after it has been created? The streaming services are defined by OutputStreamInfo and helper methods such as {@link WISE#streamOutputToMqtt} or {@link WISE#streamOutputToGeoServer}.

streamName

streamName: string | null = null

Static Private Readonly PARAM_STATSFILE

PARAM_STATSFILE: "statsfile" = "statsfile"

Methods

addColumn

checkValid

  • Find all errors that may be in the statistics file output.

    Returns Array<ValidationError>

    A list of all errors that were found.

isValid

  • isValid(): boolean
  • Determine if all of the required values have been set.

    Returns boolean

removeColumn

  • Remove a column for the statistics file.

    Parameters

    Returns boolean

setLocation

  • setLocation(location: LatLon): void
  • Set a location to use for exporting weather information to the stats file. Either this or setWeatherStream should be used if weather information is to be added to the stats file.

    Parameters

    • location: LatLon

      The location that will be used for exporting weather information.

    Returns void

setWeatherStream

  • Set a weather stream to use for exporting weather information to the stats file. Either this or setLocation should be used if weather information is to be added to the stats file.

    Parameters

    • stream: WeatherStream

      A weather stream that will be used for exporting weather information.

    Returns void

stream

  • stream(builder: Socket): void
  • Streams the stats options to a socket.

    Parameters

    • builder: Socket

    Returns void

Private validateColumn