全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学
1377 1
2019-05-18

This chapter shows the first steps of how to use GAMS MIRO and how to deploy your own GAMS models. For using this application a few components have to be installed first, see section Installation.

In this and subsequent sections we will mainly deal with the GAMS MIRO base mode. In the base mode, you can supply your models with input data, generate, display and save the results of your optimization as well as compare different scenarios with each other, everything visually supported by various graphic tools. The Hypercube mode will be the subject of an extra section, see here.

Introduction

This chapter shows the first steps of how to use GAMS MIRO and how to deploy your own GAMS models. For using this application a few components have to be installed first, see section Installation.

In this and subsequent sections we will mainly deal with the GAMS MIRO base mode. In the base mode, you can supply your models with input data, generate, display and save the results of your optimization as well as compare different scenarios with each other, everything visually supported by various graphic tools. The Hypercube mode will be the subject of an extra section, see here.


Start GAMS MIRODemo Applications

To get a feeling for the use of GAMS MIRO, it is recommended to have a look at the demo applications first. They can be found in the GAMS data utilities library. You can get them e.g. in GAMS Studio via GAMS -> Model Library Explorer or via Shortcut F6. You can also find those demo applications here.


GAMS MIRO beta:

In order to use the GAMS MIRO BETA version, a special installation is necessary. Until an official release of GAMS MIRO, the demo models will only be available via this special version in the data utilities library.



The following demos are available:

  • transport
    This problem looks for a least cost shipping schedule that meets requirements at markets and supplies at factories. More about this transportation problem, see here.
    Note:

    The well-known model from the GAMS model library is called trnsport. To avoid two models of the same name, the GAMS MIRO Demo model is called transport.


  • transport_live
    A "live" version of the transport model. Extends transport in the sense that locations of suppliers and markets can be adjusted right from within MIRO. Geographical information about the cities you entered is automatically fetched and the distance matrix calculated via embedded Python code.
  • pickstock
    Optimization model to find a small subset of stocks of the Dow Jones index together with some weights, such that this portfolio has a similar behavior to the overall index.
  • pickstock_live
    A "live" version of the pickstock model where the user can specify the time window to be considered regarding the stock prices. This allows to include current Dow Jones stock prices as well as ones from past periods.
  • kport
    This problem computes minimal cost solutions satisfying the demand of certain product portfolios. More about this optimization Problem, see here.
To start a demo application, you need to run the corresponding GAMS model with the command line parameter miro=launch set to compile-time. This can either be done from within the new GAMS Studio or the GAMSIDE:


or using the command prompt:

cd path/to/model && gams transport.gms miro=launch

Note: To use the command prompt, GAMS must be included in the PATH environment variable of your operating system!


Note:

If you run a model with "miro=launch", all required R packages will be loaded. When you start the application for the first time, the packages are installed. This may take a while.



Some of the example models included in the GAMS MIRO installation require additional Python packages (this is not true for the beta version of GAMS MIRO). If you want to use any of these models, you may need to install them first: from the command line navigate to your GAMS installation folder and then to the subfolder: GMSPython\Scripts (e.g.: cd C:\GAMS\win64\26.0\GMSPython\Scripts). To install the respective package, enter: pip install <package_name>. Below you find a table with the python packages required by the different example models.

Demo ApplicationPython packages
Pickstock_livepandas, pandas_datareader
Transport_livegeocoder




Structure of GAMS MIRO

Let's take the famous trnsport example from George Dantzig to guide us throgh this documentation: We own a bunch of factories and wish to find a least cost shipping schedule that meets the demand at markets we are shipping to. Furthermore, the capacity constraints of our factories must not be violated. In order to launch the MIRO app for this model, we open the transport.gms file in GAMS Studio and run it with the GAMS command line parameter miro=launch.

Once all the packages have been loaded, the MIRO app will start. Below you see the input mask as it appears after the launch.


The screen is essentially divided into two parts:

Navigation bar:


On the left side you can find the navigation bar. Here you can navigate between the different views:

  • Input:
    Visualization & configuration of input data for the next calculations.
  • Output:
    Visualization of calculated output data.
  • GAMS interaction:
    While solving a model with GAMS this section shows the current status of your run as well as the Log and Lst files.
  • Compare scenarios:
    Module for the comparison of results / scenarios in a split screen mode or a multi-scenario comparison mode (also referred to as tab view).

In addition, the buttons for loading input data and for starting a GAMS run are located here:

  • Load data:
    Load input data for a model run. This can be an Excel spreadsheet, existing data from the database or scenarios coming from the Hypercube mode.
  • Solve model:
    Solve the GAMS model with the current set of input data. This will run your GAMS model and collect the results when it finished executing.
Main window:

The main window always displays the content of the section selected by the user in the navigation bar. Here, for example, data is visualized, scenarios are compared and analyses are carried out.

Besides navigation bar and main window, some important functions are accessible via the header bar:

  • Scenario:
    Scenario management - load, save, edit, delete and export scenario data.
  • Help:
    Link to this documentation and license information.

How to work with GAMS MIRO

There are several ways to use GAMS MIRO. However, a typical workflow could look like this:

  • Import input data
  • Modify the data if desired
  • Solve GAMS model
  • Inspect the results (in the form of tables and/or charts)
  • Save the scenario data or discard the results
  • In addition, already saved results can be re-imported and compared at any time.

Import data

A GAMS MIRO app is quite useful if there is data to be visualized, e.g. as tables, diagrams or other graphics. This applies to output data as well as input data. Input data which should be visualized in MIRO can be (re-)imported either from existing scenarios in the database or locally via an Excel spreadsheet. To import such data, click on the Load data button in the navigation bar. The following window pops up:





You can decide whether you want to import an existing scenario from the database or load a spreadsheet from your local computer. When you start a GAMS MIRO app for a specific GAMS model for the first time, there is no data in the database yet, so you should start with a local file. For the model shown here, there is an Excel spreadsheet in the directory from which the model was started, e.g. in C:\Users\<user_Name>\Documents\GAMSStudio\workspace\transport.xlsx.


Note:

Every time you start a MIRO app, an Excel spreadsheet is created in the directory of the executed model. This file contains data extracted from the GAMS model.



To load the Excel spreadsheet select the menu item Local and click on browse. Navigate to the directory of the currently running app and select the spreadsheet. Now assign a name for the new scenario and confirm the data import with a click on import. A new (currently still unsaved) scenario is now created under the name specified.


Tip:

Instead of the whole spreadsheet you can also load individual symbols of your input data. For this click on Manually choose datasets and select the desired symbols to be imported from the selected spreadsheet. The other data remain unchanged.



Besides the local and the database import there is the third option: "Hypercube". This tab allows you to import scenarios that have been generated and saved in the Hypercube mode. Since Hypercube scenarios are identified by their hash value (read more about this here) and not by a user-defined name like in base mode, you need to import them differently.

run will also be saved and can be accessed when re-loading the corresponding scenario.












Demo ApplicationsStructure of GAMS MIROHow to work with GAMS MIROImport dataData manipulationSolve the modelInspect the resultsSave / delete resultsScenario comparisonAdditional featuresManage multiple scenariosRun GAMS MIRO on a serverLearn more



GAMS_MIRO_MP4.rar
大小:(51.89 MB)

只需: 3 个论坛币  马上下载

本附件包括:

  • GAMS_MIRO_mp4.mp4



19_02_20_GAMS_MIRO_webinar.pdf
大小:(1.32 MB)

只需: 2 个论坛币  马上下载


miroDemoApps.zip
大小:(2.54 MB)

只需: 5 个论坛币  马上下载








二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2019-5-18 17:04:01
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群