$Run

The $Run reference displays info about the current run, such as the current simulation time.

In a similar fashion, a variant of $Run may be used to get info about past runs.  Some other references, such as $User.Runs for example return a list of runs (in this case, all previous runs simulated by that user).  You may treat run references retrieved this way in a similar manner to $Run.  

To demonstrate, the following lists all runs previously simulated by the current user

 

#foreach($r in $User.Runs)
Run $foreachCount started at $r.Created and ran $Run.SimStep steps.
#end
 

 

whch might display:

 
Run 1 started at Wed Jan 03 11:02:00 and ran 10 steps
Run 2 started at Wed Jan 03 11:20:11 and ran 2 steps.
Run 3 started at Wed Jan 03 11:25:33 and ran 5 steps.
 

 

$Run Properties

$Run properties represent attributes of the current multiplayer run.

BaseRun

A reference to the run used as the default group scenario when this run was started.

Example FML statement:

$Run.BaseRun.Name

Example result:

Sample Scenario

Created

The date and time the run was started.  Use $Formatter to retrieve the date or time in a specific format.

Example FML statement:

You started this run on $Formatter.date($Run.Created) at $Formatter.time($Run.Created)

Example result:

You started this run on 09-11-03 at 11:22 AM.

Description

An optional description of the current run entered by the user with the field form FD_run_description.

Example FML statement:

$Run.Description

Example result: This run describes my hypothesis of key business trends in the supply chain sector

EndStep

Displays the final step in the simulation. The final step in the simulation can be calculated by:
EndStep = (EndTime - StartTime) / TimeStep.

Example model properties:

M EndTime = 10
M StartTime = 0
M TimeStep = 1

Example FML statement:

$Run.EndStep

Example result:

10

EndTime

Displays the final time of the simulation formatted according to TimeFormat. If $Run.SimTime is equal to or greater than $Run.EndTime, then the simulation will not advance.

Example model property:

M EndTime = 2001

Example FML statement:

$Run.EndTime

Example result:

2001

EndUser

A reference to the user that created this run.  For $Run this will always be the same as $User, but when looping through runs representing a variety of users (e.g. in a score list or in a facilitator page), this can be used to get the user information.

Example FML statement:

This run was simulated by $Run.EndUser.FirstName $Run.EndUser.LastName

Example result:

This run was simulated by John Karens

FilteredMessages

A keyed list of all the user-entered text, allowing basic HTML formatting.  For the current run, identical to $FilteredMessages.

Example FML statement:

$Run.Messages.get('our_strategy')

Example result:

This is a description of our business strategy.

Group

A reference to the simulation user's Group.

Example FML statement:

$Run.Group.Name

Example result:

Forio University Section A

InitialSteps

Displays the number of steps initially before the user can enter the first set of decisions. InitialSteps lets you simulate historical values for the beginning of the simulation that your user can use as data for making decisions.

Example model property:

M InitialSteps = 3

Example FML statement:

$Run.InitialSteps

Example result:

3

IsGroupDefault

True if this run is the basis for the default group scenario.

Example FML statement:

$Run.IsGroupDefault

Example result:

true

LastModified

The date and time the run was last changed.  Use $Formatter to retrieve the date or time in a specific format.

Example FML statement:

You most recently modified this run on $Formatter.date($Run.LastModified) at $Formatter.time($Run.LastModified)

Example result:

You most recently modified this run on 09-11-03 at 11:22 AM.

Listed

A true/false value indicating whether this run is included in $User.ListedRuns or $Group.ListedRuns and should be listed in a scenario list.  Can be changed with the FD_action values set_listed and set_unlisted.

Example FML statement:

$Run.Listed

Example result:

false

LoginId

The login id of the user who created the run.

Example FML statement:

$Run.LoginId

Example result:

jsmith

Messages

A keyed list of all the user-entered text.  For the current run, identical to $Messages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

Example FML statement:

$Run.Messages.get('our_strategy')

Example result:

This is a description of our business strategy.

MultiLineMessages

A keyed list of all the user-entered text.  For the current run, identical to $MultiLineMessages.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

Example FML statement:

$Run.Messages.get('our_strategy')

Example result:

This is a description of our business strategy.

Name

The name of the current run, as set by the form field FD_run_name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

Example FML statement:

$Run.Name

Example result:

Supply Chain base case

PublicAccess

A true/false value indicating whether all users in the current group are allowed to use this run as a base run for resuming or cloning a run.  Typically this will be false.  Can be changed with the FD_action values set_public and set_private;

Example FML statement:

$Run.PublicAccess

Example result:

false

RunId

A alphanumeric code that can be used to identify the current run.

Example FML statement:

<A href="index.htm?FD_action=clone&FD_runid=$Run.RunId">clone this run</A>

Example result:

<A href="index.htm?FD_action=clone&FD_runid=egxzdefjgk">clone this run</A>

Score

A reference to the Score for the current run.  

Example FML statement:

$Run.Score.Score

Example result:

$100,000

SimStep

Displays the current step of the simulation. SimStep is an integer that always starts at 0.

Example FML statement:

$Run.SimStep

Example result:

2

SimTime

Displays the current time formatted according to TimeFormat. SimTime can include both words and numbers.

Example model property:

M TimeFormat = "Year ###0"

Example FML statement:

$Run.SimTime

Example result:

Year 2001

StartTime

Displays the starting time of the simulation formatted according to TimeFormat.

Example model property:

M StartTime = 2001

Example FML statement:

$Run.StartTime

Example result:

2001

StepsPerInterval

The number of steps before the model pauses and waits for user input.  Normally this is 1.  This is based on the model property StepsPerInterval.

Example model property:

M StepsPerInterval= 1

Example FML statement:

$Run.StepsPerInterval

Example result:

1

StepsPerSave

The number of steps between each save of the model data.  Normally this is 1.  This is based on the model property StepsPerSave.

Example model property:

M StepsPerSave = 1

Example FML statement:

$Run.StepsPerSave

Example result:
1

TimeStep

The calculation interval for each simulation step.  This is based on the model property TimeStep.

Example model property:

M TimeStep = 3

Example FML statement:

$Run.TimeStep

Example result:

0.5

Trial

If the current run is part of a time-limited simulation rial, then a reference to the $Trial, otherwise undefined.

Example FML statement:

$Run.Trial.DaysLeft

Example result:

3

$Run Methods

$Run methods take an argument and return a result based on your model information. $Run methods are case sensitive. All methods start in lower-case.

convertStepToTime(step)

Takes a step (an integer that starts from 0) and displays the simulation time, formatted according to TimeFormat, based on the time step.

Example value for step: 2

Example FML statement:

$Run.convertStepToTime(2)

Example result:

Year 2003