Jex2.gms : Test expert level Java API to read and write GDX, set options and execute GAMS

Description

Contributor: Lutz Westermann, October 2012


Small Model of Type : Java


Category : GAMS API library


Main file : Jex2.gms

$TITLE 'Test expert level Java API to read and write GDX, set options and execute GAMS' (JEX2,SEQ=18)

$ontext
Contributor: Lutz Westermann, October 2012
$offtext


$set srcRoot %gams.sysdir%apifiles%system.dirsep%Java%system.dirsep%

$                              set P
$if %system.filesys% == UNIX  $set P -p
$                              set C     ;
$if %system.filesys% == UNIX  $set C :
$if not set jcomp             $set jcomp javac

$call rm -rf demanddata.gdx com

$call mkdir %P% com%system.dirsep%gams%system.dirsep%api
$call mkdir %P% com%system.dirsep%gams%system.dirsep%xp_examples
$call %jcomp% "%srcRoot%xp_example2.java" "%srcRoot%api%system.dirsep%gdx.java" "%srcRoot%api%system.dirsep%opt.java" "%srcRoot%api%system.dirsep%gamsglobals.java" -d .
$if errorlevel 1 $abort 'Problem compiling xp_example2.java'
$call java -cp . -Djava.library.path="%srcRoot%api" com.gams.xp_examples.xp_example2 "%gams.sysdir%." model2.gms
$if errorlevel 1 $abort 'Problem executing xp_example2'
$call gdxdiff demanddata.gdx demandwant.gdx
$if errorlevel 1 $abort 'Demanddata not as expected'