Difference between revisions of "The Ramp API"
Line 19: | Line 19: | ||
===Example=== | ===Example=== | ||
{|style="margin: 0 auto;" | {|style="margin: 0 auto;" | ||
|[[File:script1.png|250px|Fig4a. Script Before Execution]] | |[[File:script1.png|thumb|250px|Fig4a. Script Before Execution]] | ||
|[[File:script2.png|250px|Fig4b. Script After Execution]] | |[[File:script2.png|thumb|250px|Fig4b. Script After Execution]] | ||
|[[File:script3.png|250px|Fig4c. Resulting Graph]] | |[[File:script3.png|thumb|250px|Fig4c. Resulting Graph]] | ||
|} | |} | ||
Revision as of 17:44, 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
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.
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.
Scripts entered into the RPL Scripting Portal can saved and reloaded.
Example
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
- ↑ One of the example Ramps that you can download from Numerus