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

An Optimization Example Model

Below is an example RASON optimization model. Its purpose is to find the optimal location for an airline hub that serves six cities. The cities are located at the (simplified x-y) coordinates given by the dx and dy parameters in the data section. Our goal is to find the x, y coordinates of the airline hub that will minimize the distance flown to any of the cities.

{
 modelName: "ExampleOptimization",
 modelType: "optimization",
 variables : {
    x : { value: 1.0, finalValue: [] },
    y : { value: 1.0, finalValue: [] },
    z : { value: 1.0, finalValue: [] }
 },
 data : {
    dx : { dimensions: [6], value: [1, 0.5, 2, 2, 2, 0.5] },
    dy : { dimensions: [6], value: [4, 3,   4, 2, 5, 6] }
 },
 constraints : { 
    c : { dimensions: [6], upper: 0, formula: "sqrt((x - dx)^2 + (y - dy)^2) - z" }
 },
 "objective" : {
    "obj" : { formula: "z", "type": "minimize", "finalValue": [] }
  }
}

If you aren't familiar with modeling languages, you may not realize how much the RASON language is doing for you. This is a simple nonlinear optimization model. Note that the expression "sqrt((x - dx)^2 + (y - dy)^2) - z" is an array expression operating over all six cities. The RASON Interpreter computes not just the values of this expression, but its partial derivatives with respect to x and y - used by the nonlinear optimizer to guide the search for a solution.

Web developers will recognize the overall syntax as that of JSON, JavaScript Object Notation - except that identifiers and keywords are not surrounded by double quotes, outside the "objective" section which shows an example of writing "strict JSON". The RASON Interpreter doesn't require the quotes in a model, but the result - the optimal solution to this nonlinear model -- is always valid JSON.


 {
  "status" : {
     "code" : 0,
     "id": "2590+ExampleOptimization+2020-01-18-16-53-45-215131",
     "codeText" : "Solver found a solution. All constraints and optimality conditions are satisfied." 
  },
  "variables" : {
     "x" : { "finalValue" : 1.250000 },
     "y" : { "finalValue" : 4.000000 },
     "z" : { "finalValue" : 2.136001 }
  },
  "objective" : { 
     "obj":{ "finalValue" : 2.136 }
  }
 }
Back to Overview of Features