Is it possible to pass on miro input to a $call command?

Questions on GAMS MIRO
Post Reply
jason_s
User
User
Posts: 6
Joined: 8 months ago

Is it possible to pass on miro input to a $call command?

Post by jason_s » 7 months ago

Hi,

is there a way to enter some input data in miro and use this input data as an argument in a $call command? Following code will run just fine, but my argument will be in every case '1' no matter what I set as input(2,3,...).

Code: Select all

Scalar
$onExternalInput
Input    'Input Data'            /   1 /
$offExternalInput
;
$eval tmp Input
$call gams %filepath%readInput.gms --FILE=%tmp%
I'm using MIRO 0.4 beta.

Freddy
User
User
Posts: 8
Joined: 1 year ago

Re: Is it possible to pass on miro input to a $call command?

Post by Freddy » 7 months ago

Hello, Jason,

MIRO currently assigns values to GAMS parameters at the end of the compilation phase (right before the start of the execution phase). Therefore, Input is always 1 at the time your expression is evaluated. Admittedly, this behavior is not entirely intuitive and will most likely change before MIRO is officially released.
However, MIRO allows you to set GAMS command line parameters. This means that using the following MIRO configuration file sets the compile time variable tmp for you and should therefore achieve what you want to do:

Code: Select all

{
  "inputWidgets": {
    "GMSPAR_tmp": {
      "label": "Select the input file you wish to use",
      "choices": [
        "1",
        "2",
        "3"
      ],
      "aliases": [
        "File 1",
        "File 2",
        "File 3"
      ],
      "multiple": false,
      "selected": "1",
      "alias": "Input file",
      "widgetType": "dropdown"
    }
  }
}
Hope this helps,
Freddy

jason_s
User
User
Posts: 6
Joined: 8 months ago

Re: Is it possible to pass on miro input to a $call command?

Post by jason_s » 7 months ago

Hey Freddy,

thank you and sorry, I knew that I read something about the compilation phase a while a go and for what ever reason I did not check the configuration documentation again :roll:

Jason

Post Reply