-3

I have written a dispatch model in GAMS which optimizes by minimizing system costs. I want to loop runs of the model; Run the optimization, save the output, varying a single parameter(storageCap) -- increasing it by a small fraction each iteration, and running the model again. GDXRRW does not seem to be able to run on R v.3.3.1 -- "Bug In Your Hair".

1 Answers1

0

Are you sure about gdxrrw not working on R 3.3.1? It surely works for me:

(1) Install gdxxrw using install.packages("C:\\GAMS\\win64\\24.7\\gdxrrw\\win3264\\gdxrrw_1.0.0.zip",repos=NULL)

(2) Use a GAMS script like:

set i /i1*i10/;
parameter p(i);
p(i) = uniform(0,1);
display p;
execute_unload "p.gdx",p;
execute '"c:\program files\R\R-3.3.1\bin\Rscript.exe" p.R';

$onecho > p.R
R.version
library(gdxrrw)
p<-rgdx.param("p.gdx","p");
p
$offecho

You will see something like:

--- Job Untitled_56.gms Start 08/18/16 15:29:58 24.6.1 r55820 WEX-WEI x86 64bit/MS Windows
GAMS 24.6.1   Copyright (C) 1987-2016 GAMS Development. All rights reserved
Licensee: Erwin Kalvelagen                               G150803/0001CV-GEN
          Amsterdam Optimization Modeling Group                     DC10455
--- Starting compilation
--- Untitled_56.gms(17) 3 Mb
--- Starting execution: elapsed 0:00:00.013
--- Untitled_56.gms(5) 4 Mb
--- GDX File C:\tmp\p.gdx
--- Untitled_56.gms(6) 4 Mb
               _                           
platform       x86_64-w64-mingw32          
arch           x86_64                      
os             mingw32                     
system         x86_64, mingw32             
status                                     
major          3                           
minor          3.1                         
year           2016                        
month          06                          
day            21                          
svn rev        70800                       
language       R                           
version.string R version 3.3.1 (2016-06-21)
nickname       Bug in Your Hair            
     i          p
1   i1 0.17174713
2   i2 0.84326671
3   i3 0.55037536
4   i4 0.30113790
5   i5 0.29221212
6   i6 0.22405287
7   i7 0.34983050
8   i8 0.85627035
9   i9 0.06711372
10 i10 0.50021067
*** Status: Normal completion
--- Job Untitled_56.gms Stop 08/18/16 15:29:59 elapsed 0:00:00.907
Erwin Kalvelagen
  • 15,677
  • 2
  • 14
  • 39
  • I tried an older version of R _3.2.0_ and encountered the same problem I was having before with a failure to be able to install. `install.packages("C:\\GAMS\\win64\\24.6\\gdxrrw\\win3264\\gdxrrw_1.0.0.zip", repos = NULL)` yields me: `Warning in install.packages : package ‘C:\GAMS\win64\24.6\gdxrrw\win3264\gdxrrw_1.0.0.zip’ is not available (for R version 3.2.0)` – Z_McDonald9263 Aug 19 '16 at 09:26
  • Usually that message is the result of leaving out `repos=NULL`. – Erwin Kalvelagen Aug 19 '16 at 10:22