Difference between revisions of "The Ramp API"

From Numerus
Jump to navigation Jump to search
Line 14: Line 14:


[[File:RPLRefNotes.png|Fig 3. RPL Reference Notes]]
[[File:RPLRefNotes.png|Fig 3. RPL Reference Notes]]
Scripts entered into the RPL Scripting Portal can saved and reloaded.
===Example===
{|style="margin: 0 auto;"
|[[File:script1.png|80px|Fig4a. Script Before Execution]]
|[[File:script2.png|80px|Fig4b. Script After Execution]]
|[[File:script2.png|80px|Fig4c. Resulting Graph]]
|}
One particular use of the Scripting Portal is for managing multiple runs with different parameters. The example shown in Fig. 4a is a script for the Pop Ramp<ref>One of the example Ramps that you can download from Numerus</ref> that flips the graph into comparison mode and runs the simulation 5 times, incrementing the rate parameter by 0.01 each time. Clicking '''Run Script''' executes the script line-by-line (Fig 4b) and produces the graph shown in Fig 4c.
Note:  the operation '''restart''' rather than '''reset''' is used between runs. '''Reset''' returns the parameters to their values before the script was run.


==Using Javascript==
==Using Javascript==
==R Integration==
==R Integration==

Revision as of 17:40, 17 February 2022

The Ramp API (Application Programming Interface) uses a simple language called RPL to manage and operate Ramp simulations and retrieve data for remote processing. It can be used in three ways: directly, through the RPL Scripting Portal (S On/Off button); indirectly through the Javascript RPL Portal (JS On/Off button); and remotely from other platforms such as the R Statistical language.

Using RPL

Fig 1. RPL Scripting Portal

RPL is aimple bytecode with instructions for adjusting parameter values, controlling runs, and retrieving data. There are RPL instructions to perform virtually any task a user might perform directly by changing sliders, adjusting runtimes or saving data to CSV files.

The RPL Reference sheet can be viewed using the Command Reference button on the RPL Scripting Portal. It is shown below in Fig 2.

Fig 2. RPL Reference

Each instruction in RPL consists of an op code followed by 0 or more arguments. The XXX arguments refer to Airport Codes, as described in the Ramp User Guide. Fig. 3 reproduces the Notes on the reference sheet.

Fig 3. RPL Reference Notes

Scripts entered into the RPL Scripting Portal can saved and reloaded.

Example

Fig4a. Script Before Execution Fig4b. Script After Execution Fig4c. Resulting Graph

One particular use of the Scripting Portal is for managing multiple runs with different parameters. The example shown in Fig. 4a is a script for the Pop Ramp[1] that flips the graph into comparison mode and runs the simulation 5 times, incrementing the rate parameter by 0.01 each time. Clicking Run Script executes the script line-by-line (Fig 4b) and produces the graph shown in Fig 4c.

Note: the operation restart rather than reset is used between runs. Reset returns the parameters to their values before the script was run.

Using Javascript

R Integration

  1. One of the example Ramps that you can download from Numerus