Skip to content

Getting started

André Schnabel edited this page Sep 13, 2017 · 2 revisions

Getting started with JsonToGdx

This tutorial is going to show you how to use JsonToGdx in order to create GAMS data exchange format files from data encapsulated in a specially structured JSON object. This library does not expose all intricate details of the GDX format, but expects the data to follow certain conventions.

Basic structure

Directly below the root, the JSON object contains up to three attributes/keys: sets, parameters and scalars. Each of them is assigned an array of objects each storing data for a single set, parameter or scalar respectively.

Sets

A set represents a GAMS set. A typical use case is a contiguous set of numbered elements. For example as
set a /a1*a10/
in the GAMS modeling language. This set can be succinctly specified as
{"name": "a", "from": 1, "to": 10}
a set can alternatively be specified by a literal listing of its elements
{"name": "a", "elements": ["a1", "a3"] }

Parameters

Scalars

Clone this wiki locally