Model

Description

A class containing data and functions for the model.

Methods

find Finds a node in the model's subtree by its path.

Static Properties

dateTime The current date and time in FlexSim time.
nextStopDateTime The date and time in FlexSim time of the next stop time.
nextStopTime The simulation time of the next stop time.
startDateTime The model's start date and time in FlexSim time.
statisticalTime The current simulation time with respect to when stats were last reset.
time The current simulation time.
warmupDateTime The warmup date and time in FlexSim time.
warmupTime The total warmup time.

Static Methods

getDateTime Returns a date and time in FlexSim time from the given simulation time.
getTime Returns the simulation time from the given FlexSim time.

Details

Do no remove, this fixes the anchor on doc.flexsim.com

Model.find()

treenode find( string path )

Parameters

path The path, starting at the model node, that addresses the target node.

Returns

treenode If the addressed node exists, the method returns that node, otherwise NULL.

Description

Finds a node in the model's subtree by its path.

This is the same as calling treenode.find() on the model node: model().find("ObjectName")

treenode obj = Model.find("ObjectName");
Do no remove, this fixes the anchor on doc.flexsim.com

Model.dateTime

static readonly DateTime dateTime

Description

The current date and time in FlexSim time.

DateTime currentDateTime = Model.dateTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.nextStopDateTime

static readonly DateTime nextStopDateTime

Description

The date and time in FlexSim time of the next stop time.

DateTime nextStop = Model.nextStopDateTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.nextStopTime

static readonly double nextStopTime

Description

The simulation time of the next stop time.

If no stop time is defined this returns 0. If the current simulation time has passed the last stop time this returns the largest double value. double stopTime = Model.nextStopTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.startDateTime

static readonly DateTime startDateTime

Description

The model's start date and time in FlexSim time.

The model start date and time is define in the Model Settings. DateTime startTime = Model.startDateTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.statisticalTime

static readonly double statisticalTime

Description

The current simulation time with respect to when stats were last reset.

If the model has a warmup time, this will return the difference between the simulation time and the warmup time. statisticalTime = time - warmupTime double statTime = Model.statisticalTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.time

static readonly double time

Description

The current simulation time.

double currentTime = Model.time;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.warmupDateTime

static readonly DateTime warmupDateTime

Description

The warmup date and time in FlexSim time.

DateTime warmupTime = Model.warmupDateTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.warmupTime

static readonly double warmupTime

Description

The total warmup time.

If no warmup time is defined this returns 0.

When the warmup time is reached, statistics on objects and tracked variables will be reset.

double warmup = Model.warmupTime;
Do no remove, this fixes the anchor on doc.flexsim.com

Model.getDateTime()

static DateTime getDateTime( double modelTime )

Parameters

modelTime The simulation time.

Returns

DateTime The DateTime represented by the simulation time.

Description

Returns a date and time in FlexSim time from the given simulation time.

DateTime dateTime = Model.getDateTime(100);
Do no remove, this fixes the anchor on doc.flexsim.com

Model.getTime()

static double getTime( DateTime dateTime )

Parameters

dateTime The date and time in FlexSim time.

Returns

double The simulation time represented by the FlexSim time.

Description

Returns the simulation time from the given FlexSim time.


DateTime date = DateTime("8:00:00 AM  Wed 19 Jul 2017");
double theTime = Model.getTime(date);