Introduction to RASON
About RASON Models and the RASON Server
Rason Subscriptions
Rason Web IDE
Creating and Running a Decision Flow
Defining Your Optimization Model
Defining Your Simulation Model
Performing Sensitivity Analysis
Defining Your Stochastic Optimization Model
Defining Your Data Science Model
Defining Custom Types
Defining Custom Functions
Defining Your Decision Table
Defining Contexts
Using the REST API
REST API Quick Call Endpoints
REST API Endpoints
Decision Flow REST API Endpoints
OData Endpoints
OData Service for Decision Flows
Creating Your Own Application
Using Arrays, For, Loops and Tables
Organization Accounts

Using Statements

If-Else, If-Then-Else, While and Compound statements are also supported in the Rason modeling language. See below for syntax and useage examples of each.

If-Else and If-Then-Else Statement Examples

The else part in both IF statements above is optional. Notice that both If statements are the only place in Rason where two formulas may be assigned to the same identifier.

If - Else Example


  "if (logic_exp)" : {
	f: {...},
	...
  },
  "else":{
	f: {...},
	...
  }

If - Then - Else Example


  F: { if: "logic_exp", then: "formula1", else: "formula2" }

While Example

This example illustrates how to use a "while" statement in the Rason modeling language.


  "while ( logic_exp)": {
     …
  }

Compound Example

The "body" in all statements is an implicit compound stgatement – a sequence of definitions and nested statements. The only case when we may need an explicit compound statement, is when initializing an identifier before using it in a next loop statement as shown below.


  "compound" : {
    i: {value: 1},
	 …
   }
Back to Using a Fully Scalable Model Loop