TimeSeries

The TimeSeries object simulates a numerical value that varies with time.

Many JaamSim keywords are structured to accept a constant value, a Probability Distribution, a TimeSeries, or an Expression, which makes TimeSeries a powerful and flexible component for building simulation models.

The data for the object consists of a series of time stamps and values specified by the Value keyword.  The time stamps can be irregularly spaced and it is possible to repeat the time series over and over again during the simulation using the CycleTime keyword.

The value returned by a TimeSeries object has a specific unit type indicated by the UnitType keyword.  To maintain consistency, the UnitType must be specified prior to any other input.

Timestamps can be entered in the normal fashion, such as 0 s, 5 h, etc., or in various year/month/day formats.

The first timestamp must always be zero seconds (i.e. 0 s) or January 1, 00:00 of an arbitrary year.  If a non-zero year is used, for example 2010-01-01, then the TimeSeries considers this date to be time zero of the simulation and all other timestamps are offset accordingly.

The value for the TimeSeries is constant between one timestamp and the next.  If the simulation time is greater than the CycleTime, the TimeSeries will repeat from the beginning of the Value list.

For time series with more than a few entries, it is best to put the Value inputs in a separate file and use the Include feature.  This will require manual editing of the configuration file.  In the following example, the include file, TimeSeries1.inc, contains the following entries:

TimeSeries1  Value {

{   0 d  0.00  km/h  }

{   2 d  0.76  km/h  }

{  10 d  0.24  km/h  }

}

Assuming that the include-file is located in the same directory as the configuration file, the inputs to the configuration file would be:

Define  TimeSeries  { TimeSeries1 }

TimeSeries1  UnitType  { SpeedUnit }

Include '.\TimeSeries1.inc'

TimeSeries1  CycleTime  { 14 d }

 

RecordEdits

Note that all the inputs associated with TimeSeries1 appear at the beginning of the configuration file before the RecordEdits statement.  This position will allow editing of the model in the Input Editor and saving the results without changing the Include file arrangement.

In the example, TimeSeries1 takes on a new value (0.76 km/h) on when simulation time reaches 24 hours and another new value (0.24 km/h) at 240 hours.  After 14 days, the TimeSeries completes a cycle and takes on the original value (0 km/h).  This 14-day cycle would repeat until the end of the simulation run.

The following inputs in year/month/day format are equivalent to those for the example given above.

TimeSeries1  Value {

{  2014-01-01T00:00:00  0.00  km/h  }

{  2014-01-03T00:00:00  0.76  km/h  }

{  2014-01-11T00:00:00  0.24  km/h  }

}