Page 1 of 1

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

Posted: Tue Apr 23, 2019 12:49 pm
by jason_s
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.

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

Posted: Tue Apr 23, 2019 9:56 pm
by Freddy
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

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

Posted: Wed Apr 24, 2019 12:48 pm
by jason_s
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