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

A Single Simulation

The model UGYieldManagement1.json is shown below.

  
  {
    "modelName": "UGYieldManagement1Example",
    "modelDescription": "UGYieldManagement1 Example - Simulation",
    "modelType": "simulation",
    "modelSettings": {
      "numSimulations": 1,
      "numTrials": 1000,
      "randomSeed": 1
    },
    "data": {
      "price": {
        "value": 200
      },
      "capacity": {
        "value": 100
      },
      "sold": {
        "value": 110
      },
      "refund_no_shows": {
        "value": 0.5
      },
      "refund_overbook": {
        "value": 1.25
      }
    },
    "uncertainVariables": {
      "no_shows": {
        "formula": "PsiLogNormal(0.1*sold, 0.06*sold)",
        "mean": []
      }
    },
    "formulas": {
      "show_ups": {
        "formula": "sold - Round(no_shows, 0)"
      },
      "overbook": {
        "formula": "Max(0, show_ups - capacity)"
      }
    },
    "uncertainFunctions": {
      "revenue": {
        "formula": "price*(sold - refund_no_shows*Round(no_shows, 0) - refund_overbook*overbook)",
        "mean": [],
        "percentiles": [],
        "trials": []
      }
    }
  }
  

The model depicts a hypothetical airline flight from San Francisco to Seattle. The flight has 100 seats, and tickets are $200 per seat. Some passengers who purchase tickets are "no-shows" whose seats will be empty; in this example we assume that such passengers receive a refund of 50% of their purchase price. To utilize their 'perishable inventory' of seats, the airline would like to sell more than 100 tickets for each flight. But we assume that Federal regulations require that any ticketed passenger who is unable to board the flight due to overbooking is entitled to compensation of 125% of the ticket price.

The airline would like to know how much revenue it will generate from each flight, less refunds for no-shows and compensation for 'bumped' passengers. As shown above, this net revenue amount is calculated in revenue within uncertainFunctions, for any specific number of tickets sold (110 above) and number of no-shows (5 above).

The uncertain quantity in this model is the number of no-shows; hence we should model this with an uncertain variable. We quickly realize that the number of no-shows will depend on the number of tickets sold. After some research, we decide that we can use a LogNormal distribution for the number of no-shows: no_shows within uncertainVariables uses the formula =PsiLogNormal(0.1*sold,0.06*sold).

Within formulas, the formula for show_ups contains the ROUND(no_shows,0) function to ensure that the number of no-shows is an integer value - and this is used to compute the net revenue in the revenue uncertain function.

Performing the Simulation

If you haven't already, open either the WEB IDE on www.RASON.com or the Desktop IDE (typically installed at C:\Program Files\Frontline Systems\Solver SDK Platform\Bin) and open the file UGYieldManagement1.json. (If using the Web IDE simply clickRASON examples and select the file. If using the Desktop IDE, see above for the path.) To perform a single simulation (with 1,000 Monte Carlo trials) using the WEB IDE, click:

  • POST rason.net/api/model to post the model to the RASON Server
  • POST rason.net/api/model/{nameorid}/simulate to run the simulation

If using the RASON Desktop IDE, you can simply click the Simulate icon. The following result will be returned.


{
  "status": {
    "code": 0,
    "id": "2590+UGYieldManagement1Example+2020-02-07-21-29-25-683482",
    "codeText": "Solver has completed the simulation."
  },
  "uncertainFunctions": {
    "revenue": {
      "mean": 20445.30,
      "percentiles": [
        [18599, 19098, 19300, 19500, 19695, 19800, 19800, 19900, 19950, 19950,
        …
        20900, 21000, 21000, 21000, 21000, 21000, 21000, 21000]
       ],
      "trials": [
        [20700, 20900, 20400, 20900, 19700, 20700, 19800, 20250
         …,
         19400, 19950, 20800, 20600, 20250, 19800, 20100, 20800]
      ]
    }
  },
  "uncertainVariables": {
    "no_shows": {
      "mean": 10.9922
    }
  }
 }

The mean or expected net revenue is about $20,000. The 10% percentile equals $19,950 which tells us that if we sell 110 tickets, we'll earn almost as much revenue as a full flight (100 seats * $200) 90% of the time. However, what if we asked the question, "How many tickets should we sell?"

Back to An Airline Management Revenue Example