CSex2.gms : Test expert level C# API to read and write GDX, set options and execute GAMS

Description

Contributor: Lutz Westermann, October 2012


Small Model of Type : .Net


Category : GAMS API library


Main file : CSex2.gms

$title 'Test expert level C# API to read and write GDX, set options and execute GAMS' (CSEX2,SEQ=14)

$onText
Contributor: Lutz Westermann, October 2012
$offText


$set srcRoot %gams.sysdir%api%system.dirsep%dotnet%system.dirsep%examples%system.dirsep%core%system.dirsep%csharp%system.dirsep%

$escape &

$if %system.platform% == WEX $set PLATFORM x64
$if %system.platform% == LAX $set PLATFORM arm64
$if %system.platform% == LEX $set PLATFORM x64
$if %system.platform% == DEX $set PLATFORM x64
$if %system.platform% == DAX $set PLATFORM arm64

$call rm -rf demanddata.gdx

* 1. Building and running xp_example2 to write GDX and execute GAMS
$call dotnet run --project "%srcRoot%xp_example2%system.dirsep%xp_example2.csproj" -c Release -p:Platform=%PLATFORM% -- "%gams.sysdir%." model2.gms
$if errorlevel 1 $abort 'Problem executing xp_example2 writing GDX file'

* 2. Compare generated GDX file against target file
$call gdxdiff demanddata.gdx demandwant.gdx
$if errorlevel 1 $abort 'Demanddata not as expected'