Home
        GGIG Graphical Interface Generator Programming Guide
         Contents
1.      with the default affecting visibility     The value of these fields comprises a list of trigger control names  and for each trigger the  possible settings which render the current control visible respectively enabled  The controls  are separated by a forward slash          The settings for each control are separated from the  control name by a double point  the settings themselves are separated by comma  The settings  describe an inclusive OR relation  1 e  the control 1s shown if one of the listed settings is  currently chosen  For each trigger control  it can be defined 1f the dependent control should be  rendered visible and enable  and a default value can be set 1f the control 1s rendered invisible    or disabled     In the following example  the dependent control is triggered by the control name    Standard  GTAP model     Only if the value of the trigger  the dependent control is enabled  Otherwise     its value is set to    comparative static       lt dependsOn gt Standard GTAP model false enabled Comparative static lt  dependson gt     With the  lt dependsOn gt  field  the controls also are checked for inclusive or  1 e  1f for one of  the controls one setting matches  the current control is shown  The following example shows a    tab which is only enabled if one of the listed farm branches is selected by the user       control     lt Type gt Tab lt  Type gt    lt Title gt Animals lt  Title gt    lt tasks gt Single farm run  Calculate HACS Experiments dairy lt  t
2.     Britz  W   2014a   A New Graphical User Interface Generator for Economic Models and its  Comparison to Existing Approaches  German Journal of Agricultural Economics 63 4   271 285    Britz  W   2014b   The Graphical User Interface for CAPRI version 2014  Uni Bonn  Institute for Food  and Resource Economics  http   www capri model org docs Gui2014 pdf    Britz  W  and Kallrath  J   2012   Economic Simulation Models in Agricultural Economics  The Current  and Possible Future Role of Algebraic Modelling Languages  in  Kallrath  J   eds    Algebraic    GGIG  Wolfgang Britz  Version November 2015 79    GGIG Graphical Interface Generator     Programming Guide    Modelling Systems  Modelling and Soving Real World Optimization Problems  Springer   Heidelberg  Germany  199 212    Britz  W   Dees  M   Walkiewicz  J   2014   A Forest Sector Model for the Region Baden Wurttemberg  in Germany  selected paper presented at the Bioenergy from Forest 2014  September 15 18   2014  Helsinki  Finland     Britz  W   Perez Dominguez     and Badri Narayanan  G   2015   Analyzing results from agricultural  large scale Economic Simulation Model  Recent Progress and the Way Ahead  German Journal  of Agricultural Economics  Forthcoming    Britz  Wolfgang  2009   Sequentially linking a village CGE to farm household models   a focus on  transaction costs  Presentation at the workshop on  Evaluation of Rural Development Policies   Theory and Application   University of Kiel  July 13 14  2009     Dol  
3.     Filter  Data set dataSetSel file starts with   filter                 In the example above  a control with the same    Data set  1s generated     comprising the file names found under     datdir    gdx  and only results files    GGIG  Wolfgang Britz  Version November 2015 18    GGIG Graphical Interface Generator     Programming Guide    with a name starting with the name of the selected file will be shown in the    drop down boxes for scenarios     enorio 1 57x45 eth notariis    enerio 2 57X45 noShod    Dataset 57x45 X Scenario B    Note  the Java program will attempt to locate in the GUI folder a XML file   with the name of the selected file and copy it to    generated xml     That can be  used to generate from GAMS a file with e g  regional and product definitions  matching a specific data base and use  lt xi include href     generated xml        gt  in    the view definition file to dynamically load these definition into the views     c  Otherwise  a pair of integer values which describe on which position of the file  names the selected key should be found plus either    skip    for only using selecting    files or    merge    to merge records from the chosen GDXs     The screenshot below shows an example generated from the following filters      lt filter gt region Countriessel starts with lt  filter gt    filter gt Base year   BaseYears5el 7 8 skip lt   filter gt    lt  filter gt Year SimYearsSel 9 18 skip lt    filter gt     The first filter    starts with  does not
4.     in the XML file  These    logical dimensions    which are used in the XML definition file can be  mapped to any dimension of the original data cube read in by the java code  Pivoting can then    GGIG  Wolfgang Britz  Version November 2015 60    GGIG Graphical Interface Generator     Programming Guide    be used to map these  logical  dimensions to viewport dimensions seen by the user such as    the columns and rows of a table     Necessary tags for tables  A table definition is found between the  lt table gt       lt  table gt  tags  It must at least define     e The table theme  such as  lt theme gt Welfare lt  theme gt   The themes are shown as a drop     down menu in the exploitation tools     e The table name  such as  lt name gt Welfare comparison between Member    States lt  name gt   The names must be unique     e The items of the tables and the dimension where they stem from  or that non item    dimension is used      The order of the themes and table names will define their order in the drop down menu     Alternatively  the  lt themes gt  tag can be used to order the themes e g      lt themes gt Meta Scenario shifter    Welfare  CAP Policy indicators    Prices Markets  BioFuels Trade Farmn Farm   totals Farm EU   Feed Fertilizer  Environment    CGE Heta CGE Policy CGE ficcounts CGE Price CGE Production   HSMU DNDC  Hulti Functionality  Energy lt  themes gt     Defining the items of the table    The underlying idea of having a    hand defined    list of items for 
5.     lt control gt     lt order gt 1458 lt  o0rder gt      TypeBEBRER Tupe      lt Title gt Alternative GAMS license file for GHG emission estimation lt  Title gt      Ualue  gamslice cplex lt  Value gt     lt Options gt   lt  Options gt     lt range gt  amp  lt  range gt     lt qamsName gt altLicense lt  gamsName gt     lt tasks gt Baseline calibration market model Run scenario with market model Generate expost results lt  tasks gt    lt fcontrol gt     Output to GAMS      SETGLOBAL Scenario_description my first scenario    Note     If the text entered refers to an existing file  it is recommended to use a filesel control    instead     GGIG  Wolfgang Britz  Version November 2015 27    GGIG Graphical Interface Generator     Programming Guide    Checkbox    Purpose    Used for on off settings  i e  in cases where one of two options must be chosen  e g   in cases of project modules which can be used or not  1 of 2   Cannot be used for 1    of n selections where n  gt  2     use a List instead   Applicable fields   Title  GamsName  Value  Tasks  Style    Control optic     Use branching priorities        Possible value    true  false   User action    tick   untick box with mouse  Example definition      lt control gt    lt order  162 6 lt  order gt     Type  BREERBERC  Tupe    lt Title gt Generate GAMS child processes on different threads lt  Title gt    Ualue  true amp  Ualue     lt gamsName gt threads lt   gamsName gt    lt tasks gt   Build HSHU database   Run scenario with mar
6.    A typical problem with more complex economic simulation models defined in GAMS 1s the  steering of scenarios  GGIG pushes the GAMS developer to a code structure where all run  specific settings are entered via the single include file generated by GGIG  That does not  imply that all data for a specific scenario are comprised in the include file  It could e g  mean  that the user has selected via the interface include file s  with run specific settings and that the    names of these files are passed via the include file to GAMS     Scenario editor    The scenario editor is an optional tool to be embedded in a GGIG user interface which  supports the user in setting up run specific include files where the content is not stemming  from GUI controls  That parallel way to define run specific input is typically necessary for    more complex tools where e g  policy scenarios are defined in GAMS code     The scenario editor is a    predefined    task which must be named    Define scenario     e g      lt task gt    lt name gt Define scenario lt  name gt    lt userLeuls gt runner Administrator  developper  debugger lt  userLevls gt    lt  task gt     A related setting stores the directory where the input files are found      lt scenarioDir gt  lt attr gt scen lt fattr gt  lt fscenarioDir gt     Batch execution  The batch execution facility is a tool which   e Allows executing many different tasks after each other without requiring user input     e Reports the settings used  any error
7.    lt  region gt     The definitions for one item are enclosed in the tag   lt region gt     lt  region gt       lt activity gt     lt  activity gt    lt product gt      lt  product gt    lt dim5 gt     lt  dim5 gt     The order of the items in the tables is defined by these lists     Each item has a key  which corresponds to the symbol identifier found in the GDX file  The  keys are case sensitive  The itemName 1s a long text which is typically shown to the user  The  elements found between the  lt sel gt      lt  sel gt  tags can be used as filters in table definitions  or    interactively by the user     A specific tag is  lt aggreg gt yes lt  aggreg gt   When found for an item in the rows  it will be shown    twice in the table  once in the top part  and then again     Includes    The XML processor allows to use includes  as seen below      amp xi include href  generated xml       lt xi P  liback gt      lt xicinclude href   generated example xml   gt    amp  xl fallback    lt fxicinclude gt   These includes can e g  be generated by a GAMS process to pass run specific item lists to the    exploitation tools  The following code from    GTAPInGAMS    project shows how to may look  like     GGIG  Wolfgang Britz  Version November 2015 69    GGIG Graphical Interface Generator     Programming Guide    loop  ti     put   lt activity gt        put    lt itemName gt    i te   i       itemnHame     7   put    lt key gt    1 t1   lt  key gt        put       sel gt all sectors lt ifs
8.   Each GIGG task can store  its results as GAMS parameter representing a multi dimensional sparse cube and save it on  disk as a GDX file  The exploitation loads the non zeros from one or several GDX files into  memory  However  given the length of the different dimensions and the use of short codes   the user would be typically lost on his own in the large tables  which can comprise several  million non zero data and basically an unlimited amount of zero cells  The XML definition  file defines the views explained above  and allows a structured and user friendly way to  exploit the results of the different work steps  It also separates raw data from the views and  from the GUI code itself  which requires relatively little information about the underlying data  and their structure besides what is provided by the definition files  XML 1s an industry  standard to store structured information in non binary text files  which explains why that    format was chosen     As explained in more detail in the excurse above  each view can be understood as to define a  report  1 e  a combination of a selection query and information on the presentation of the    selected values   The structure of the XML definition files for the views    General comments    The XML parser used by the GUP s java is a standard XML parser  The table viewer currently    supports up to 10 dimensions  which are named as     1  Region  2  Activity  3  Product    4  Scenario  5  Year  6  Dim5  Dim6  Dim7  Dim8  Dim9
9.   Possible values    Defined by options field   User action    tick   untick box fields in the control with mouse    Example definition     GGIG  Wolfgang Britz  Version November 2015 32    GGIG Graphical Interface Generator     Programming Guide     lt control gt    lt order gt 1426 lt  order gt    lt Typesmultilist lt  Type gt    lt Title gt Longrun Option lt  Title gt    lt Options gt FAOZ 656  Fano projections   GLOBIOM EU  Projections with GLOBIO EU model   GLOBIOM GL    Projections with global GLOBIDM model    lt  Options gt    lt Value gt FA02656  Fao projections  lt  Value gt    lt ranger3 lt  range gt    lt gamsName gt  longrunscen lt  gamsName gt    lt tasks gt Build global database lt  tasks gt     fcontrol gt     Output to GAMS     SET Countries    DE  FR    f   Selection groups    The multilist control features a pop up menu which without selection groups only allows to    clear the selection or to select all items  see below      C7000000  Czech Republic   HUOO0000    Hungary     PLOOO000  Poland   51000000  Slovenia    2 SK000000  Slovak Republic     mtrua 5 EE000000  Estoni    LTOOOOOO  Lithue Clear Selection    LVO00000  Latvia Select All  CyY000000  Cypr  MTo00000    Malt EUIS Select    EU12 Add to selection  Mon EU Remove from selection       The control definition files can define selection groups which allow for groups of items to be  selected  added or removed from the selection  Each selection group starts with a forward  slash         following by the 
10.   is defined in the   GGIG INI file    Default settings can be defined in the XML file      lt datbir gt  lt attr gt   iAdat lt fattro lt fdatDbir gt    lt modelDir gt  lt attr gt     qams lt  attr gt  lt  modelDir gt    lt resDir gt  lt attr gt    results lt  attr gt  lt  resDdDir gt    lt restartDir gt  lt attr gt    yrestart lt  attr gt  lt  restartDir gt     GAMS and R related settings    Option  User Settings   System Settings   SVN   Other options                        Path to GAMS exe L  qams exe    GAMS scratch Directory d  scerdir    Paths er Re T  britz dairydyn R 2 15 1 bin x64 Rscript exe    threads 8  maxprocdir 255  license L  gamslice cplex txt    GAMS Options    Number of processors used in GAMS Get the number of processors        Processor speed relative  100    2 4 GH Intel core 2                   GGIG  Wolfgang Britz  Version November 2015 47    GGIG Graphical Interface Generator     Programming Guide    These settings can also be defined in the XML file      lt gamsexe gt  lt attreD 2  gams23    gams  exe lt  attr gt  lt  gamsexe gt    amp rexe   amp attr  D XrXbinX6ANr exe lt  attr gt  lt  rexe gt    lt gamsoptions gt  lt attr gt threads 6 lt  attr gt  lt  gamsoptions gt    lt numberofprocessors  lt attre3 lt  attr gt  lt  numberofprocessors gt    lt processorsSpeedRelative gt  lt attr gt 160   attr gt  lt  processorspeedRelative gt    lt scratchDir gt  lt attr gt 166 lt  attr gt  lt  scratchDir gt     SVN related settings    Option    SVN user id      
11.  SVN password       SVN URL for Gams    SYN URL for results       SVN URL for restart          SVN URL for data       The SVN settings can be used to perform checkout and updates in cases where the model  code with related data  restart files or result files is under versioning control on a SVN server   If the model is not under version control  the settings    svn no    renders the tabbed plan    invisible   Default settings can be defined in the XML file      lt SunURLFfForDat gt  lt attr gt  lt  attr gt  lt  SunURLForDat gt     SunURLForGUI    attr  https   suni agp uni bonn de sun capri trunk GUI   attr     SunURLfForGUI     lt SunURLforGams gt  lt attr gt https   suni  agp uni bonn de sun capri trunk gams lt  attr gt  lt  SunURLforGams gt    lt SunURLforRestart gt  lt attr gt  lt  fattr gt  lt  SunURLforRestart gt     SunURLForResult    attr  https   suni agp uni bonn de sun capri trunk results regcge   attr     SunURLForResult      Including credentials      lt SUNPud gt  lt attr gt 14        lt  attr gt  lt  SUNPud gt    lt SUNUSerID gt  lt attr gt ierdlag  lt  attr gt  lt  SUNUserID gt     The credentials are obfuscated  In order to edit them  use the dialogue and copy the settings    from the generated ini file to the XML     GGIG  Wolfgang Britz  Version November 2015 48    GGIG Graphical Interface Generator     Programming Guide    Settings linked to the exploitation tools          Path to view definition file  tables  xmi  T  britz capri GUI tables xml  F  Sort co
12.  affect the file selection  but will affect which records  from the selected files are loaded in the viewer  In the example shown below  where the filter  controls fit to the definitions above  only records where the region key starts with    BL    will    be shown to the users     The other two filters will skip files where the base and simulation years do not match the  selection  In our example  the base year 1s stored as a two digit key on position 7 and 8  and  only files with a    04    are in the drop down box for the scenarios  Similarly  only results for    the simulation year    20    are selected     GGIG  Wolfgang Britz  Version November 2015 19    GGIG Graphical Interface Generator     Programming Guide          a2 RES 0 0420EU CH FREETRADE    Normally  the name of the file will be used to characterize the  scenario   The    merge    is  made for the case where several GDX files should be combined and the file name does not  distinguish model runs  An example offers the downscaling component of CAPRI  it  produces in separate GAMS run for the same scenario one file for each country which  comprise rather huge data sets  The    merge    mode allows combining these result sets    together     GGIG  Wolfgang Britz  Version November 2015 20    GGIG Graphical Interface Generator     Programming Guide    Controls    Possible fields for controls    The necessary information for each control is stored in different tags for each control    definition file  The controls ar
13.  e WB White Black  e BW Black White  e LD Light Blue Dark Blue  e DL Dark Blue Light Blue     lt eval gt   the item is calculated from other items  e g    eval   VAL   VAL   BlueBox              VAL   DeMinimis          lt  eval gt     lt node gt   the item is defines a vertex in a network graph    lt edge gt   the item is defines additional an edge in a network graph   In order to define from which dimension they are taken  the user can set either    lt itemDim gt region lt  itemDim gt     Deprecated is the old style     GGIG  Wolfgang Britz  Version November 2015 62    GGIG Graphical Interface Generator     Programming Guide     lt isActivity gt NO lt  isActivity gt    It is also possible to refrain from declaring any items    lt itemDim gt none lt  itemDim gt    In which case only the filters used on the different dimension are active     Which means that the table loops over the products  and the items refer to the activity  dimension  A typically example is a table with market balance elements  items such as     FEDM    are found in the columns of the CAPRI tables where also the activities are stored     Consequently  the table will loop over the products  and not over the activities  Alternatively     isActivity   Y ES lt  isActivity gt     allows only items from the product dimension  and lets the table loop over the activities  A  typical example provides a table showing activity levels  yield or economic indicators for the    production activities   Tables can also b
14.  for an implementation which is    working as a prototype  The last chapter will then show selected screenshots     Desired properties    The main properties an automated technical documentation of a tool under GGIG such as    CAPRI should fulfil are as follows     e Avoiding redundancies  1 e  information should whenever possible only inputted once   Specifically  existing in line documentation already present in the code should be    ported over to the technical documentation automatically     GGIG  Wolfgang Britz  Version November 2015 75    GGIG Graphical Interface Generator     Programming Guide    Changes in the code structure should possibly be reflected automatically    The documentation must be able to reflect different tasks projects and to differentiate  between instances of the same GAMS project used in different configurations  e g  for    calibration or simulation     Its biggest part of the technical documentation should be constructed directly from the    code base in an automated way     It should also collect information from the SVN versioning system    Technical implementation    The main ingredients of the implementation are as follows     The final format of the technical documentation is based on automatically generated  static HTML pages  following the example of JAVADOC  with some JavaScript to    allow for collapsible trees    The methodological documentation of a project should be edited in Word  and  converted into a PFD document  It will comprise 
15.  in libraries  expected realization and maintenance  resource need  and naturally  5  license costs  It turned quickly that an ideal product was not  available  Some of GIS products were not able to allow for the necessary link between newly  imported tables with region codes and an existing geo referenced geometry  Others had very  complex user interfaces or produced run time errors  took ages to draw the HSMU maps or  were quite expensive  From the different options tested  the gvSIG    http   www  gvsig com index php idioma en  freeware GIS seemed to be the only option   allowing the user to import data from a CSV     which must however be semi colon delimited      and join one of the columns to a shapefile  At least the version installed at that time was    however running not very stable     In the end  it was decided to build on the existing code base and let Wolfgang Britz write the  additional code    on demand     The main advantage of that approach 1s the fact that the    mapping view is transparently integrated in the CAPRI GUI  it is sufficient to switch from    GGIG  Wolfgang Britz  Version November 2015 35    GGIG Graphical Interface Generator     Programming Guide       Table    to    Map    in a drop down list to produce a colored map  and that user demands  regarding additional functionality may be and had been added  taking into account the specific    needs of the CAPRI network     Compared to ArcGIS  where the EU27 HSMU geometry plus codes and centroids re
16.  of projects might basically exclude its usage beyond some core developers  Accordingly   institutions or tool developers often observe that promising tools are only used by a few  specialists  reducing returns to their investment in tool development and maintenance  Nilsson  et al  2008  Janssen et al  2012   Possible other users often shy away from the high learning  costs and or fear to generate  analyse and present results based on a black box where it is    unclear how to enter exactly a scenario and how to access their results     It is therefore not astonishing that some tools based on GAMS  and also on other modelling  languages  have developed their specific GUIs  cf  Britz et al  2015   These GUIs let the user  steer the tool with a touch  amp  feel comparable to other programs running on modern windowed  operating systems  However  writing a GUI for a larger project firstly requires considerable  programming skills  often not found with the economic modellers themselves  Secondly   developing a good GUI design and then to code  debug and maintain a GUI can be a rather  costly exercise  As a consequence  typically only rather large and well funded tools have  found and invested the necessary resources to develop such GUIs  CAPRI and runGTAP  provide some examples  Such project specific GUIs are typically very powerful  but tend also  to be too tool specific to be easily modified to fit to another  GAMS  project  and require an    experienced software programmer for 
17.  of the controls  The state of each control component  such as a checkbox can then be mapped to GAMS code   SETGLOBALS  Set  definitions  settings for parameters   It combines hence the basic functionality of a    GUI generator and a rudimentary GAMS code generator     2  Generation of GAMS compatible meta data from the state of the control which can  be stored in GAMS GDX format and later accessed  so that scenario definitions are    automatically stored along with results     3  Execution of a GAMS or R project while passing the state of the control to  GAMS respectively R as a include file     4  Exploitation of results from GAMS runs by providing an interface to define the  necessary interfacing definitions in text file to load results from a GAMS into the    GGIG exploitation tools     5  Access to a set of GAMS related utilities  This include e g  a viewer for GDX files  a  utility to build a HTML based documentation of the GAMS code or a batch execution    utility     GGIG is hence steered with xml based text file and does not require knowledge in a higher    programming language    GGIG was developed to overcome a typical problem when economic models are implemented  in GAMS  GAMS itself  not at least to ensure platform portability  does not allow for  graphical user input  cf  Britz and Kallrath 2012   Run specific settings for GAMS need  therefore to be introduced either by changes to the GAMS project code itself or by adding  settings of environment variables to th
18.  panel would only be shown if both the    Arable    and the    Dairy    farm    branch would be selected     The values for the dependent control are always passed on to GAMS or R  even if it is  currently not visible  or enabled   That eases writing the GAMS code as all  setglobals and  sets defined via the interface for any combination of possible control settings are still  declared  But clearly  the coder should only use these settings in the code if a default value is  defined  Otherwise  settings from previous runs will be comprised in the include file which    can neither been seen respectively changed by the user nor have a defined value     A specific type of dependency provides the population of tables  lists and combo boxes from  GDX files  In case of such dependencies and a change in the state of the trigger component     the dependent component will be rebuilt   lt dependson gt Input file    gdx  lt  dependson gt     It is also possible to define a value which is used for control once it is rendered invisible     GGIG  Wolfgang Britz  Version November 2015 23    GGIG Graphical Interface Generator     Programming Guide    Type of controls    The following types of controls are available  The related JAVA swing JComponent is shown    in bracket   Tab  Separator  Panel   Text  Checkbox  Singlelist  RadioButtons  Filesel    FileselDir    Multilist  MultilistNonZero  Slider   Spinner    Table    SimpleTable    Introduces a new tab on the tabbed plane hosting the contr
19.  point for the development of GGIG 1n order to    expand beyond a pure  project adjusted implementation of the CAPRI exploitation tools     GGIG  Wolfgang Britz  Version November 2015 9    GGIG Graphical Interface Generator     Programming Guide    Some specific skills and eventually serious refactoring of the reporting part of an existing  model are necessary to benefit from the full functionality of the GGIG exploitation tool  It  therefore pays typically off to start using GGIG for exploitation from the beginning  the same  holds probably also for GSE   But at least  no skills in coding in a higher programming  language such as Java are necessary to define the necessary interfaces between the GAMS  project and the exploitation part  The latter offers interlinked tables  with selections  sorting     outlier control  pivoting   different type of graphs  maps and flow maps     Additionally  GGIG features a set of utilities originally developed for CAPRI such as HTML    based documentation of the GAMS code  a GDX viewer or a batch processing mode     The development of GGIG would have been impossible without the continued funding for the  maintenance and development of CAPRI by the EU Commission  which also let to the   emergence of the CAPRI GUI and exploitation tools  That code base was the starting point for  GGIG  I would also like to mention the contribution of Alexander Gocht over the last years to    the code of the interface     The main parts of GGIG are graphically d
20.  range gt   amp  lt  range gt    lt gamsName gt result types gamsHame    amp tasks  Baseline calibration market model   Baseline calibration supply models   Baseline calibration farm types   HSHU baseline   Run scenario with market model  Run scenario only with market model Generate expost results  Run scenario without market model   Run scenario only with market model  Downscale scenario results   lt  tasks gt    lt tooltip gt Name of the scenario file to run  The results will be stored under the name as well  lt  tooltip gt    lt fcontrol gt     Output to GAMS      SETGLOBAL scenDes cge rd nothg    GGIG  Wolfgang Britz  Version November 2015 30    GGIG Graphical Interface Generator     Programming Guide    Singelist  Purpose    Used for 1 of n selections  Used in cases where more then 2 mutually exclusive    values for a setting are available   Applicable fields   Title  GamsName  Value  Options  Tasks  Style    Control optic     Choose model type re  UN    Note  Drop down list will appear 1f the user clicks on arrow   Possible value    Defined by options field   User action    tick   untick one of the selection possibilities with mouse    Example definition      lt control gt    lt order gt 1116 lt  order gt    lt Type gt   lt  Type gt    lt Title gt First year lt  Title gt    lt Value gt 1984 lt  UValue gt    lt 0ptions gt 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996  lt  0ptions gt    lt gamsName gt FirstYear lt  gamsName gt    lt tasks gt Prepare nat
21. 5     Dim9   0 Empty   The definition  lt defpivot gt OROS lt  defpivot gt  thus means  regions are in the rows  scenarios in  the columns  The definition  lt defpivot gt PISR lt  defpivot gt  puts the products in the row blocks   the items in the rows  the scenarios in the column blocks and the regions in the columns     Additional tags   lt defview gt     Defines the default view used for the tables  the list of default views is equal to what the user    can select in the drop down box        Additional tags   COO     This tag defines the geometry to use for maps  Currently  the following geometry files are    available in CAPRI   NUTSILzip   NUTS 2 geometry for countries covered by the supply module    GGIG  Wolfgang Britz  Version November 2015 64    GGIG Graphical Interface Generator     Programming Guide    MS zip    RMS zip    model  RM zip    HSMU zip    Global geometry for the trade blocks in the market model    1x1 km pixel clusters for EU 27 without Malta and Cyprus    NUTS 0 geometry for the countries covered by the supply module    Global geometry for the regions with behavioural functions in the market    There are also 1x1 km pixel clusters for individual Member States  but these are internally    passed to the viewer when only one country 1s shown     Alternative texts for the dimensions    Normally  the names for the dimensions are passed to the view by Java  However  their name    can be changed by      lt regionText gt      lt  regionText gt       activityT
22. 86    There a several ways to use that information in GAMS code  below are a few examples     1  Round the setting to an integer with  eval in GAMS and use it in a set definition     GGIG  Wolfgang Britz  Version November 2015 71    GGIG Graphical Interface Generator     Programming Guide    Seval steps round  steps    set step   S1 STEPSS       2  Use it in an combined definition and declaration statement for a scalar  scalar s steps Z SSTEPS        3  Use it in assignment    p control  Steps      STEPS      4  Use it for pre compiler conditions     Seval steps round  steps     ifthen  steps        5  Use for GAMS program controls    if    5TEPS   gt  1B          Structure your program by tasks    The following example shows how the concepts of tasks can be used on conjunction with    includes to structure a top level program    Siftheni  task     Estimate constant terms   Sinclude  est const gms     Sendif    Siftheni   task      Estimate constant terms and trend parameters   Sinclude  est const and trend gms     Sendif    GGIG  Wolfgang Britz  Version November 2015 72    GGIG Graphical Interface Generator     Programming Guide    The basic idea is to have a common a part which is shared by many tasks and then blocks  which perform task specific operations  As the    Siftheni     Sendif are working at compile  time  not used code is excluded even from compilation which helps to save memory and    reduce the size of the listing     One entry points for run specific settings 
23. G  Wolfgang Britz  Version November 2015 52    GGIG Graphical Interface Generator     Programming Guide    beginning implemented in GAMS  data transformations which generated the regional data  base were still coded in FORTRAN  as it was done for the SPEL EU data base serving as  input for the regional data base of CAPRI  These FORTRAN routines were replaced by  GAMS code in the CAP STRAT project 2001 2004 along with new Bayesian based    methodologies to ensure consistency and completeness     The very first maps in CAPRI  in 1998  were produced with an MS EXCEL mapping plug in  which was at that time a cost free add on  However  moving the data to EXCEL and then  loading them in the viewer was not a real option for the daily debugging work on the data  base and the model  Therefore  shortly before the first CAPRI project ended in 1999  a JAVA  applet was programmed by W  Britz which was able to draw simple maps from CSV Files   These CSV file were automatically produced by the CAPMOD GAMS code  That code with  slight modification remained active for quite a while  and some of the features are still found  in the current mapping viewer  Then for a while  the CAPRI exploitation tools were based on  XML XSLT SVG and a mapping viewer in SVG was realized  However  the XML solution  had the big disadvantage of requiring a large amount of single ASCII input files  and was not  really performant when complex pivoting was used  That XML based solution was also used  with other model
24. GAMS generated gdx files used by the exploitation tools                    70   Coadine the data Tome dx Ile  2 ecce uk od dope asm vod debe dente uet de etiatn ud d Ce dote ed Sou dE Od  70   Design hints for structured programming in GAMS with GGIG                          eeeeeeeeeeee 71   Using information passed from GGIG    oocccccnnnnoccncnnnnnonononononnnnnnnnnnnnnnnnnnnnnnnnnnonnnnnnnnncnnnnnnnnnnos 71   btr  cture Volr Pro rant Oy LASKS sins de Roe oe dedu euo 72   One entry points Tor run specific SCITINGS eie cie op oe qose AiO T3   SCM AIO e JOT e SN 73  Batec A RO 73  Generate GAMS docurmmerntat Of ds 74  DA LN aeuo ate reece arctic E prona quid ds ecad mobs cce D DITS quM  74  DESTE 0  0 6  PIS RES supra lo oe io et dia Le 75    GGIG  Wolfgang Britz  Version November 2015 5    GGIG Graphical Interface Generator     Programming Guide    Techimicalimple menta and id dicas  76  INC Ae EIE 76  Handling or GDX HCS tas dls ds 78  A a e a O 79  INSISTE                                hist 79    GGIG  Wolfgang Britz  Version November 2015 6    GGIG Graphical Interface Generator     Programming Guide    Overview    The GAMS Graphical Interface Generator  GGIG  1s a tool to generate a Graphical User  Interface  GUI  for a GAMS or R project  with five main functionalities     1  Generation of user operable graphical controls from XML based definitions  The  XML file defines the project specific layout of the GUI  The user can then interact  with the GUI to change the state
25. GGIG Graphical Interface Generator    Programming Guide    Wolfgang Britz  August 2010      Version November 2015      GGIG Graphical Interface Generator     Programming Guide    The following user guide documents the outcome of a collaborative effort of University Bonn  and the author  Larger parts of the Java code underlying GGIG had been developed over the  years in the context of projects related to the CAPRI modelling system  which received  considerably funds from the EU research framework programs  Following the general policy  in CAPRI  the GGIG pre compiled code can be used for other scientific projects as well    without charge     The author would like to acknowledge the contribution of Alexander Gocht  vTI    Braunschweig  to the CAPRI GUI coding efforts  All errors remain with the author     GGIG  Wolfgang Britz  Version November 2015 2    GGIG Graphical Interface Generator     Programming Guide    Content  OVET IO tone pn MELDE ELA LOU Oran LEIDEN LIE ee eee rere ere ener 7  Current applications Of GGIG i coe t Pret eto e Reti ug safe Qu Rea Rast pe up aaa 11  AMOVE SW on tie GUL isa onan eae 12  The anterface ener A SR 13  A A E E O 13  Mappme controls setuna to CAMS dea 13  Basic concept of the control definition file                occccccnnnoonnnnnnnnnnonononononnnnnnnnnononaninenonnnnnnos 14  Tool name  logo and background COlOT        ccooooooonnnncnnnnnononononnnnnnnnnnnononononnnnnnnonononananncncnnnnnos 16  WOTk SUCDS id iia 16  BD AG eee ats sate E MM 
26. Generator     Programming Guide    Includes found in GAMS CAPTRD GMS      Top   Declarstions   Definitions   Assignments   References   Includes   ls included by                Project   s     DATARMALLPOP GDX captrd IF EXIST   next Line     execute load       dat arm allpop gdx     WorldPop      File    Action    The use of     IF EXIST    in the context of    execute_unload    can only be motivated with the  fact to produce code which is better documented  Here  is it proposed to warn the user at run    time about the fact that the file is overwritten     Index    Controls for selections  multiple selections Generate GAMS documentation 71    BIDEN Help system 41    Controls for selections  radiobuttons 34 Interface layout 40    Controls for selections  single selections    allowed 30    Left aligned 40    On Off settings  checkbox 27  Controls to change numerical values  slider 36  Predefined selection groups in multilists 32    Controls to change numerical values  spinner  37 Several controls on one line 40    Controls to change numerical values  tables 38 String input  textfield 26      Structuring controls  separator 25  File selection  single files 28 E P    Structuring controls  tab 24  File selection  subdirectories 29 E    Table viewer  XML definition file 58    References    Britz W   and M Barek R   2003   Benlmpact  a decision support system for agricultural policy in  Benin  Poster paper at 25th International Conference of IAAE  Durban  South Africa 16 22  August
27. IMAG  t  britz trimag   View Handling Windows  f TRIMAG   result exploitation  meta data  0     my first scenario my test scenario  e      Iv     Scenario  description my first scenario my test scenario       TRIMAG Graphical User Inter      Ini file   gig ini User name   undefined User type   runner       Exploitation    The basic strategy of the GGIG exploitation tools roots in the CAPRI exploitation tools   which require that all model results are stored on an up to 10 dimensional cube  which is then  stored in a GDX container as a sparse matrix  Additional dimensions can be added if several  files are loaded  e g  to compare scenarios and or years  A specific XML dialect defines views   filters  pivots  view types  into the cube  and allows the user to load several result sets        typically from different scenarios     in parallel     If no table definition file is present  GIGG offers a GDX viewer which some interesting  possibilities not found in the standard GDX viewer  such as numerical sorting  statistics     selections   For details  the GGIG user manual should be consulted     Excurse  history of GGIG  CAPRI GUIs    Reading the following chapter is not necessary to work with the GUI  but rather intended for a  reader who is technically interested  The original software implementation of CAPRI was  based on software available at ILR at that time and comprised a DBMS realized in    FORTRAN with C C   code for the GUI  Whereas the economic model was from the    GGI
28. M CUM CA MM MEME E  17  Use Or filters TOI eXplIOItAtlOTnS os cepit bateau ceat ciedad dada 18  CONTO ia 21  Possible Helds Tor CONWMOIS ii 21  PeDe nde nc E A E E rn eran re re 22  TIPO O COROS is 24  E utes te E OO ect MM DUE 25  9197 0741   1101 cocer tob te abeat ond UNA Leu NUN M M UM EC are ee eite 26  Pane P o                   M T M 26   Ud                                                           A I 27  Check OX Tm                                                          28  lal E Ditis  cR 20  DleselDit drid e MN eM Dt eran ab 30  DIIS CIISE aeesissto tubus asain dein su su dana sn 3l  Muths i tdeo Ar E                                   32  A E E E aeta ded n Cue 35    GGIG  Wolfgang Britz  Version November 2015 3    GGIG Graphical Interface Generator     Programming Guide    EN 37  PMMA CE RTT REO DE IU NEP NONE 38  Table  Table SITHDle cod 39  Layout of the controls on the interface and style options for controls                                   4   PCTS VS UC IA resected uctus satis 43  Help ME SMS EET T EL TU UL 43  LOOPS deb teclado capa db aceite cad ey renee coin aaa ey Irae 43  Links to  PDE documents with DOOKMArKkS atada ie 44  nS GAMS toma acceda 45  Cen Pal HC EAC SSC UU oia 47  GANE and  R related Sein aia 47  SNN Te late CSC UCN isis la let alto  48  Settings linked to the exploitation tools             ooooooonncnnnnccnononnnocnnnnnnnnonononannnnnnnonnnnnnnnnnnnnnnnnnos 49  Metadata andinas anida 50  BIN Me CREER ETE T T TENET 50  Technical  concept
29. W   2006   GAMS Simulation Environment  LEI The Hague  128 pages  URL   http   www3 lei wur nl gamstools gse doc    Heidecke  C   Heckelei  T   2010   Impacts of changing water inflow distributions on irrigation and  farm income along the Dr  a River in Morocco  Agricultural Economics 41 2   135     149    Jansen  J   Adelle  C   Crimi  J   Dick  J   Helming  K   Jacob  K   Janssen  S   Jordan  A   Podhora  A   Reis   S   Roosenschoon  O   Saarela  S R   S  derman  T   Turnpenny  J   Weiland  S  and Wien J E    2012   The LIAISE Approach to Unite Researchers and Practitioners in a Community of Experts  on Impact Assessment  2012 Berlin Conference on the Human Dimensions of Global  Environmental Change on  Evidence for Sustainable Development   In  http   www  liaise     noe eu system files Berlin 20conference LIAISE9620approach final pdf     Kuhn  A   Britz  W   Willy  D  K   van Oel  P   2014   Simulating the viability of water institutions under  volatile rainfall conditions     The case of the Lake Naivasha Basin  Environmental Modelling       Software  available inline since 16  September 2014    Lengers  B   Britz  W    2012   The choice of emission indicators in environmental policy design  an  analysis of GHG abatement in different dairy farms based on a bio economic model approach   Review of Agricultural and Environmental Studies 93  117 144    Nilsson  M   Jordan  A   Turnpenny  J   Hertin  J   Nykvist  T  and Russel  D   2008   The use and non   use of policy appra
30. able implementation can be used  If necessary  step one can  be run over several parameters which may be hosted in several gdx files  so that results from    different runs can be merged into one hash table     As the gdx files provide lists of all labels used in any parameters stored in that gdx file  the  index vectors allows to build lists of labels linked for each index in a data dimension  There  exists an additional storage type in the gdx files to retrieve long texts to the labels as defined  in GAMS set definitions  However  one label may occur in different sets with different long  texts  and the gdx file does not store a possibly user defined relation between a data  dimension of a parameter and a specific set  an option termed domain checking in GAMS  In  order to link hence long texts to the labels used for a specific data dimension  two options are  possible  Firstly  at run time the user may interactively re establish the link between data  dimensions and specific sets  and thus add long texts to the labels used on that data dimension    based on his knowledge  Or the relation may be hard coded in the JAVA code     Design hints for structured programming in GAMS with  GGIG    Using information passed from GGIG    As seen above  GGIG passes information mostly via  SETGLOBAL settings  That has the  advantage that the GAMS coder is rather free how to use the information  Take the following    example  which could be generated from a slider      SSETGLOBAL STEPS 99 
31. al item in each parameter has its own record  Each of these  records provides the numerical data in double precision  depending on the parameter type  there may be different data stored in one record  as for variables its upper and lower bound   current level and marginal value etc    and a vector of indices pointing in the list of codes    described above     Loading the data from gdx files    The data matrices generated by the different tasks as described above and stored in gdx files  are typically rather sparse  so that it seemed appropriate to load the data from the gdx file into    hash tables for exploitation purposes  That is done in a two step procedure  In the first step  all    GGIG  Wolfgang Britz  Version November 2015 70    GGIG Graphical Interface Generator     Programming Guide    records from the gdx file are read and vectors of all found indices are stored  The length of  each data dimension is only known when all data records are read  and is equal to the number  of unique indices for each dimension  Once all records are read  the final length of these index  vectors then defines a linear index room for the multi dimensional table  In a second step  the  records are read again  and the index vectors for each record now allow to define a linear  index in the total table  A hash code 1s derived from that linear index to store the numerical  values into a hash table  As the number of items to store in the hash table is known  beforehand  a rather simple hash t
32. alse      barchartFilledBars   true       lineChartMaxObs   25     linechartMaxPlots   5     LineChartMaxSeries   18     LineChart3D   false     LineChartVertical   true     strokeWidth   2f      1 am     LineChartDrawLines   true     LinechartDrawShapes    true     LineChartForegroundTransparency   8     lineChartCumulative   false       linechartSort   false     The following list further tags  partially explained above     GGIG  Wolfgang Britz  Version November 2015    GGIG Graphical Interface Generator     Programming Guide     theme      null        subtheme        null          name        null          clone        null          item      null      isactivity    null      itemdim   null     regionsel      activitysel      productsel      yearsel      scensel        dim5sel      dim6sel      dim7sel      dimSsel      dim9sel        regiontext      activitytext      producttext      yeartext      scentext        dim5text      dim6text      dim7text       dimS8text      dimGtext            to handle later as props of AgpDataView   defpivot          defview        fractiondigits    1000       codesandkeys   null     comparedim    null     compareitem   null     comparemode   null     hideEmptyRows    null     hideEmptyCols   null     COO    null     pdf   null     evalall   null     language   null     Filters for the elements in the different dimensions    Without filters  all elements found on a logical dimension will be shown to the user in any  table  The exemptions ar
33. ang Britz  Version November 2015 14    GGIG Graphical Interface Generator     Programming Guide     lt control gt    lt order gt 1118 lt   o0rder gt    lt Type gt singlelist lt  Type gt    lt Title gt First year lt  Title gt      Valuer 1984 lt   Ualue gt    lt 0ptions gt 1984 1985 1986 1987 1988 1989 19980 1991 1992 1993 1994 1995 1996  lt  0ptions gt    lt gamsHame gt FirstYear lt fgamsHame gt    lt tasks gt Prepare national database   Finish national database   FSS selection routine   Build regional time series   Build regional database   Build global database   Generate trend projection   Generate farm type trends   x tasks     lt  control gt     The different tags  or keywords  are discussed in detail below   Standard Java property files  deprecated     It follows the basic implementation of a property file in Java  Each line thus consists of a key      value pair  separated by an equal sign  The definition of the controls is stored in the same  file along with general settings such as the name of the GAMS project  directories  the user    name etc      For each control  one line is used  That line comprises all the necessary information to    generate the control  as well as to store the current setting     The control definition file is text based and can hence be edited with any text editor  Most of  the settings     with the exemption of the definitions of the controls themselves     can also be  entered by the user via the controls on the GGIG interface  These proje
34. any changes in the GUI layout     That renders it inviting to think about generic tools able to generate a GUI which can interface  to GAMS  The coding effort can then be shared across projects  and user might even reduce    learning costs if they use similar GUIs for different tools  A well established example for such    GGIG  Wolfgang Britz  Version November 2015 8    GGIG Graphical Interface Generator     Programming Guide    a tool is the    GAMS Simulation Environment  GSE   by Wietse Dol  Dol 2006   GSE is  quite general  it incorporates features of an Integrated Development Interface  IDE  as well as  exploitation features  It is based on specific    tags    introduced in the GAMS code  GGIG is  certainly not a direct competitor to GSE  GSE offers different functionality and is more IDE  oriented  It might however be easier to embed some simple steering settings with GGIG into  an existing project compared to the tag based concept of GSE  GSE was in the past a  commercial product distributed with a license but can now be downloaded for free  and user  should first check carefully their requirements and what is offered by GSE or GGIG before    taking a decision for one the two GUI generators     An example of a completely different approach to a GUI for modelling tools offers  SEAMLESS IF  Rizzoli et al  2009  with its focus on component linkage  Based on OpenMI   it however requires the development of an OpenMi compatible wrapper around the GAMS  project itself  Conce
35. as first tested with very simple GAMS program   before the decision was taken to move the CAPRI GUI over to GGIG  That was probably a  lucky development for GGIG  as CAPRI was at that time already a highly complex project  with many tasks and settings  such that the further development of GGIG reflected the needs    of complex model systems     Execution of tasks via a GamsStarter and GamsThread    Execution of tasks in GGIG is handled by a GamsStarter object  An instance of GamsStarter  lets the task write out the necessary include file s  in GAMS format to generate a specific  instance of the specific task  a simulation run for a specific scenario  simulation year  with the  market model switched on or off       A GamsStarter also knows about the working directory  or other specific GAMS settings as the scratch directory  It may generate a pipe for the  GAMS output to the console to show it in a GUI     An Task can be executed by a GamsStarter who will then create a GamsThread  A  GamsThread extends the Swing Worker interface of Java so that 1t may communicate with the  normal event queue of JVM  A GamsThread can be gracefully terminated by sending a    SIGNT signal to the GAMS process  That will let the GAMS execution stop at a specific    GGIG  Wolfgang Britz  Version November 2015 54    GGIG Graphical Interface Generator     Programming Guide    point determined by the GAMS engine itself and start the finalisation handling of GAMS as    well as the removal of intermediat
36. asks gt     depends  ln  Farm branches Dairy Fattners  Sows lt  dependsOn gt    lt fcontrol gt     The following example disabled a tab if a checkbox titled    GHGs    is not checked      lt control gt    lt Type gt tab lt  Type gt    lt Title gt GHGs and HMACs lt  Title gt    lt   tasks gt al1 lt  tasks gt      amp depends  n BHESSEBNE    depends  n    lt  control gt     The  lt dependsOnAll gt  field checks that for all controls at least one setting matches  In the  following example  the panel is only shown if one of the listed farm branches and one of the    listed crops are selected     GGIG  Wolfgang Britz  Version November 2015 22    GGIG Graphical Interface Generator     Programming Guide     lt control gt    lt Type gt panel lt  Type gt    lt Title gt Cereals lt  Title gt      lt tasks gt Single farm run  Calculate HAaCs lt  tasks gt   N  Farm branches  Arable Crops  WinterCere SummerCere  MaizCorn lt  dependsoOnall gt    lt fcontrol gt   The  lt dependsOnAll gt  field can also be used to only show the control if several values from a  multi selection control are selected  by listing all necessary combination of the control name    and the settings  e g      lt control gt     lt Type gt panel lt  Type gt     lt Title gt Cereals lt  Title gt     lt tasks gt Single farm run  Calculate MACs lt  tasks gt     lt dependsOnAll gt Farm branches  Arable Crops  WinterCere SummerCere  MaizCorn Farm branches  Dairy lt  dependsOnAll gt    lt  control gt     In the above case  the
37. ce Generator     Programming Guide    Table   TableSimple   Purpose   Define a table with floating point values passed to GAMS    Applicable fields    Title  GamsName  Value  Columns  Rows  Dim3s  Range  Tasks  Style    Control optic     Inputs               Price Growth rate  94        F     Y  Wage rate full time    Euro  hour      Wage rate half time    Euro  hour      Wage rate flexible  hourly   Euro hour      Maize silage    Euro t      Gras silage   Euro t      aM        12 00  10 00  30 00    24 00    User action   e Edit single fields with numerical values  Cut Paste via clipboard possible    Example definition      lt 1  wages catt conc   oild  pigs conc  Diesel ASS  AHL  seed  KAS  PK  Kalihag Lime Herb Fung  Insect  gowth water   MANI Sa    lt control gt    lt Type gt tableSimple lt  Type gt    lt Title gt Inputs lt  Title gt    lt columns gt Price Growth rate      lt  columns gt       value    1 8  8 0 7 0 6 0  32 28 0 081 208 220 2580  1158  556 366 666  6 76  8 31 0 35  1 88  6 31  8 29  8 35 59 0  1 90 1 90 1 90  1 0 2 50  9 34   1 8  1 0 1 0 1 0  1 8  1 8 1 8 1 8  1 8 1 8  1 8  1 8 1 80 1 8  31 8  31 8  1 8  31 8  1 6  1 8  1 8  1 8  31 8  1 8 1 8  1 8 1 8  1 8    lt fuvalue gt    lt rows gt     Wage rate full time   Euro hour    Wage rate half time   Euro hour    Mage rate flexible hourly   Euro hour    Maize silage   Euro t    Gras silage   Euro t    Manure   Euro t    Cattle concentrate type 1   Euro t    Cattle concentrate type 2     Euro t    Cattle conc
38. cge qms lt  gamsFile gt    lt incFile gt regege_settings lt  incFile gt    lt regionDim gt   amp  regionDim gt    lt Dim5bim gt 1 lt  Dim5Dim gt    amp actiuityDim  24 actiuityDim    amp productDim  34 amp  praductDim    amp scenDim  A4 scenDim    lt yearbim5 lt  yearDim gt    amp useHeta true amp  useleta     amp resdir  regcgez resdir    amp Filemask  res  6 9  4 testShocks  41 gdx  lt  filemask gt     lt  task gt     The tasks are put in the order as they are defined in the control file on the left hand side of the    interface  below the work step panel  if work steps are defined         DAIRYDYN     gams     File Settings Utilities  DAIRYDYN tasks General set       O Calibrate DAIRYDY      2 Single farm run        Exploit results    The following attributes are possible for a task  Name defines the name of task  shown on interface  required   camsFile defines the name of the GAMS project to start  optional   resDir result directory where the results are stored  optional     filemask regex string used filter the files shown in the scenario exploitation    boxes for the task  required   incFile defines the name of include file used by the task  optional     edxsymbol defines the GAMS symbol  set  parameter  to load for exploitation  GGIG  Wolfgang Britz  Version November 2015 17    GGIG Graphical Interface Generator     Programming Guide    llogicaljdim position of the logical dim in gdxsymbol  where logical region   activity  product  year  scen  dim5  dim9   filters filt
39. ct independent controls  are to a larger extent borrowed from the CAPRI user interface  On top  a first rudimentary    control editor 1s embedded in the tool   Call of GGIG  In a normal installation  there are two files     1  One default file with the control definitions and related default values  That file should    be typically under version control     2  A second file which is installation specific  it will solely store the values entered by  the user on the interface and will be in the Java generic    ini    format  Its content is  updated each time the interface is closed  the next run will re load the control and    other setting from that file  That file should not be under version control   A typical call will therefore look like     Java Gig jar project ini project_default xml    GGIG  Wolfgang Britz  Version November 2015 15    GGIG Graphical Interface Generator     Programming Guide    Where the first argument relates to the project    ini    file which stores the current user settings   it will updated when the interface is closed   The second argument defines the GGIG  definition file  It is hence possible to host several GGIG based installations in one directory    where the jars etc   are stored     Tool name  logo and background color    The following three XML tags allow setting the tool name  the logo shown on the interface    and the background color      lt toolName gt  lt attr gt FADNTOOL lt  attr gt  lt  toolName gt    logo gt  lt attr gt fadntool log
40. d by the UNECE forest and timber statistics     Wi uners    Forestry omers        privSnall    Up to 100 ha    priv  th    All other private forest ousers      pub    Publicly owned forest      All  Used For trade regions where no differentiatin is available     t        Owners are assumed to differ in their management  depicted by a different reaction to orice       It the user presses tl    Starting GAMS from GGIG    GGIG allows starting the GAMS project directly from the interface  either in compile or run  mode  A break request can also be sent to GAMS     stop GAMS       Compile GAMS       Start GAMS Stop GAMS    Once started  the GAMS project routes its output to the console back to lower right part of the    interface     GGIG  Wolfgang Britz  Version November 2015 45    GGIG Graphical Interface Generator     Programming Guide            farm_constructor gms  91  3 Mb A        exp starter gms  74  3 Mb        ini herds gms 19  3 Mb         title gms  30  3 Mb        ini_herds gms  86  3 Mb       exp starter gms 78  3 Mb        decl gms  29  3 Mb       exp starter gms 195  3 Mb        title gms  30  3 Mb       exp starter gms  202  3 Mb        title gms  30  3 Mb       exp _starter gms  240  3 Mb        store_res gms  232  3 Mb       exp _starter gms  323  3 Mb        title gms  30  3 Mb       exp starter gms 325  3 Mb R       store_res gms  232  3 Mb       exp starter  gms  344  3 Mb       Status  Normal completion       Job exp starter gms Stop 12 01 10 21 06 06 elaps
41. d hence be given to keep the  number of tabs and the assignment of controls to tabs such that a user can easily check all key    inputs     GGIG  Wolfgang Britz  Version November 2015 29    GGIG Graphical Interface Generator     Programming Guide    Separator  Purpose    Used to structure the interface  gives a title for the next block of controls and keeps    them together  top to bottom   Applicable fields   Title  Value  Tasks    Control optic        Settings for objective function  Example definition      lt control gt    lt brder gt 2016 lt forder gt      lt Type gt Seperator lt  Type gt    lt Title gt Supply model lt  Title gt      lt tasks gt Baseline calibration market model   Baseline calibration supply models   Run scenario with market model Generate expost results  Run scenario without market model lt  tasks gt    lt  control gt     Panel  Purpose    Used to structure the interface  starts a block of controls which are order from top to  bottom  Similar to separator  but not titled  One separator can span over several    panels   Applicable fields     Tasks    GGIG  Wolfgang Britz  Version November 2015 26    GGIG Graphical Interface Generator     Programming Guide    Text   Purpose   Allows the user to enter text  Used e g  to name the output generated by a run   Applicable fields    Title  Value  Tasks  Style    Control optic     Scenario description   my first scenario    Possible value    Any text allowed  User action    Edit with keyboard  Example definition  
42. d uncooked  poultry meat with a focus on trade bans related to Avian Influenza  developed in the    context of the NTM Impact project  Wieck et al  2012      e A EU wide layer of regional CGEs with a focus on Rural Development measures on  the second pillar of the CAP  which 1s now incorporated into CAPRI  cf  Schroeder et  al  2014      e LANA HEBAMO  A Hydro Economic model for the lake Naivasha in Kenya  Kuhn  et al  2014      GGIG  Wolfgang Britz  Version November 2015 11    GGIG Graphical Interface Generator     Programming Guide    e The FADNTOOL project which combines a set of economic tools for simulating  policy impacts based on the FADN data     e A user interface augmented version of GTAP in GAMS     e An Agent Based model for structural change in agriculture  which is realized in  GAMS  but uses GGIG as its user interface     e BW GLOBAL FOR  a Multi Commodity model for wood and wood based products   Britz et al  2014     e JORDMOD II  a recursive dynamic agricultural sector model for Norway    And last not least  the GUI of CAPRI  Britz 2014b  now is implemented in GGIG     An overview on the GUI    5         CgeRegEU   t britz capri gams     Hol x J          File Settings Utilities  CgeRegEU  tasks       General settings   Methodological switches  Calibrate CGE CgeRegEU  General setting      Run policy experiment  Run test shocks  Scenario description cge rd plusi0    Use seperate threads  v                        Compile GAMS    StartGAMS    StopGAMS    Exploit 
43. de lists in predefined tables    Language to load from tables  xml English Clean window with GAMS output with each new GAMS compile start  Use task specific settings in interface     F  Debug XML table definition  output to OS prompt          Save in dairydyn ini       The standard table file can be defined in the XML      lt emiTables gt  lt attr gt tables xm lt fattr gt  lt f  xmTables gt     GGIG  Wolfgang Britz  Version November 2015 40    GGIG Graphical Interface Generator     Programming Guide    Meta data handling    Why meta data     Meta data are data about data  In many GAMS projects  it is impossible or cumbersome to tell  exactly based on which shocks and settings results of a model run had been generated  That is  due to the fact that run specific settings are not stored at all or not stored together with the  results of the run  Later on  result users are often left guessing what exactly the settings    underlying the run might have been     In order to overcome that problem  the GGIG  drawing on CAPRI GUI concepts  forwards all  interface settings   plus the user name and the current time   to GAMS in one SET called    META     A correctly defined interface with GGIG should allow to steer all run specific settings  If that  is the case  the meta data generated by GGIG will provide an exact and sufficient definition of  all run specific inputs  ensuring that all relevant meta data about a run are stored along with  quantitative results in the same GDX file  Acco
44. e GAMS call  Experienced model users     typically the    code developers themselves     know how to change run specific settings in the GAMS code       The code can also be used from inside Java  but that feature is not discussed in the documentation     GGIG  Wolfgang Britz  Version November 2015 7    GGIG Graphical Interface Generator     Programming Guide    and do so typically quite efficiently  As a consequence  they seldom feel the need to develop a  GUI steering their GAMS project  The need to invest in GUI development might have even  decreased as the GAMS IDE now offers some basic functionality often found in project  specific GUIs  such as starting GAMS  inspecting parameters found in the listing file or    viewing the context of a GDX file     However  a GAMS code only solution for an economic model typically poses a serious entry  barrier to newcomers for two reasons  cf  Britz 2014a   Firstly  possible users are often not  familiar with GAMS  But  even with some elementary knowledge of the language  they might  face problems understanding project specific GAMS code making use of advanced GAMS  features  Secondly  they face the challenge to familiarize themselves with the specific code of  the project  file structure  symbol names  set elements       In order to use the GAMS code for  applications  a user needs to learn enough to know exactly which specific code changes are  necessary to implement e g  scenarios in a given project  Large and or complex GAMS code 
45. e defined solely on filters without any specific item dimension      lt table gt    lt theme gt Trade lt  theme gt    lt name gt Exports lt  name gt    lt regionsel gt all lt  regionsel gt    lt productSel gt all lt  producttel gt    lt activitysel gt trade transCost  tariff regex lt  activitysel gt    lt hideEmptyRows gt yes lt   hideEmptyRows gt    lt hideEmptyCols gt yes lt  hideEmptyCols gt    lt dim55el gt reg lt  dim55el gt    lt dim gt Text gt Importing region lt  dim5Text gt    lt itemDin gt none lt  itemDim gt    lt defPivot gt   4RSD lt  defPivot gt     lt  table gt     Additional tags   lt subTheme gt     Allows introducing sub themes in the table selection     Additional tags   lt defpivot gt    The definition of the default pivot for a view consists of a setting as shown below   lt defpivot gt rowGroups product  rows dim7  columnGroups   columns scenario   lt  defpivot gt   Deprecated old style    The deprecated old style to define the pivot string consists of 4 characters  The first character  position is for the table row blocks  the second for the table rows  the third for the column  blocks and the last for the columns  The logical dimensions are labelled with the following  characters     GGIG  Wolfgang Britz  Version November 2015 63    GGIG Graphical Interface Generator     Programming Guide    A Activity  D Dim5  I Items    M Activity and Product merged    P products   Q Year and dim5 merged   S Scenario   R regions   X Region and dim5 merged    5  9  Dim
46. e files and directories     Refactoring the mapping part    When the 1x1 km grid layer was added to CAPRI during the CAPRI Dynaspat project  it  became obvious that the existing JAVA code used to produce maps in the CAPRI GUI needed  some revision  especially regarding the way the geometry was stored  In this context  the  question of using an existing GIS independently from CAPRI or the use of existing GIS  classes plugged into the CAPRI GUI was raised again and some tests with open source  products were undertaken  A stand alone GIS as the sole option was certainly the less  appealing solution  Firstly  it would have required exporting data from the GDX containers  with CAPRI results to the GIS software  producing rather large intermediate files  It would  also have left the user with the time consuming and often error prone task of exporting and  importing the data  Secondly  the user would need to switch between two different programs  and GUI standards  And thirdly  all the usual problems with installing and maintaining  additional software on a work station would occur  However  as indicated later  the GUI  naturally allows passing data over to external applications and does hence not prevent the user    from using a full fledged GIS solution     The main points taken into account during the search of a map viewing solution for CAPRI  were   1  possibility to import data from the CAPRI GUI efficiently   2  user friendliness    3  performance and  4   in the case of plug
47. e put on the interface in the order they are given in the XML     The following fields are available     Type defines the type of control  required   The different types are discussed below  in detail    Title defines the description of the control as seen by user  required    GamsName defines the name of global settings resp  SET name  optional    Value pre selected setting s   optional    Options list of available options  required where applicable    Range Min  max  increment  major ticks  or number of rows shown  required where  applicable    Tasks List of tasks to which the control belongs  If empty  1t belongs to all tasks   Tooltip A tooltip text hovering over the control   Pdflink Link to a pdf file and chapter to open on mouse over   Selgroups Selection list opened by pop up menu  see Multilist control    Style Different style options  optional    Disable Control is blocked for input     useful to show settings on interface which are  should be sent to GAMS for a specific task    dependsOn Defines inclusive O dependencies to other settings of other controls  optional    dependsOnAll Defines AND dependencies to other settings of other controls  optional     GGIG  Wolfgang Britz  Version November 2015 21    GGIG Graphical Interface Generator     Programming Guide    Dependencies    The  lt dependsOn gt  and  lt dependsOnAll gt  fields allows to define dependencies between  controls  i e  under which settings of other conditions the current control is visible or enabled
48. e the items either defined for the product or the activity dimension   see above  In order to restrict the selection in the other logical dimensions  a selection list can    be defined in the table definition  Take as an example the following XML tag    lt regionSel gt MS RM lt regionSel gt     It means that the table will only show elements with the tag  lt region gt   see below  which  comprise MS or RM in their  lt sel gt  field  The example would refer to the Member States     There is a specific selection list    lt regionSel gt FromDataCube lt regionSel gt     Which will neglect the elements under  lt region gt  as defined in the file  but rather takes any  one found in the data cube  The option was introduced originally for CAPRI to avoid the    necessity to define all 180 000 HSMU codes in the file   Alternatively  a regex string can be used  e g       dim5Sel  red 0 9    regex   dim5Sel      GGIG  Wolfgang Britz  Version November 2015 68    GGIG Graphical Interface Generator     Programming Guide    In both cases  the code will nevertheless try to locate matching entries in the predefined lists  based on their keys   Attaching long texts and filters to elements    Items for activities  products  regions and dim  are typically defined in the file  see the    following example     region      key   5K020038   key     lt itemName gt SK020   FT41   GT100   Specialist dairying  FT 41  lt  itemName gt    lt sel gt  all  RS  SK  FA  SKFA  FT41  GT100  FT41GT100  lt  sel gt 
49. e the technical  document    Javadoc like technical documentation for CAPRI    to be found on the Capri web    page under technical documents   The controls on top allow the user     e To define in which directory the    EXP        REF    and    GDX    files are stored which    serve as input into the documentation generator   e To choose the directory where the HTML files will be generated   e To select the tasks covered by the documentation generator     For details on the use of the GAMS documentation utility  refer to the user guide    Background    System such as CAPRI have grown over years to a rather complex  bio  economic modelling  system  Its code base consists of hundredth of single GAMS files  and ten thousands of lines     Not only newcomers face the challenge to get an overview about dependencies in the huge    GGIG  Wolfgang Britz  Version November 2015 74    GGIG Graphical Interface Generator     Programming Guide    code base and to link the technical implementation to methodological concepts and  documentation  On top  the large scale character of CAPRI often asked for technical features  in the GAMS code which are far from the solution chosen for tiny examples as often  presented in courses  as the wide spread usage of dynamic sets  conditional includes  the    usage of  batcinludes or the application of the grid solve feature     The task of documenting and keeping an overview of the CAPRI code base is certainly not  eased by the fact that basically any ob
50. e used  the tooltip texts must be enclosed in with a     lt   CDATA      gt  tag as shown below      lt tooltip gt  lt t CDATA The new market layer defines an additional geographical layer of country aggregates lt BR gt    with homogenous border protection and market intervention measures  e g  EU  MERCOSUR countries    lt BR gt   If switched on  all trade policies  tariffs under trq  entry price system  intervention  flexible levies  lt BR gt   are defined at the new geographical level   lt BR gt   Be aware that before running a scenario  you need to re calibrate the model with this option switched on  lt BR gt   For more information contact Mihaly Himics    gt     lt  tooltip gt     Links to PDF documents with bookmarks    The  lt pdfLink gt  field  available for tasks  worksteps and controls  can be used to let the user  open a bookmark in a pdf documentation when the help key Fl is pressed  The tooltip will    inform the user if a PDF link is registered     Price dependent harvest rate    Defauit  true     gamsName  updateHarvestRate   Press Fl to open PDF  bookmark      ModelDocumentati ym para       If MS Word docs are saved as PDF  so called textmarkers can be generated  under options   unprintables are similar  from headings  the Adobe PDF generators offers the same  functionality  The PDF files are defined relative to the GUI directory  1 e  in the example  above  the files must be found in the GUI directory     If the user presses the Fl key  the PDF documentation 1
51. ed 0 00 00 047  GAMS RC D     s     lt   gt     The pane with the content can be scrolled by a right mouse click in the pane to open a popup  menu  If an editor is added under    opther options     the GAMS and the listing file can be    opened as well     Open gams file     Open gams Ist file           Scroll Lock    The pane can hence be    frozen    so that e g  the status of a model solve can be inspected while  the project continues to run  In order to successfully start a project  the ini file for GGIG must  comprise the information where the GAMS executable can be found  but also where the    GAMS code of the project to start is stored     GGIG  Wolfgang Britz  Version November 2015 46    GGIG Graphical Interface Generator     Programming Guide    General interface settings    The interface has a few standard settings which can also be accessed via the    edit settings    dialogue   These are     e Certain file locations  the directory where GDX files for results are assumed to be  stored  resDir   and three directories which can be used to adjust the specific model  application  the root of the GAMS file  workDir in GAMS   called modelDir  a    directory for restart files and one for data files     FA Option  Option  User Settings   TRIMAG System Settings       TRIMAG model files directory  Abritzitrimag    Result Directory   britz trimag    Restart Directory   britz trimag    Data Files Directory   britz trimag                Note  The name of the system  here TRIMAG
52. el gt     7     put   lt factivity gt             That allows to group view definitions used by several tasks in one file  and to use these    groups for a specific task  The following shows an example from CAPRI      lt  xml version   1 8    gt    amp tables  xmlins xi   http   wwuw wu3 org 2881 xInclude     lt themes gt Welfare Farm Farm   totals Feed Fertilizer  Environment lt  themes gt      amp xi include href  views coco tables xml   gt    lt xicinclude href  views capreg tables xml   gt    lt xicinclude href  views dimdefs  xml   gt      lt  tables gt     The used of  lt xi include gt  allows to also generated XML files on the fly by GAMS and pass it    to the viewer  e g  to reflect flexible lists of regions     The structure of the GAMS generated gdx files used by the  exploitation tools    The exploitation tools load directly the gdx files generated by the GAMS processes linked to  the tasks described above  The gdx files only store non zero numerical values  The main  content of a gdx file are two types of records  The first type provides a list of all labels used to  identify the numerical data in the gdx file as GAMS does not support numerical indices  but  requires character labels  The list does not distinguish for which data dimensions the labels  are used  They are hence typically a mix of product  activity  region and further labels  The  second type of records belongs to GAMS parameters  scalars  vectors  or multi dimensional  tables   Each non zero numeric
53. ements  which can be included into a GAMS R project to generate a specific run   4  It allows execution of GAMS or R   5  It offers aGDX viewer which supports the definition of pre defined reports   The overview on the process is shown in the diagram above     In order to allow the run specific settings to enter a specific GAMS project  the generated  include file should define the sole entry point of run specific information  The state of the  controls     passed to the include file   should hence define all the necessary information for a  specific run  The GAMS code should accordingly not allow for or require additional changes  to generate a    scenario     1 e  a specific run  It is however easy to use a text control in GGIG to    enter directly the name of a include file     The include file generated by GGIG which reports the state of the controls is overwritten each    time the user starts the GAMS project     Basic concept of the control definition file    GGIG supports two formats for definitions file  XML based property files or standard Java  property files  The later are only supported for backward compatibility and should no longer  be used for new GGIG projects    XML property file    The core of GGIG consists of the control definition file  The XML property file defines a  controls  tasks  etc  based on XML tags  As the XML file is parsed by a standard Java XML    parser  these tags can additional by stored in different lines  see example below     GGIG  Wolfg
54. entrate type 3   Euro t    Oils for feed  Pigs concentrate type 1   Euro t    Pigs concentrate type 2   Euro t    Pigs concentrate type 3   Euro t    Diesel  ASS  AHL  seed  KAS  PK_18_16  KalihMag  Lime  Herb  Fung  Insect  growthContr  water  hailIns   lt  rows gt    lt range gt 6  66666661  1566   6  5  5   1 lt  range gt    lt gamsName gt p_inputPrices lt  gamsName gt    lt tasks gt Single farm run  Calculate MACS Experiments dairy Experiments arable lt  tasks gt      lt  control gt     GGIG  Wolfgang Britz  Version November 2015 39    GGIG Graphical Interface Generator     Programming Guide    Notes     e The value field gives first the default value for a column  next a set of default values  for the rows for that column  Afterwards  additional columns follow the same scheme   It is therefore recommended to put all values for one column in a row to increase    readability     e The range field might comprise several tuples of    low up increment    which will then  be assigned to the columns of the tables  If there is only one tuple  it will be used for    all columns     e If arange is given  a spinner will be used as the cell editor and values outside the range    will be rejected     e The content of the table can also be loaded from a GDX file  in which case the name    of an GDX file must be entered under  lt options gt  lt  options  Output to GAMS       Inputs  TABLE p_inputPrices               Price     Growth rate     Wage rate full time   15 88     Wage rate ha
55. epicted below  At its core stands the GGIG Control  generator  based on Java code  Based on a XML based definition file provided by the project   it generates a project specific GUI which can be operated by the user  The state of these  controls such as numerical settings  on off settings or n of m selection can be passed to  GAMS by an automatically generated include file which also contains automatically  generated meta data  The user can also execute GAMS from the GUI  The GUI can equally  load numerical results and meta data in a specific GDX viewer  The latter supports    view  definition     1 e  pre defined reports to exploit the results  The details of the different elements    are discussed below     GGIG  Wolfgang Britz  Version November 2015 10    GGIG Graphical Interface Generator     Programming Guide    GGIG  Controls and Settings GGIG    definition file Control  Generator    GAMS   F  Project specif  include file D an    GAMS    cox   executable      2    SLICI  Leenjre             GAMS  project code             Diagram  Overview on information flow in GGIG    Current applications of GGIG    Since the first prototype  GGIG has been successfully implemented 1n a number of projects     examples are listed below     e DairyDyn  an fully dynamic single farm model focusing on the impact of Green House  Gas emission indicators on allocation and investment decision  cf  Lengers and Britz    2012     e A small  spatial multi commodity model for world trade of cooked an
56. ers for scenario input  see below   xmltabledef task specific view definition file in XML format   PDF Link Context sensitive link as via a PDF bookmark  If no gamsFile incFile or resDir are given  the general ones defined in the ini file are used   Tasks without a GAMS or R clearly cannot be executed  but they can be used to exploit GDX  files  That allows to e g  to explore different parts of data bases   Use of filters for exploitations  Filters are used to    1  To let the user select from the GDX files which are potentially generated by the task    based on a specific content selection   e g  only files from a specific year    2  To introduce a filter on the GDX element loaded in the viewer  e g  to only load    records for a specific country  A filter definition consists of 3 fields     1  The logical dimension to which it is applied   region  activity  product  year  scen     dim5    2  The selection control which is used for the filter  3  The type of filter     a     Starts_with    or    ends_with    for GDX element filters  1 e  only such  records will be loaded where the item describing the logical dimension starts    with one of the selected keys     b     File_Starts_with    will selected input files which match the selection of    another control  such as in the following example     zdata amp setsels   attrsTypes filesel Title Dataset Options Xdatdi rXX   gdx r ang e  1  tasks none  x attr     datasetsel    aaa 912 line  sj not displayed                        
57. ext       activityText       lt regionText gt     lt regionText gt      lt productText gt     lt productText gt      lt scenText gt     lt scenText gt    lt dim5Text gt     lt dim5Text gt        lt yearText gt     lt yearText gt   That text 1s shown     e As    Region    description     lt dim9Text gt     lt dim9Text gt     above the outer drop down    Years         European Union 27    e In the pivot dialogue     w   2013 v       IPLE    e And in gaphics   map titles and the like     GGIG  Wolfgang Britz  Version November 2015    selection boxes     65    GGIG Graphical Interface Generator     Programming Guide    Additional tags   lt clone gt     The tag uses the item and other definitions from another table  and can be used e g  to show    the same selection in a different pivot or view types  e g      lt table gt    lt theme gt Welfare lt  theme gt    lt name gt Welfare comparison  overview across regions lt  name gt    Emne  Welfare overviews  clone gt    lt defpivot gt   8RBS lt  defpivot gt     lt  table gt     The clone tag must immediately follow the name tag  as otherwise  preceding definitions are    lost     Additional tags   lt drop gt     That tag 1s uses in conjunction with a  lt clone gt  and allows removing an item from the cloned    table definition      lt table gt    lt name gt Income  per capita lt  name gt    lt clone  gt Income lt  clone gt    lt GPop gt Private consumption price index lt  drop gt      lt  Table      Further tags    There is a longer li
58. hat only quantities are supported  so that the tool  covers natural breaks  quantiles  equal spread  mean standard and nested means  Area    weighting is supported as well     In order to export data to other applications  the tools support first of all tab delimited  clipboard export  allowing import e g  into EXCEL  Maps can be exported as JPEGs over the  clipboard and to disk in several other formats  Alternatively  the user may export the data to  an external file  in CSV format  DBF  to MS Access or to GAMS  DBF export will generate a    second file comprising meta data     The exploitation tools of CAPRI build on a rather simple structure  Each CAPRI work step  stores its results as a GAMS parameter  representing a multi dimensional sparse cube which is  stored as a GDX file  The exploitation loads the non zeros from one or several GDX files into  memory  However  given the length of the different dimensions and the use of short codes   the user would be typically lost on his own in the large tables  The XML definition file is the  equivalent of a collection of    SQL queries    as it defines views which combine filters in the  dimensions of the cube with information on how to show the results  pivot  table  graph or    map      GGIG  Wolfgang Britz  Version November 2015 59    GGIG Graphical Interface Generator     Programming Guide    XML definitions for views    Why a XML definition files for views     The exploitation tools of GGIG build on a rather simple structure
59. help key  can be registered with tasks  worksteps and    controls     4  Similarly  PDF links and tooltips can be registered with views  see section on the    exploitation part     5  The exploitations part has fixed registered PDF links to the GUI user guide linked to    various controls and dialogue     Help menu items    GGIG allows adding three types of menu items to the menu bar   1  HTML links   2  e mail  sent items and  3  PDF links      lt helpmenuitem gt    amp name  Uiew capri web page lt  name gt    lt value gt http   wwu capri model  org lt  value gt    lt fhelpmenuitem gt      lt helpmenuitem gt     name gt Send mail to capri user list lt  name gt    lt value gt capritalks6ilr uni bonn de lt fualue gt    lt type gt mail lt  type gt     lt fhelpmenuitem gt      lt helpmenuitem gt    lt name gt GTAP in GAMS user guide lt  name gt    lt uvalue gt    doc GTAPinGAHS with a GUI  pdf lt  ualue gt    lt type gt pdF lt  type gt     lt fhelpmenuitem gt     Tooltips    GGIG shows as the default tooltip the default value of the control and its GAMS name     GGIG  Wolfgang Britz  Version November 2015 43    GGIG Graphical Interface Generator     Programming Guide    Price dependent harvestrate J    Defauit  true        gamsName      Further tooltip lines can be append with the  lt tooltip gt  field  HTML tags can be used to format  these additional lines  e g   lt BR gt  to begin a new line   lt B gt  to put text in bold or  lt I gt  to show  text in italics  If HTML tags ar
60. ing systems  e g  the  2030 system develop for the Global Perspective   s  Unit of the FAO     To avoid that many ASCII files were generated  the next evolution step was a pure Java GUI   released around 2006  with direct access to GDX files which is the still the basis of the current  Java code underlying GGIG  GDX files are an internal file format used by GAMS which  allows a rather efficient I O for large sparse tables  An API library delivered as part of GAMS  installation allows to access GDX files from other applications  That design has the obvious  advantage to be firstly based on the portable JAVA language  Secondly  as no external DBMS  is used  it is possible to use CAPRI or other modeling systems applying GGIG by solely  executing GAMS programs  Such a model might hence run on any system supported by    GAMS  without the need to install additional software     The next version of the CAPRI GUI consisted of three rather independent components   Firstly  a GUI to control the different work steps of CAPRI programmed in Java  That code  dealt mostly with defining GUI controls  button  scroll down lists etc   to manipulate  properties of CAPRI tasks  and then to start them as GAMS processes  That part has been  thoroughly refactored with the revision of 2008  That refactoring introduced tasks as formal    objects in the Java code of CAPRI  however in a far less generic way as it is done in GGIG  A    GGIG  Wolfgang Britz  Version November 2015 53    GGIG Graphical Inte
61. ional database   Finish national database   FSS selection routine   Build regional time series        Build regional database   Build global database   Generate trend projection   Generate farm type trends    lt  tasks gt     lt  control gt     Output to GAMS    SETGLOBAL Choose model tupe PE  Note   e  heuser cannot deselect  i e  one of the options is always active     e  he selection possible can also be loaded as a set from a GDX file      lt options gt  datdir WWtask   Input file    gdx   gdx setname r lt  options gt     GGIG  Wolfgang Britz  Version November 2015 31    GGIG Graphical Interface Generator     Programming Guide    Multilist   MultiListNonZero  Purpose  Used for m of n selections  i e  in cases where features are not mutually exclusive     Multilist allows m   0  i e  also empty selection  MultiListNonZero requires m  gt  0  1 e  at least    one element must be selected   Applicable fields   Title  GamsName  Value  Options  range  Tasks  Style    Control optic          Countries  s    Countries  Msg IT ML ATPT    Notes   e left hand side  range 0 right hand side  range   3    e Drop down list will appear if the user clicks on arrow  and number of elements  gt     range and range lt  gt 0    e A negative range will generate a number of rwos  and define endogenously the    number of columns such that all selection possibilities are visible  as seen below     2004 2005 2006 2007  2008 2009 2010 2011  Simulation years  2012 2013 2015    2025 2030 2035 2040     
62. isal tools in public policy making  an analysis of three European countries  and the European Union  Political Science  41  4   335 355    Rizzoli  A E  et al   2009   Updated version of final design and of the architecture of SEAMLESS IF  Report No 47  SEAMLESS integrated project  EU 6th Framework Programme  contract no   010036 2  www SEAMLESS IP org  31 pp  ISBN no  978 90 8585 590 3    Schroeder  L  A   Gocht  A   Britz  W   2014   The Impact of Pillar II Funding  Validation from a  Modelling and Evaluation Perspective  Journal of Agricultural Economics  in press     Wieck  C   Schl  ter  S  W   Britz  W   2012   Assessment of the Impact of Avian Influenza Related  Regulatory Policies on Poultry Meat Trade and Welfare  The World Economy 35 8   1037 1052    GGIG  Wolfgang Britz  Version November 2015 80    
63. ject in GAMS has global scope  The concept of  functions of subroutines underlying many other programming languages with clearly defined  lists of variables passed in and out is not implemented in GAMS  Encapsulation and  modularisation are hence not naturally supported by GAMS  That also renders automated    documentation of the code more challenging compared to other languages     Since quite a while  CAPRI user community discusses about some refactoring of the code  base on more clearer coding standards with the aim to ease code maintenance  documentation  and further development  That refactoring should also cover standard for in line  documentation  including a better link to the methodological documentation  The project  CAPRI RD  2009 2013  has attacked some of these tasks for CAPRI in specific working  packages  But clearly  that will only become success if the underlying concept is generally  accepted and implemented by the community of CAPRI developers  That means that the  value added of following coding and documentation standards must be visible to any    developer     The section here shows how to generate an easy to maintain and useful technical  documentation for GAMS based projects such as CAPRI  based on the example of  JAVADOC  http   de wikipedia org wiki Javadoc   It is organized as follows  The next short  paragraphs will list desired properties of a technical documentation for a system such as  CAPRI  followed by a more detailed discussion of a proposal
64. ket model Generate expost results  Run scenario without market model   Baseline calibration supply models   HSHU baseline   Downscale scenario results   4 tasks gt    lt  control gt     Output to GAMS      SETGLOBAL Priorities false    GGIG  Wolfgang Britz  Version November 2015 28    GGIG Graphical Interface Generator     Programming Guide    Filesel   Dirsel  Purpose    Used for 1 of n selections of a list of files respectively directories  That is e g   interesting when the user can chose from a list of pre existing scenario definitions in    GAMS files or to select a directory from which different data files are loaded   Applicable fields   Title  GamsName  Value  Options  Tasks  Style    Control optic   Scenario description  cge rd plusi        Note  Drop down list will appear if the user clicks on arrow   Possible value     Defined by the file selection string in options field   e g     lgams  pol_input  cge_  gms  The file extension fill be automatically removed from    the items   User action   tick   untick one of the selection possibilities with mouse    Example definition      lt control gt    lt order gt 1018 lt  o0rder gt     Type  EREBSBT    Type gt    lt Title gt Scenario description lt  Title gt    lt Value gt MTR_RD lt  Value gt    lt Dptions gt   i1gamsxpol_inputx  gms lt  Options gt    lt Frange gt B lt  range gt    amp gamsHame   result types gamsHame    lt tasks gt Baseline calibration market model   Baseline calibration supply models   HSHU baseline   Ru
65. ks gt     lt  control gt     3  Width and height for tables and selection lists  e g       control    lt Type gt TableSimple lt  Type gt    lt Title gt  o0i1l lt  Title gt    amp columns  Shares calumns     rous  1  Light  m  Middle   h    Heayy   lt  rows gt    amp gamsHame  p soilShare lt  gamsName gt      amp ualue  B8 33 8 33 8 33 8 33 amp  ualue   irange  8 8 1 8 8 814 range    amp gamsHame  p soilShare lt  gamsName gt    lt tasks gt Single farm run  Calculate HACS Experiments dairy Experiments arable lt  tasks gt    lt style gt  22284  stule gt     lt  control gt     If different style options are present  they should be separated by comma     As a consequence of the layout concept discussed above  the following recommendations can  be given  Firstly  in order to allow for resizing of the overall the GUI  not too many controls  should be place on one tab  Secondly  individual blocks of controls should be kept small to    avoid that the page height becomes too large  Thirdly  controls should be linked to tasks and    GGIG  Wolfgang Britz  Version November 2015 42    GGIG Graphical Interface Generator     Programming Guide    user levels and dependencies between controls should be used where possible to hide not    active controls     Help system  The help system consists of different elements     1  Help related menu items  links to web pages  PDF documents  can be added to the    menu bar   2  Tooltips can be registered with controls    3  PDF Links  opened with the Fl 
66. l create their own scenarios and in  some cases even own variants of the export data  which will lead to processes requiring  considerable processing and storage resources  A client server solution where the production  process and data storage would need to be hosted on a web server is therefore not a preferred  solution  also as users will often develop variants of the modelling system by code  modification in GAMS  and contribute to its development  The structure of the data driver  would however very easily support linkage to a network or WEB based data bases  It should  however be noted that the data base and GAMS code are managed via a Software versioning  system  which is a kind of client server environment  The reader 1s reminded that client based    does not exclude to store programs and data on file server in a network environment     The geometry model    The mapping viewer of GGIG is based on very simple and straightforward concepts  First of  all  it basically supports solely polygon geometries  line strings  interpreted as rivers  and  points for labelling  The storage model is optimised to host rectangles  and is especially  efficient if the polygons vertexes are all points in a raster  The topology is not read from a  shapefile  but stored in a generic rather simple format  However  a shapefile interface to  generate the generic format is available  The vertices are stored in x y coordinates  already  projected in a rectangular coordinate system  and the viewe
67. les  which list information in which files and in which line symbols  are declared  defined  assigned and referenced  They also comprise information about  long texts and domain of the symbols  The    REF    file can be generated by the  argument rf filename when GAMS is called  e g   GAMS capmod a c  rf capmod ref      As the GAMS compiler itself is used  conditional includes and the  like are automatically treated as during execution time  That opens also the possibility    to include the generation of the documentation in the GUI     2  GDX files generated with an empty symbol list at compile time  SGDOUT  module gdx  SUNLOAD   GDOUT   The resulting GDX file will comprise all sets   parameters etc  used by the programs  and most importantly  the set elements as    declared  The name of the GDX file could be passed as a parameter by the GUI     Those files hence reflect the actual local code base with any local modification  and can be  generated for a specific instance of each GAMS project  e g  in case of CAPRI   s simulation  engine  CAPMOD  with and without the market module etc    A JAVA application named  Builddoc parses both types of files  on demand for several projects  and generates static  HTML pages  The GAMS code comprises in line comments carrying information about  references to the methodological documentation  and the HTML pages comprise calls to the  editor to open the actual source code at the local machine  as well as information about    relation betwee
68. lex tools  which combine different GAMS or R projects based on one GGIG implementation  Splitting  up a project into several tasks supports a structured development of the GAMS R code as  either separate GAMS R files with a clear purpose are generated or a GAMS R file consists of    blocks which belong to certain tasks     When the user selects a task  only the controls belonging to that task are shown to the user   easing the handling of the GUI  Tasks can be combined into worksteps to further structure the    work flow in a project     Mapping controls setting to GAMS    Controls are user operable  graphical elements  A few examples are shown below     Last year y        2015 20302045 2060 20752090 PIS TL c MEINE    GGIG  Wolfgang Britz  Version November 2015 13    GGIG Graphical Interface Generator     Programming Guide    UU     Lise hasHerds indicator variables Solver    Mamas       Diagram  Example of controls generated with GGIG    In the case of GGIG  these graphical controls are used by the user to define textual and  numerical settings which in turn define run specific settings for a GAMS R project  GGIG    offers five functionalities related to these controls and their interactions with a GAMS project   1  It generates the controls from a definition file on a windowed program interface   2  It offers the necessary code to intercept user operations on the controls     3  It maps the settings of the controls based on the user input to as sequence of GAMS or    R stat
69. lf time     12 88     Wage rate flexible hourly   18 88   Haize silage   36 66     Gras silage   24 00     Manure       Cattle concentrate type 1   226 66     Cattle concentrate type 2   246 66     Cattle concentrate type 3   268 88     Oils for feed  1588 88   Pigs concentrate type 1   556 66     Pigs concentrate type 2   300 00   Pigs concentrate type 3   666 66   Diesel  8 78   ASS  6 31   AHL  6 34   seed  1 88   KAS  6 31   PK_18_16   6 29   KaliHag  6 34   Line  59 88   Herb  1 88   Fung  1 66   Insect    1 00   grouthContr   1 88   water  2 58  Mi ns  9 34    GGIG  Wolfgang Britz  Version November 2015 40    GGIG Graphical Interface Generator     Programming Guide    Layout of the controls on the interface and style options for    controls  Overall  the layout of the GUI is structured by the following main elements   1  Tabs provide the uppermost layer  by showing different    pages    with controls     2  Separators allow putting a heading over a group of controls  Controls under a    separator share a common space and will be kept together as one block     3  Panels allow defining a group of controls which are not separated if the interface is    resized  1 e  a block of controls  A separator can span over several panels     Generally  controls are put along the y axis  top to bottom  into blocks  In order to provide an  x ordering  left to right   panels or separators can be used to define block of controls  If no    panel and or separator is given for a tab  all co
70. n scenario with market model Generate expost results  Run scenario without market model   Run scenario only with market model  Downscale scenario results   lt  tasks gt    lt tooltip gt Name of the scenario file to run  The results will be stored under the name as well  lt  tooltip gt    lt fcontrol gt     Output to GAMS     SSETGLOBAL scenDes cge rd nothg    GGIG  Wolfgang Britz  Version November 2015 29    GGIG Graphical Interface Generator     Programming Guide    fileselDir   dirselDir  Purpose    Used for 1 of n selections of a list of files respectively sub directories  potentially from  sub directories  That is e g  interesting when the user can chose from a list of pre   existing scenario definitions in GAMS files  or to define sub directories from which  data will be loaded    Applicable fields   Title  GamsName  Value  Options  Tasks  Style    Control optic     Dir     bd    Scenario file Files     IES  base _scenarios noShock      Note  Drop down lists will appear 1f the user clicks on arrow   Possible value     Defined by the file selection string in options field   e g     lgams  pol_input  cge_  gms  The file extension fill be automatically removed from    the items   User action   tick   untick one of the selection possibilities with mouse    Example definition      lt control gt    lt Type gt filesemian lt    Type    lt Title gt Scenario description lt  Title gt    lt Value gt mtr_RD lt  Ualue gt    lt Options gt 4modeldir4 pol_input   gms lt  Options gt    lt
71. n the different GAMS Symbols     GGIG  Wolfgang Britz  Version November 2015 77    GGIG Graphical Interface Generator     Programming Guide       Handling of GDX files    The    expand    option generates information about GDXIN and GDXOUT statements as those  are executed at compile time  Consequently  files addressed via GDXIN or GDXOUT are    automatically reported in the documentation system     Hovever  the file does not comprise information about the    execute_load    and     execute_unload    executed at run time  That is quite clear  as the statements may be  comprised in program structures as loops or if statements where there are never reached at  execution time  We need hence a work around to report those files in the documentation    system if we would avoid writing a new GAMS parser     However      IF EXIST    statements are taken into account by the expand command  It is  therefore proposed to put an     IF NOT EXIST  combined with an abort statement before all   execute load  statements  As seen in   SIF NOT EXIST   XdatXarmn AOp  gds  ABORT    dat arm allpop gdx is missing  execute load    Xdat XarmXallpop gdx  WorldPop   By doing so  the program will already at compile exit if one of the necessary files is missing     That avoids starting a process and eventually overwriting files which then will stop later due    to missing input data  The HTML page will report that sequence as     GGIG  Wolfgang Britz  Version November 2015 78    GGIG Graphical Interface 
72. name of the group  The items are and the next selection group are  then comma separated as shown below  Commas can be skipped if the next item is on a    different line     GGIG  Wolfgang Britz  Version November 2015 33    GGIG Graphical Interface Generator     Programming Guide     lt selGroups gt     EU15  BL888888  Belgium and Luxembourg    DK888888  Denmark    DE888888  Germany    EL888888    Greece     ES888888  Spain   FR888888  France   IR888888  Irland   IT888888  Italy   NL888888  The Netherlands   aT888888  Austria   PT888888  Portugal   SE888888    Sweden     FI888888  Finland   UK888888    United Kingdom     EU12  C2888888    Czech Republic   HU888888  Hungary   PL666666    Poland     SI888888  Slovenia   SK888888    Slovak Republic   EE888888  Estonia   LT888888  Lithuania   LU888888  Latvia   CY666666    Cyprus     HT888888    Malta     BG888888  Bulgaria   RO888888    Romania        Non EU    N0888888  Norway    TUR  Turkey   aL888888  Albania   HK888888   Hacedonia   CS888888  Serbia   H0888888    Montenegro   HR888888  Croatia     BA888888    Bosnia and Herzegovina     K0888888  Kosovo    lt  selGroups gt     Note     e The selection possible can also be loaded as a set from a GDX file      lt options gt  datdir Wtask   Input file    gdx   gdx setname r lt  options gt     e  he standard output from the control is a set definition in GAMS  other output    can be selected by      lt     The following style setting produces the  fst2 and _lst2 gams elements    g
73. ntrols will be shown in one block     Controls in a block stick together  the maximal height of a block on any page defines the  minimum height of all pages  If the width of a page becomes too small  the rightmost block s   of that page will move below of each all others  and the minimal height of all pages will  increase  Furthermore  as discussed next  controls can share one line  Accordingly  it is    recommended to build relatively small block of controls     Note  if several panels are present under a separator  they are always laid out on along the x     axis  Reducing the width of the page will not reorder blocks below a separator in several lines     Most of the controls allow for a style tag  Currently  only the following two options are    supported   1  Putting the control in the same line below the last one     lt control gt     lt Type gt checkbox lt  Type gt     lt Title gt Allow for off farm work lt  Title gt     lt   Value gt true lt   Value gt    XEEUTEB  saneLine truec style     lt gamsName gt allowForOffFarm lt  gamsName gt     lt tasks gt Single farm run  Calculate H  Cs  Experiments dairy Experiments arable lt  tasks gt    lt  control gt     Which leads to the following   Different states of nature for price Allow for off farm work      The sameLine style tag can be combined with hidden control titles     GGIG  Wolfgang Britz  Version November 2015 41    GGIG Graphical Interface Generator     Programming Guide     lt control gt    lt type gt spinner lt  t
74. o  jpg lt  attr gt  lt  logo gt      lt backgroundColor  gt  lt attro255 148 18 6   attr gt  lt  backgroundlolor gt     Equally  the icon shown in the task bar can be set     lt icon gt  lt attredairydyn gif lt  attr gt  lt  icon gt     Worksteps    Worksteps allow to group tasks  and thus represent the top level of structuring actions in a    tool  The following attributes are possible  Name Name of the workstep shown as selectable radio button  required   Tasks List of tasks    PDFLink Context sensitive link as via a PDF bookmark     lt WORRS tep gt    amp name  Build database lt  name gt    lt tasks gt Prepare national database   Finish national database   FSS selection routine   Build regional time series   Build regional database   Build global database   Build HSHU database   lt  tasks gt    lt  workstep gt     The work step selection is based on a set of radio buttons in a panel in the upper left corner of    the generated GUI  It is not necessary to define work steps in a project     GGIG  Wolfgang Britz  Version November 2015 16    GGIG Graphical Interface Generator     Programming Guide    Tasks    The control definition file must define a list of tasks  such as calibrating the model and    running the model  for the project     A task can have its own GAMS or R file to start  1ts own result directories and its own set of    controls  Each control can be shared by several tasks      lt task gt    lt name gt Run test shocks with CGEX lt fname gt    lt gamsFile gt reg
75. ols   to structure a pane with control  JLabel in an JPanel with a border   the next controls are shown together on a panel   to enter a free text  JTextField    for on off type of settings  JCheckBox    for 1 of n selections  JList in a JScrollPane    for 1 of n selections  Group in JButton  vertically aligned    for 1 of n selections of a list of files  JList in a JScrollPane     for 1 of n selections of a list of files found potentially in sub directories     preceded by a sub directory lists  two JList in a JScrollPane    for n of m selections  n 0  m    non editable JComboBox    for n of m selections  n 1   m    non editable JComboBox    for integer value selection from a range of values  JSlider    for floating or integer value selection from a range of values  JSpinner     to enter floating point variables in a two or three dimension parameter     comprises pivot possibilities  JTable     to enter floating point variables in a two or three dimension parameter     no pivot possibilities  JTable     GGIG  Wolfgang Britz  Version November 2015 24    GGIG Graphical Interface Generator     Programming Guide    Tab    Purpose    Used to structure the interface by grouping controls on an input pane  introduces a    new tabbed plane to which controls following are then added  Applicable fields     Title  Tasks    Control optic     General settings   Farm Settings   Market settings   Algorithm    Remark        The user can only see one of the tab pane at any time     care shoul
76. onding  K127QQ  K12900    Dry pulses   Responding  K136QQ  OtherTP    Other Crops   Responding  SE266     Costs     Constant 1  Land    Constant cap    C     control      Output to GAMS     SET elasticitysettings         K12600    Responding  K12200      Constant  E1230    Constant  K12400    Constant  K12600   Constant  K12700   Constant  E1290    Constant  K1360Q   Constant  K13100      Constant    therTP  Constant  SE  B6  Constant  SE 420  Constant    C  Changing  1  Constant  cap  Constant  lab  Changing    GGIG  Wolfgang Britz  Version November 2015     Rye  Responding K123QQ  Barley  Responding    Rice   Responding      Sugar beet  Responding    Family Net Income   Responding      Labour   Constant   lt  value gt      Potatoes   Responding  K131QQ   Livestock   Responding  SE426     Capital     Constant lab    36    GGIG Graphical Interface Generator     Programming Guide    Slider    Purpose    Used to select one integer value from a given range of allowed ones  The increments    must also be defined   Applicable fields   Title  GamsName  Value  Options  range  Tasks  Style    Control optic     y    12 324 556 7 8 9 10    Time resolution for investment off farm labour decisions    Note  Selectable values will be restricted according to the increment definition   Possible values    Defined by range field   User action    Select value by pressing up down arrows or by editing the field with keyboard  Example definition      lt control gt    lt Type gt  Biden  lt   Type g
77. one of the definitions stems  from the observation that most tables have only a very limited number of columns  and that  these are normally formatted with care regarding their text comprised  Each table therefore  requires a definition of items  but the items must not necessarily be mapped in the column    viewport    lt item gt    lt itemName gt Money metric lt  itemName gt    lt key gt CSSP lt  key gt    lt unit gt Mio Euro lt  unit gt      lt longtext gt Consumer welfare measurement  expenditures necessary to reach utility in    current simulation under prices of reference scenario lt  longtext gt      lt link gt Money metric lt  link gt     GGIG  Wolfgang Britz  Version November 2015 61    GGIG Graphical Interface Generator     Programming Guide     lt  item gt     An item definition is enclosed in the  lt item gt     lt  item gt  tags  It must at least comprise a  lt key gt   and an  lt itemName gt  tag  The case sensitive key must match the symbol identifier as found in    the GDX file  whereas the itemName can be freely chosen   Facultative tags are     lt unit gt   a physical unit shown in table    lt longtext gt   a text shown when the mouse hovers of the column   lt link gt   a link to another table for the table cells under the column      lt colormode gt   the color mode used when a map is drawn for the item  The following modes    are supported   e GYR Green Yellow Red  e RYG Red Yellow Green  e GR Green Red  e RG Red Green  e BG     Blue Green  e GB Green Blue 
78. pts such as the SEAMLESS IF are therefore probably only suitable for  larger projects focusing on combining components based on different programming  languages  Furthermore  SEAMLESS IF is based on a client server implementation and    requires specific software licences for deployment     GGIG might hence be seen as a quite simple and easy to use tool to generate GUIs for GAMS  projects  If all GGIG features are used  1t can however host quite complex projects  The new    GUI for CAPRI built with GGIG offers an example for a rather complex implementation     As mentioned above  a second important contribution of GGIG is to mechanize to the largest  extent the generation  storage and later inspection of meta data underlying a scenario and the    related result set  overcoming an often encountered weakness in  economic  models     And thirdly  GGIG offers a bridge between the powerful CAPRI exploitation tools and other  GAMS based models  It draws on the experiences with BenImpact  a Regionalized  Agricultural Sector Model for Benin  Britz and M Barek 2003   MIVAD  a hydro economic  model for a river basin in Morocco  Heidecke and Heckelei 2010  and the village CGEs  developed in Advanced Eval  Britz 2009   These GAMS based models respectively Java  based GUIs used already before GGIG the CAPRI exploitation tools to inspect model results   but did not add any GUI functionalities to also steer their models  The experiences with these  examples can hence be seen as the starting
79. qually optimised  to the specific needs  As only float values or strings are supported  all data can be stored as  one primitive array of either floats or strings  To allow fast and efficient indexing  a linear  index is constructed from the multi dimensional data cube  and the non zero data and their  indices are stored in a hash table  That renders data retrieval very fast  All data are loaded in    memory at initialisation time  For moderately long linear indices about 10 Bytes are required    GGIG  Wolfgang Britz  Version November 2015 57    GGIG Graphical Interface Generator     Programming Guide    to store a non zero float and its index as an integer  If the maximal linear index is very large   the index is stored as a long and the storage need goes up to about 16 Bytes  20 Million non     zero numbers can hence be hosted in about 200 Mbytes     The data are read from a generic file format generated by GAMS  General Algebraic  Modelling System  a commonly used software package in economic modelling  called GDX   the software package on which CAPRI is based  Access to GDX is handled via an API  provided by GAMS     Client based solution    Technically  the exploitation tool is completely client based  That reflects the specific user  profile of the CAPRI modelling system where the exploitation tool is integrated with an  economic model and tools building up its data base  The main aim of the tool is to support  forward looking policy analysis  For this purpose users wil
80. quires  about 340 Mbytes  the GGIG based version requires about 27Mbytes solely  Reading the  GGIG coordinate information is somewhat slower compared to ArcGIS due to unzip on  demand  The actual drawing operation takes about the same time as in ArcGIS  about 11    second for the full data set   Classification in GGIG 1s typically faster     Views as the basic concept    The concept of the GGIG and former CAPRI exploitation tools is centred on the idea of a  view  Content wise  each view may be understood as showing one or several indicators  relating to results of GGIG tasks  e g  in CAPRI  environmental effects of farming  prices or  market balances  Technically  it could be understood as a combination of a selection query   i e  filters in the different dimension of the data cube loaded by the exploitation tools  and  presentation details  e g  pivot  visualization as a map  table or graphic  fonts and colors      similar to a report definition ina DBMS   Each view thus   e extracts a certain collection of numerical values  e labels them so that they carry information to the user  long texts  units   e chooses a matching presentation     as a table  map or graphic  e and arranges them in a suitable way on screen     The views can be linked to each other  allowing a WEB like navigation through the data cube   Views can be grouped to themes  The user may open several views in parallel  and he may  change the views interactively according to his needs  e g  switch from a map 
81. r           p_rhectotbenand  reglant  denander      Vu   emand  cale reqions demander prodects curYear      The average demand price for each demander is the non linear weighted average of the products   using a dual price aggregator derived from the FOC of a CES demand system                 define aerrage denander price     e_semanderPrice curRegions  regions   denander years      curvear  years       v demandTot ccale regions demander  yoars       GAMS output       U_denanderPrice  regions demander  yoars   rn    wet premiats   p Chere  artt SOomand  regions denia der products    p sharefartl tbenand  reg Ines deninder   portes ls y     v prudfeies  regions products pears   Cool p servi ertt SOomtat es Leegi un  pewiluet s    uowtates       v denser ice regiues prudwcts  yeers     p   hareferti Doria les nmgiom  prudects    deontales                 p rioclotbenmandiregioms  denamter             1   1 p rbeclTutPenand regions demander          Note   1  The CES aggregation which is represents a demand system is not equal to a physical one   but rather depicts the utility level achieved by consumers   2  The product prices driving consumer    decisions is either the uniform market prices p prodPrice if the SPE version is used or the product  demand price p_demondPrice if the Armington approach is switched on  See below for details     Supply  stocks and flows  The model distinguishes three forest owner groups  as well and an aggregate over all owners for  regions not covere
82. r does not deal with the geographic  coordinate system  but simply scales the rectangular coordinates in the viewport  The viewer  in its current version solely supports one layer of quantities  Those restrictions naturally allow  reducing memory needs  and  thanks to the rather simple data structures  also rather allow    GGIG  Wolfgang Britz  Version November 2015 58    GGIG Graphical Interface Generator     Programming Guide    performing drawing operations  It should also be noted that the JIT compiler of JAVA is    indeed astonishingly fast given that that Java code is only precompiled     The biggest topology currently handled simultaneously covers an intersection of Corinne  Land Cover  slope classes and Soil Morphological Units and comprises around 2 7 Million  polygons for EU27  As the majority of the polygons are rectangles  not more then 6 7 Million  points needed to be stored  The topology handler and the drawing routines separate rectangles   for which only the two outer points are stored  from polygons  for which the vertices and    centroids are stored     The viewer is written in Java  Swing is used for the GUI in order to profit from the most  simple implementation  the viewer has been written completely new  and is not based on  existing GIS libraries  Even certain standard JAVA classes as e g  for hash tables  have been  replaced by own implementations  to reduce implementation overhead  Some care was given  to support flexibility in classification  given t
83. rdingly  GDX files shipped to other desks or  committed e g  toa SVN server still carry all necessary information to identify exactly the    run     Technical concept    The meta handling is straight forward  The state of the different control is mapped into pairs  of set elements and related long text descriptions as shown below from an example    application     SET META       Scenario description       my test scenario        Choose model type    CGE      Relative weight flows     30      Use demand elasticities       true        Set substitution elasticty   6 0    Countries     NL      FS    and  might with one GAMS statement as shown below  stored in the GDX files along with the    results     GGIG  Wolfgang Britz  Version November 2015 50    GGIG Graphical Interface Generator     Programming Guide    execute unload    Ascenario_descriptiond    gdx    META RESULT     The user might then select some scenario     ER TRIMAG  t  britz trimag   File Settings  TRIMAG taks Scenario exploitation    Start TRIMAG        O Scenario 1  my first scenario v    Scenario 2   Brides zar v    Scenario 3 v          Exploit scenarios          Scenario 4 v          Scenario 5 v       Show results  TRIMAG Graphical User Inter      Ini file   gig ini User name   undefined  User type   runner         And then  by pressing  show meta   view the settings used for these scenarios     GGIG  Wolfgang Britz  Version November 2015 5     GGIG Graphical Interface Generator     Programming Guide    ER TR
84. references to GAMS sources   individual GAMS files  or even GAMS objects  variables  equations  models   parameters   Those references can be addressed in the GAMS code  and the HTML    pages will allow opening the PDF document at the referenced point     As with JAVADOC  technical documentation should be edited as in line comments  into the GAMS sources  based on clear in line documentation standards  Each GAMS    source as a file header with standard properties about the file     In line documentation will be mostly based on two levels  the level of individual  GAMS files and on the level of individual GAMS objects  In some cases  that may  require to break down larger programs in smaller pieces  with a clear task and    eventually clear inputs and outputs     Overview    The following diagram depicts the general approach  The SVN server will host the GAMS    sources  the documentation builder  Builddoc  as a Java application and the PDF with the    methodological documentation  Users synchronize their local work copies with the server  In    order to avoid developing in Java a new parser for GAMS code  the GAMS compiler itself 1s    GGIG  Wolfgang Britz  Version November 2015 76    GGIG Graphical Interface Generator     Programming Guide    used to generate the necessary input for the technical documentation  Two different types of  files for each    project    or    instance    included in the documentation are used for that purpose    so far     1  So called    REF    fi
85. results            GAMS Graphical User Interface Generator  Wolfgang Britz    L R 2012  University Bonn   Institute for    Food and  Resource Economics           CgeRegEU    Ini file   regcge ini  User name   undefined   User type   runner    As shown in the example above  the GUI consists a few elements     1  A menu bar which allows to change some settings  see the section on general    interface settings     GGIG  Wolfgang Britz  Version November 2015 12    GGIG Graphical Interface Generator     Programming Guide    2  A workstep and task selection panel on the left hand side where the user can select    between different tasks belonging to the project   3  A right hand side panel which either shows     i  The generated controls  a button panel to start GAMS and a windows    in which the message log from GAMS is shown  11  A panel to select data to view and to start their exploitation  111  The exploitation tools  4  A small window in the left lower corner which present a logo     Whereas the elements 1  and 3 11 and 3111  are not project specific  the worksteps and tasks  available in 2  and the controls shown to the user in 3 1  are generated in a project specific    initialisation file  The details of that file     which is core of GGIG     are discussed below   The interface generator    Tasks    Tasks are central elements in GGIG  Each control can belong to one or several tasks  and each  task might have its own GAMS or R process  That allows steering even rather comp
86. rface Generator     Programming Guide    second important part is the CAPRI exploitation tool  which are basically generic enough to  be used for other modeling systems as well  The 2008 refactoring left most of the code  untouched compared to the code developed since 2006  with the exemption of the graphics  which is now based on the JFreeChart library  However  as discussed below  in 2007  the  mapping viewer was refactored in larger part to host the 1x1 km grid solution developed in  the CAPRI Dynaspat project  The exploitation tool is a rather unique solution to exploit result  sets from economic models based on the definitions of views which are defined in XML  tables  It combines features from DBMS reporting  data mining  spreadsheet functionalities  and GIS into one package  And thirdly  there are some specialized pieces as the HTML based  GAMS documentation generator which are linked into the GUI     In 2010  a possible project by a Swiss team to add an interface to a GAMS project triggered  the development of GGIG  A further motivation was the fact that any new GUI control  needed on the CAPRI interface required changes in the Java code  That was not only tiring  it  also let the Java grow and made it harder to maintain  There were also increasingly features  added to the CAPRI GAMS code which could not steered by the CAPRI GUI  but were  switched on off or otherwise modified by changes in the GAMS code  It was clear that this  development was not sustainable  GGIG w
87. s and GAMS result codes in a HTML page from    which they may queried at a later time     GGIG  Wolfgang Britz  Version November 2015 73    GGIG Graphical Interface Generator     Programming Guide    e Ensures that each new run generates its own listing file  which can be opened from the    HTML page     e Allows storing the output of the different runs in a separate directory  while reading    input from unchanged result directories     The purpose of the batch execution facility is therefore at least twofold  On the one hand  it  allows setting up test suits for the GAMS code of a project such as checking for compilation  without errors for all tasks and different settings such as with and without market parts etc   Secondly  production runs of e g  different scenarios can be started automatically  Timer  facilities allow starting the batch execution at a pre scheduled time  Along with functionalities  to compare in a more or less automated way differences 1n results between versions  the batch    facility is one important step towards quality control     Each generated include file comprises a block of lines  commented out  which can be copied  into a text file and used with the batch file facility  For details on the use of the batch    execution utility  refer to the user guide     Generate GAMS documentation    The GUI comprises a tool to generate for each GAMS file and each symbol used HTML  pages which are interlinked  For details on the code documentation facility se
88. s shown in a separate window  The  user can close the window  1t opens with the next use of Fl  The user can flip through the  pages with page up down buttons  The PDF decoder used internally is the non commerical    version which shows graphics not in full resolution     GGIG  Wolfgang Britz  Version November 2015 44    GGIG Graphical Interface Generator     Programming Guide    nn s    i  PDF  ModelDocumentation pdf                  les GUI Settings             General settings   Scenario settings demand   Scenario    Detailed model documentation MEM    Bild raw data base  General settings    Terence run  The total demand for each demander encompasses the demand for the individual products  in 3 E EUER   Scenario name  conifer sup m5  differing shares   the related demand shares are driven by a CES  Constant Elasticity of Substitution  er     function       define denaed hy praduct for cack demander       e Genand cerficgieas regiens    demander products  curfear     v demand  scale regioas demander products  curYear         denandireyioss  demomber   preducts curvear    f demand scatet ums   erue   pretects  curveer   se  v demandTot  regians  denander  cur  ear     p sharePartESPenand  reqisas   demander products  cur ear       v denanderPrice reqions demander  curYear    AE v prmiPrice regisms products  cervear    mel p Shere antt uad ns  regions gendi s uma s emma d     ow domande Lon reginas gemi ds curve      i sharePartf SbonSalps  regions products   dostales  cwn Va
89. st of further tags which refer e g  to definitions of graphs  They are here    only listed in here with their default settings without a detailed explanation     GGIG  Wolfgang Britz  Version November 2015    66    GGIG Graphical Interface Generator     Programming Guide     FontsizeRelative     o60       zerosAsMissingValues   false     blueishtolors   false     showMarkers    false       m m     domainGridLinesVisible   true     rangeGridLlinesVisible   true     showAxisTitles   true     ShowlastColumn   true     commonRange   false     autoRangeIncludesZero   true     nBins   e      quantile   5g       spiderChartMaxAxis   6     spiderChartMaxObs   5     SpiderChartFilled   true     SpiderChartForegroundTransparency   180       pieChartMaxPlots   10     pieChartMaxPies   25     piechartLabelMinimum   5     PieChart3D   true       PieChartSimpleLabels    false     PieChartCircular   false     PieChartForegroundTransparency   28         The maximum number of bar plot with their own value range axis      barchartMaxPlots   4        The maximum number of bar groups    elements on the domain axis  taken from the table rows       barChartMaxDomains   18        The maximum number of bars in a bar group  taken from the table column groups       barchartmaxseries     5        barChart3D   true      barChartStacked    false      barchartVertical   true      BarchartCylinder   false      BarChartForegroundTransparency   18      barChartDrawOutline   false      barcChartDrawShadow   f
90. t    lt Title gt Time resolution for investment off farm labour decisions lt  Title gt      amp Ualue  3 84 Ualue    lt   range gt 1 148 1 lt  range gt    lt gamsHame gt timeResolutionInu lt  gamsHame gt    lt   tasks gt a11 lt  tasks gt    lt  control gt     Output to GAMS      SETGLOBAL Set_substitution_elasticty 5    GGIG  Wolfgang Britz  Version November 2015 37    GGIG Graphical Interface Generator     Programming Guide    Spinner  Purpose    Used to select a integer value from a range of allowed ones  The increment is always  unity  Could be internally used as a floating value  e g  by using it for shares in    percentages terms     If the range of the spinner is large  it might be hard for the user to pick a specific value  In that    case  a spinner is easier to control   Applicable fields   Title  GamsName  Value  Options  range  Tasks  Style    Control optic   Use lower price iterations weights after iteration   20 0        Possible value    Defined by range field   User action    Select value by moving slider    Example definition      lt control gt     lt order gt 1611 lt  order gt    lt Type gt Spannen lt  Type    lt Title gt min end year of planning horizon lt  Title gt   zUalue  2828   Ualue   irange  2H15 2188 1 15   range    lt gamsName gt last  earhin lt  gamsName gt    lt tasks gt Experiments lt  tasks gt     lt  fcontrol gt     Output to GAMS     SSETGLOBAL Relative weight flows 20    GGIG  Wolfgang Britz  Version November 2015 38    GGIG Graphical Interfa
91. t    lt sty le gt output  BER    set globals lt  style gt     GGIG  Wolfgang Britz  Version November 2015 34    GGIG Graphical Interface Generator     Programming Guide    Radiobuttons   Purpose   Used to select for several items a one of n settings  outputted as two dimensional set  Applicable fields    Title  GamsName  Value  Options  Rows  Tasks  Style    Control optic     O3 O e    w     w  is  P     P    DE                L3                Possible values    Defined by range field   User action    Select value by pressing up down arrows or by editing the field with keyboard    Example definition     GGIG  Wolfgang Britz  Version November 2015 35    GGIG Graphical Interface Generator     Programming Guide     lt control gt       Type   ESilButtons   Tuype     lt Title gt Elasticity settings lt  Title gt      lt options gt Responding  Changing  Constant lt  options gt      lt rows gt   K126QQ    Wheat   K122QQ  Rye   K123QQ  Barley   K1250Q    Oat     K12600    Grain maize   K127QQ  Rice   K129QQ    Dry pulses   K13000  Potatoes   K13100  Sugar beet   OtherTP    Other Crops   SE206  Livestock   SE426    Family Net Income       C  Dosts     1  Land    cap  Capital    lab  Labour    lt  rows gt    lt tasks gt DEA lt  tasks gt      lt columns gt Responding  Changing lt  columns gt      lt range gt 6 1 1 lt  range gt      lt gamsName gt elasticitySettings lt  gamsName gt      lt value gt K126QQ    Wheat  Responding  K122QQ  K12400  0at   Responding K12600    Grain maize   Resp
92. to a tabular    presentation  or change the pivot of the table  sort the rows etc     Internally  each view is stored in an XML schema  The XML schema allows to attach long  texts  units and tooltips to the items of a table  and thus to show meta data information to the  user  The XML schema hence replaces look up tables ina DBMS  It may equally store    information regarding the pivoting  the view type  table  map  different graphic types   and for    GGIG  Wolfgang Britz  Version November 2015 56    GGIG Graphical Interface Generator     Programming Guide    maps  classification  color ramp and number of classes  The views can be grouped into logical    entities  and are shown as a popup menu to the user     Tabular views may feature column and row groups  Empty columns and rows can be hidden   tables can be sorted by column  with multiple sort columns supported  Numerical filter can be    applied to columns           User            View  definitions    GUI   Selection pivot       supplied  filters           Data model    The underlying data model is very simple and straightforward  All data are kept in one large  multi dimensional data cube  and all values must either be float values or strings  Each data  dimension is linked to a vector of string keys  Those keys are the base for the filter  definitions  Currently  data cubes with up to 10 dimensions are used  regions     activities      items     years     policy scenarios     dim5     dim9   The data storage model is e
93. ual aliada 50      IOTEAETOTE ica 22  Excurse history ot GOIG CAPREGUIS una a O 52  Execution of tasks via a GamsStarter and GamsThread      occccnnnccnnnnnnnnnnnninononccnnnnnnnnnnnnnnnnnos 54  Retactorins the TriappInp Patti  55  Miexscas the  Dasic CONGEDI aa iei aio ido NM AE 56  Data model ocio meet es ur lo eo ae 57  EME DA aaa ea a E 58  Toes One ANNO Os M CST m 58  XM Ede nnion TO V 16 WS ios 60  W hy a XMI  definition Hles DOE VIEWS aora 60    GGIG  Wolfgang Britz  Version November 2015 4    GGIG Graphical Interface Generator     Programming Guide    The structure of the XML definition files for the views         ooccccccccnnncncnoncnnnnnnnnnnonnncnononannnos 60  General COMM CIN Sas sb Acepto etna a a a oem ac n plutot ere sutates en eec iubens 60  Necessary tags TOR Table  ads 61  Peng the 1tems orte table usais iii E 6l  Additional tags    sub  NEMES id A AS 63  Additional 1a8s   lt de pivot eal ides 63  Additional Tass    debyle Woods repete oo added dano tetera la eel iado 64  Additonal tas  ECO  gt  AA ne a 64  zAlternative fexts For the ACIIMEMS IONS so doe A E E 65  Additional des clone a cd AE 66  Additional fades    dTYOD A lie 66  PURGE LOGS RENT 66  Filters for the elements in the different dimensions    ooooononnnnnnnnncnnnnnnnnnnnnnnonononinonnccnnnnnnnnss 68  Attaching long texts and filters to elements           ccccccoooononnncnnnnnnnnonnnnncnnnnnnnnnonononinonannnnnnos 69  lei v                                              69   The structure of the 
94. ype gt    lt title gt Substitution  domestic imports  min max stddev lt  title gt    lt value gt 8 5 lt  ualue gt    lt range gt 8 1 1 8 1 lt  range gt    lt gamsHame gt esubdhHin lt  gamsHame gt    lt tasks gt Sensitivity analysis lt  tasks gt      lt fcontrol gt    lt control gt    lt type gt spinner lt  type gt    lt title gt  Armington  domestic against imports  maxt title gt      lt Yalue gt 1 5 lt  uvalue gt    lt range gt 1 6 16 6 1 lt  range gt    lt gamsName gt esubdMax lt   gamsName gt    lt tasks gt Sensitivity analysis lt  tasks gt    lt style gt sameline true lt  style gt    lt fcontrol gt    lt control gt    lt type gt spinner lt  type gt    lt title gt  hide Armington  domestic against imports  stddev lt  title gt    amp ualue  1 Hz ualue    amp range B 5 18 B   5z range    amp gansHame  esubdsStdDeus gamsHame    lt tasks gt Sensitivity analysis lt  tasks gt    lt style gt sameline true lt  style gt    lt fcontrol gt     The resulting layout is shown below  Beware  do not use empty title fields  as the title 1s used    internally to store the user settings in the ini file     a    Substitution  domesticfimports  min max stddev   1 0     LO 0 25     2  Left alignment     lt control gt    lt Type gt singlelist lt  Type gt    lt Title gt Base year lt  Title gt     zUalue  2B854  Ualue    lt Options gt 24804 24806 2808 lt  0ptions gt    lt gamsName gt BaseYear lt  gamsName gt    lt style gt uAlignment  left lt  style gt    lt tasks gt Define fts from FSS    lt  tas
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
Sony VAIO SVE14116FXP notebook  User Manual - VPR SRI Field Communications Services  手本: C7780-10_J_v.1.3    9 Opzione tecnologica F01  Using The Grill  552  Benutzerhandbuch Pasha  EC type-examination certificate UK/0126/0157 Revision 1  Fluke 807-0115 User's Manual    Copyright © All rights reserved. 
   Failed to retrieve file