JCutstock.gms : Test object oriented Java API using a cutting stock example

Description

Contributor: Jarungjit Parnjai, November 2012


Small Model of Type : Java


Category : GAMS API library


Main file : JCutstock.gms

$title 'Test object oriented Java API using a cutting stock example' (JCUTSTOCK,SEQ=30)

$onText
Contributor: Jarungjit Parnjai, November 2012
$offText


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

$                             set C ;
$if %system.filesys% == UNIX $set C :
$                             set SET set
$if %system.filesys% == UNIX $set SET export
$                             set DOLLAR1 %
$if %system.filesys% == UNIX $set DOLLAR1 ${
$                             set DOLLAR2 %
$if %system.filesys% == UNIX $set DOLLAR2 }
$set package com.gams.examples.cutstock

* compile CutstockModel.java
$call %DOLLAR1%JPATH%DOLLAR2%%system.dirsep%javac -cp "%srcRoot%api%system.dirsep%GAMSJavaAPI.jar"%C%"%srcRoot%cutstock" -d . "%srcRoot%cutstock%system.dirsep%CutstockModel.java"
$if errorlevel 1 $abort 'Problem compiling CutstockModel.java'

* compile SimpleCutstock.java
$call %DOLLAR1%JPATH%DOLLAR2%%system.dirsep%javac -cp "%srcRoot%api%system.dirsep%GAMSJavaAPI.jar"%C%.%C%"%srcRoot%cutstock" -d . "%srcRoot%cutstock%system.dirsep%SimpleCutstock.java"
$if errorlevel 1 $abort 'Problem compiling SimpleCutstock.java'

* run SimpleCutstock.class
$call %DOLLAR1%JPATH%DOLLAR2%%system.dirsep%java -cp "%srcRoot%api%system.dirsep%GAMSJavaAPI.jar"%C%. -Djava.library.path="%srcRoot%api" %package%.SimpleCutstock "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing SimpleCutstock.class'

* compile Cutstock.java
$call %DOLLAR1%JPATH%DOLLAR2%%system.dirsep%javac -cp "%srcRoot%api%system.dirsep%GAMSJavaAPI.jar"%C%"%srcRoot%cutstock" -d . "%srcRoot%cutstock%system.dirsep%Cutstock.java"
$if errorlevel 1 $abort 'Problem compiling Cutstock.java'

* run Cutstock.class
$call %DOLLAR1%JPATH%DOLLAR2%%system.dirsep%java -cp "%srcRoot%api%system.dirsep%GAMSJavaAPI.jar"%C%. -Djava.library.path="%srcRoot%api" %package%.Cutstock "%gams.sysdir%."
$if errorlevel 1 $abort 'Problem executing Cutstock.class'