Home
GGIG Graphical Interface Generator
Contents
1. GAMS project code Diagram Overview on information flow in GGIG Wolfgang Britz Version May 2013 9 GGIG Graphical Interface Generator Documentation Current applications of GGIG Since the first prototype GGIG has been successfully implemented in a number of projects e DairyDyn an fully dynamic s ngle farm model focusing on the impact of Green House Gas emission indicators on allocation and investment decision e A small spatial multi commodity model for world trade of cooked and uncooked poultry meat with a focus on trade bans related to Avian Influenca e A EU wide layer of regional CGEs with a focus on Rural Development measures on the second pillar of the CAP e LANA HERBAMO A Hydro Economic model for the lake Naivasha in Kenya These projects has helped to clarify some requirement and triggered the implementation of new and expanded features Since 2013 CAPRI uses GGIG Further applications are already underway e g in the context of the FADNTOOL project An overview on the GUI CgeRegEU t britz capri gams l ex File Settings Utilities CgeRegEU tasks General settings Methodological switches Calibrate CGE CgeRegEU General settings Run policy experiment Run test shocks Scenario description cge_rd_plus10 Use seperate threads V i Countries E GAMS Start GAMS Stop GAMS I Exploit results GAMS Graphical User Interface Generator Wolfgang Bri
2. 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 iftheni endif 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 A typical problem with more complex economic simulation models defined in GAMS s 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 the include file s with specific settings and that the names of these files are passed via the include file to GAMS Wolfgang Britz Version May 2013 43
3. lt Type gt multilist lt Type gt lt Title gt Longrun Option lt Title gt lt Options gt FAO2Z 656 Fao projections GLOBIOH EU Projections with GLOBIO EU model GLOBIOM GL Projections with global GLOBIOM model lt Options gt lt Value gt FA028568 Fao projections lt Ualue gt amp range 3 amp range lt gamsName gt longrunscen lt gamsName gt lt tasks gt Build global database lt tasks gt lt control gt Wolfgang Britz Version May 2013 27 GGIG Graphical Interface Generator Documentation Output to GAMS SET Countries DE FR 7 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 000000 Czech Republic HU OD00000 Hungary PLOOO000 Poland 51000000 Slovenia 256000000 Slovak Republic E EE000000 Eston LTOO0000 Lithuz Clear Selection LYOOOOOO Latvia Select All 00000 Cypr MTOOOOOO Malt EU15 Select Add to selection Non EU Remove from selection Selection groups can be added which allow for groups of tems to select them or add respectively remove from the selection Each selection group starts with a forward slash following by the 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 Wolfgang Britz Version May 2013 GGIG Graphic
4. 85 200 11 2525 70 22 00 7 14 red4 23 44 2980 59 451 59 201 50 2528 99 22 00 1 15 reds 22 67 2985 35 453 17 202 68 2532 18 22 00 7 16 red amp 22 01 2986 51 453 38 202 64 2533 13 22 00 7 16 red 21 35 2987 75 453 57 202 55 2534 17 22 00 1 15 redg 20 70 2989 09 453 73 202 35 2535 36 22 00 1 15 20 04 2990 52 453 89 202 15 2536 62 22 00 1 15 redil 19 33 2992 08 454 18 202 11 2537 90 22 00 1 15 Fedi 25 71 2980 48 451 46 201 29 2529 02 22 00 7 14 ed EH 25 41 2940 22 431 50 190 10 2502 72 22 00 7 05 red 24 75 2938 59 437 07 189 89 s 2501 52 22 00 7 05 zx 24 10 2937 43 436 64 189 51 2500 79 22 00 red4 23 43 2938 74 431 02 189 74 2501 71 22 00 7 05 red5 22 80 2937 10 436 33 189 04 2500 77 22 00 7 04 22 13 2939 59 437 03 189 44 2502 56 22 00 144 g The functionality is only available if a table definition file see http www capri model org docs Gui2010 pdf section on Editing the table definitions underlying the exploitation tools matching the structure of the parameters in the GDX file is provided Menu bar GGIG allows to add two types of menu items to the menu bar HTML links and e mail sent Wolfgang Britz Version May 2013 41 GGIG Graphical Interface Generator Documentation 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
5. GH Intel core 2 Wolfgang Britz Version May 2013 36 GGIG Graphical Interface Generator Documentation SVN related settings Option SYN user id SVN password SYN URL for Gams SYN URL f r 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 Settings linked to the exploitation tools Option Path to view definition file tables xml _ Sort code lists in predefined tables Path to Editor Sort code lists if showing all elements Language to load from tables xml English Wolfgang Britz Version May 2013 37 GGIG Graphical Interface Generator Documentation 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 15 due to the fact that run specific settings are not stored at all or not stored together stored 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 passes
6. Interface Generator Documentation Fields for each definition line The necessary information to control 15 stored in a line of the control definition file The following fields are available Type Title GamsName Value Options Range Tasks Tooltip Pdflink Selgroups Disable defines type of control required The different types are discussed below in detail defines description of control as seen by user required defines names of global settings resp SET name optional pre selected setting optional list of available options required where applicable Min max increment major ticks or number of rows shown required where applicable List of tasks to which the control belongs If empty t belongs to all tasks A tooltip text hovering over the control Link to a pdf file and chapter to open on mouse over Selection list opened by pop up menu see Multilist control Control is blocked for input useful to show settings on interface which are should be sent to GAMS for a specific task Wolfgang Britz Version May 2013 19 GGIG Graphical Interface Generator Documentation 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 Multilist MultilistNonZero Slider Spinner Table Introduces a new tab on the tabbed plane hosting the controls to structu
7. Rows Dim3s Range Tasks Control optic v Marginal budget share Substitution elasticity Defaults 0 05 5 0 i OPP Other primary sectors HOT Hotel and restaurants 8440000 EDU Education User action e Edit single fields with numerical values Cut Paste via clipboard possible e Edit default values for all visible rows in the row Defaults and press Apply defaults button The defaults for each columns will be copied over e Use the filter with and to select specific rows Wolfgang Britz Version May 2013 32 GGIG Graphical Interface Generator Documentation Example definition scontrol gt lt xorder gt 3118 lt X order gt lt Type gt table lt Type gt lt Title gt Trade elasticities lt Title gt xUalue gt 8 5 8 5 8 5 8 5 8 5 08 5 8 5 8 5 8 5 0 5 08 5 8 5 H8 5 0 5 8 5 08 5 8 5 0 5 8 5 0 5 8 5 0 5 8 5 H 5 lt Ualue gt lt Columns gt Import supply Export demand lt Columns gt lt Rows gt AGR Agriculture FOR Forestry OPP Other primary sectors FOP Food Processing Manufacturing EHE Energy CHS Construction TTR Trade and Transport HOT Hotel and restaurants EDU Education OSE Other services lt Rows gt lt range gt 6 1 5 6 8 1 5 6 68 1 8 1 lt range gt lt gamsNamerp tradeElas amp gamsHame lt tasks gt Calibrate CGE lt tasks gt lt control gt Notes e The range field might comprise several tup
8. all interface settings plus the user name and the current time forward 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 Accordingly 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 330 Use demand elasticities true Set substitution elastictu 6 0 Countries NL and might with statement as shown below stored in the GDX files along with the results Wolfgang Britz Version May 2013 38 GGIG Graphical Interface Generator Documentation execute unload Zscenario descriptionZ gdx META RESULT The user might then select some scenario TRIMAG t britz trimag File Settings TRIMAG taks Scenario exploitation Start TRIMAG Scenario 1 my first sc
9. maintenance 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 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 design coding debugging and maintaining 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 These project specific GUIs are typically very powerful but tend also to be tool specific They can typically not be modified easily to fit to another GAMS project 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 a tool is the GAMS Simulation Environment GSE by Wietse Dol GSE is
10. of controls end with consecutive numbers such A110 A111 A112 the controls are put in the same line The following definition statements C166 Type tab Title General settings C165 Type text Title Scenario description Value 36Cows C116 Type slider Title Last year Value 2626 range 2615 2166 1 15 gamsName LastYear C126 Type spinner Title Time resolution for investment off farm labour decisions Value 2 6 range 1 16 1 gamsName timeResolution C136 Type spinner Title Max yearly growth rate of cow herd Value 4 range 6 6 16 6 5 gamsName maxGrowthRateCowHerd C146 Type checkBox Title Allow for reduction of max milk yield Value true gamsName mlkRed C266 Type tab Title Farm Settings C216 Type separator Title Animals and crops C226 Type spinner Title Number of cows Value 36 6 range 6 126 5 gamsName nCows C221 Type spinner Title Milk yield in 188 kg Cow Value 78 8 range 48 188 1 gamsName milkYield C223 Type spinner Title Cereals yield t ha Value 8 range 4 16 1 gamsName cereYield C224 Type spinner Title Oilseeds yield t ha Value 3 range 2 4 6 2 gamsName oilsYield C225 Type spinner Title Yield of other cash crops t ha Value 46 range 36 46 2 gamsName restYield C23 6 Type separator Title Assets C246 Type spinner Title Construction year of stables Value 1996 6 range 1986 2616 5 gamsName stableYear C241 Type spinner Title Stocking densities Value 6 75 r
11. 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 1s certainly not a competitor to GSE GSE offers more functionality and is more IDE oriented It might however be easier to embed some simple steering settings with GGIG into an existing project Wolfgang Britz Version May 2013 6 GGIG Graphical Interface Generator Documentation 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 An example of a completely different approach to a GUI for modelling tools offers SEAMLESS IF with its focus on component linkage Based on OpenMI it however requires the development of an OpenMi compatible wrapper around the GAMS project itself Concepts such as the SEAMLESS IF are therefore probably only suitable for larger projects focusing on combining components based on different programming languages SEAMLESS IF is further on 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 t 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 c
12. the values entered by the user and will be in the ini format A typical call will therefore look like Gig jar project ini project default ini or Gig jar project ini project default xml Wolfgang Britz Version May 2013 12 GGIG Graphical Interface Generator Documentation It is hence possible to host several GGIG based installations in one directory where the jars etc are stored Worksteps Worksteps allow to group tasks The following attr butes are possible Name Name of the workstep shown as selectable rad o button required Tasks List of tasks lt BBERStep gt lt name gt Build database lt tasks gt Prepare national database Finish national database FSS selection routine Build regional time series Build regional database Build global database Build database lt tasks gt lt workstep gt Tasks The control definition file defines a list of task such as calibrating the model and running the model A task can have its own file to start its 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 CGE lt name gt amp gamsFile regcge gms amp gamsFile amp incFile regcge settings lt incFile gt lt regionDim gt 803 lt DimSDim gt 1 lt X DimSDim gt lt activitybim gt lt activityDim gt lt productDim gt 3 lt productDim gt lt scenDim gt 4 lt scenDim
13. with a 04 are in the drop down box for the scenarios Similarly only results for the simulation year 20 are selected BL Belgium and Luxembourg DK Denmark DE Germany EL Greece __ ES Spain Country selection FR NEC IR Irland IT Italy 4 NL The Netherlands Scenario 1 AT Austria 2 PIO yl ame B lection 08 Sc i03 RES 0 0420MTR RD as year seiecuon enario RES 0420TEST RES 0 0420TSTCAL p Scenario 4 a RES 2 0420COMBINED WTO BILATERAL 121 Scenario 5 RES 2 0420DDA 22 RES 2 0420DE MTR RD 23 x 24 Simulation year selection los 26 27 Wolfgang Britz Version May 2013 15 GGIG Graphical Interface Generator Documentation 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 Wolfgang Britz Version May 2013 16 GGIG Graphical Interface Generator Documentation Order of the controls and layout The controls will be placed in alphabetical sorted order of their keys on the interface Normally each control copies one line If the keys for a range
14. GAMS files with a clear purpose are generated or a GAMS 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 Mapping controls setting to GAMS Controls are user operable graphical elements A few examples are shown below Last year J 2015 20302045 2060 20752090 MS pas en Wolfgang Britz Version May 2013 10 GGIG Graphical Interface Generator Documentation Use hasHerds indicator variables Solver Diagram Example of controls generated with GGIG In the case of GGIG the controls are used by the user to define textual and numerical settings which in turn define run specific settings fora GAMS project GGIG offers five functionalities related to these controls and their interactions with 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 statements which can be included into a GAMS project to generate a specific run 4 It allows execution of 5 It offers a GDX 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 p
15. GGIG Graphical Interface Generator Wolfgang Britz August 2010 Version May 2013 GGIG Graphical Interface Generator Documentation The following report is 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 content of the CAPRI modelling system which receive 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 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 Wolfgang Britz Version May 2013 GGIG Graphical Interface Generator Documentation Content GGIG Graphical Interface Generator COnN erkenne en ar rare Current applications Of GGIG ican cnt u ales An overview the 2 2 22 2 000000000 Mapping controls setting to 8 Basic concept of the control definition file Use of filters Tor explottations 1 aaa ne Order of the controls and ayolt aen a heheh ieee Fields for each definition lime cccccecoscecsececcecsceccsceccscecsecs I ae ne ae ende M
16. Title gt lt Value gt MTR_RD lt VUalue gt lt Options gt gams pol_input gms lt Options gt BX range gt lt gqamsHNHame gt result_type lt gamsName gt amp tasks Baseline calibration market model Baseline calibration supply models HSHU baseline Run scenario with market model Generate expost results Run scenario without market model Run scenario only with market model Downscale scenario results lt tasks gt xtooltip gt Name of the scenario file to run The results will be stored under the name as well lt tooltip gt lt control gt Output to GAMS SETGLOBAL scenDes cge rd nothg Wolfgang Britz Version May 2013 26 GGIG Graphical Interface Generator Documentation Multilist MultiListNonZero Purpose Used for m of n selections i e in cases where features are not mutually exclusive Multilist allows m 0 1 also empty selection MultiListNonZero requires m gt 0 1 at least one element must be selected Applicable fields Title GamsName Value Options range Tasks Control optic Countries gs Countries 88217 NL 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 Possible value Defined by options field User action tick untick box fields in the control with mouse Example definition lt control gt forder gt 1426 lt order gt
17. al Interface Generator Documentation lt selGroups gt EU15 BL888888 DK888888 DE 888888 EL888888 ES888888 FR888888 IR666666 IT888888 NL 666666 AT 666666 PT 666666 SE666666 FI 666666 UK 888888 EU12 C2666666 HU 666666 PL888888 1666666 SK666666 666666 LT 666666 LU666666 CY 666666 HT 666666 BG 666666 RO666666 Non EU NO 888888 TUR AL 666666 HK 666666 CS 666666 MO 666666 HR888888 BA888888 K0888888 lt selGroups gt Belgium and Luxembourg Denmark Germany Greece Spain France Irland Italy The Netherlands Austria Portugal Sweden Finland United Kingdom Czech Republic Hungary Poland Slovenia Slovak Republic Estonia Lithuania Latvia Cyprus Malta Bulgaria Romania Norway Turkey Albania Macedonia Serbia Montenegro Croatia Bosnia and Herzegovina Kosovo Wolfgang Britz Version May 2013 29 GGIG Graphical Interface Generator Documentation Slider Purpose Used to selected one integer value from a given range of allowed ones The increments must also be defined Applicable fields Title GamsName Value Options range Tasks Control optic Set substitution elasticty Note Selectable values will be restricted according to the increment definition Possible value Defined by range field User action Select value by pressing up down arrows or by editing th
18. ange 8 5 2 6 6 1 gamsName stockingDens C242 Type spinner Title Aks Value 1 5 range 8 5 3 8 8 5 gamsName Aks will hence show on the interface as seen in the screen shots below All controls following a tab control will be put on that tab until the next one General settings Farm Settings Prices MACs Algorithm DAIRYDYN General settings Scenario description 30Cows Last year 2015 2030 2045 2060 2075 2090 Time resolution For investment off Farm labour decisions yearly growth rate of cow herd 95 Allow For reduction of max milk yield General settings Farm Settings Prices MACs Algorithm DAIRYDYN Farm Settings R Number of cows 30 Milk yield in 100 kg Cow Cereals yield t ha Oilseeds yield t ha Yield of other cash crops t ha Construction year of stables Stocking densities 15 With the XML based definition the order field is used Wolfgang Britz Version May 2013 17 GGIG Graphical Interface Generator Documentation lt control gt lt order gt 1126 lt order gt lt Type gt singlelist Type gt lt Title gt Base year lt Title gt Values Ualue gt lt Options gt 2 005 2 006 26688 lt Options gt lt gamsName gt BaseYear lt gamsName gt lt tasks gt Prepare national database Build regional time series lt control gt Wolfgang Britz Version May 2013 18 GGIG Graphical
19. cable fields Title Value Tasks Control optic Settings for objective function Example definition lt control gt lt order gt 2618 lt order 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 Wolfgang Britz Version May 2013 22 GGIG Graphical Interface Generator Documentation Text Purpose To enter text Typically used to parse the name of the scenario to GAMS Applicable fields Title Value Tasks Control optic Scenario description my first scenario Possible value Any text allowed User action Edit with keyboard Example definition lt control gt xorder gt 1458X order gt Type gt lt Title gt Alternative GAMS license File for GHG emission estimation lt Title gt lt Ualue gt gamslice cplex lt Value gt lt Options gt lt Options gt lt range gt lt range gt lt gamsName gt altLicense lt gamsName gt lt tasks gt Baseline calibration market model Run scenario with market model Generate expost results lt tasks gt lt control gt Output to GAMS SETGLOBAL Scenario description my first scenario Wolfgang Britz Version May 2013 23 GGIG Graphical Interface Generator Documentation Checkbox Purpose Used for on
20. e field with keyboard Example definition Type spinner title Set substitution elasticity range 0 10 0 5 value 5 Output to GAMS SETGLOBAL Set_substitution_elasticty 5 Wolfgang Britz Version May 2013 30 GGIG Graphical Interface Generator Documentation Spinner Purpose Used to selected 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 Control optic Relative weight flows J 0 29 Su 100 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 gt 188 lt gt lt Title gt min end year of planning horizon lt Title gt lt Value gt 62 0 lt Value gt lt range gt 2615 2166 1 15 lt range gt lt gamsName gt last earhin gamsName gt lt tasks gt Experiments lt tasks gt lt control gt Output to GAMS SSETGLOBAL Relative weight flows 20 Wolfgang Britz Version May 2013 31 GGIG Graphical Interface Generator Documentation Table Purpose Define a table with floating point values passed to GAMS Applicable fields Title GamsName Value Columns
21. e 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 project while passing the state of the control to 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 into the CAPRI 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 code or a batch execution utility GGIG is steered with 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 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 the GAMS call Experienced model users typically the code develo
22. emand 8 8 Energy Expoart demand Food Processing Construction Export demand 8 8 Trade and Transport Export demand 8 8 Hotel and restaurants Export demand 8 8 Education Export demand 8 8 Other seruices Export demand 8 8 Rgriculture Export demand 6 6 Furestry Export demand 8 8 Other primary sectors Export demand 8 8 Fond Pra cessing Export demand Hanufacturing Export demand 8 0 Energy Export demand 0 0 Lonstruction Export demand 8 8 Trade and Transport Export demand 0 0 Export demand Export demand 8 6 Export demand Hotel and restaurants Education Other services Output to GAMS test test1 F R Lest1 UPP test1 F P Ltest1 HAH Ltest1 EHE Lest1 CHS testi Ltest1 HOT test1 EDU Ltest1 UsE Lest2 Lest2 F R Lest2 UPP test FOP test Lest2 EHE Lest2 Ltest2 test HOT Lest2 EDU test UsE Ltest1 test1 F R Lest1 UPP Ltest1 F P test HAH Ltest1 EHE Lest1 CHS Lest1 testi HOT testi EDU Lest1 USE Lest2 AGR Lest2 F R Lest2 UPP test F P test Lest2 EHE Lest2 Ltest2 Lest2 L
23. enario vi Scenario 2 v Scenario 3 v 9 Exploit scenarios Scenario 4 v Scenario 5 v Show 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 Wolfgang Britz Version May 2013 39 GGIG Graphical Interface Generator Documentation EJ TRIMAG t britz trimag View Handling Windows E TRIMAG result exploitation meta data 0 OX 5 f za i B i Padi i E Bx 3 ESL I 7 Scenario description my first scenario my test scenario CGE 30 RIMAG 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 as a sparse matrix Additional dimension can be added if several files are loaded e g to compare scenarios 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 selectio
24. est2 EDU test OSE 7 Wolfgang Britz Version May 2013 34 GGIG Graphical Interface Generator Documentation 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 farm_constructor gms 91 3 Mb A exp starter gms 74 3 Mb ini_herds gms 19 3 Mb title gms 30 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 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 elapsed 0 00 00 047 GAMS RC 0 lt lt gt The pane with the content be scrolled by a right mouse 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 Sue Less The pane can he
25. gt lt yearDim gt 5 lt yearDim gt amp useHeta truez useleta amp resdir regcgez resdir amp Filemask res 6 9 testShocks 1 gdx lt filemask gt lt task gt The tasks are put on the interface in alphabetical order Wolfgang Britz Version May 2013 13 GGIG Graphical Interface Generator Documentation DAIRYDYN gams File Settings Utilities DAIRYDYWN tasks General set CO Calibrate DAIRYDY _ Single farm run C 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 incFile defines the name of include file used by the task optional sdxsymbol defines the symbol set parameter to load for exploitation llogicaljdim position of the logical dim in gdxsymbol where logical region activity product year scen dim5 filters filters for scenario input see below If no gamsFile or resDir are given the general ones defined in the ini file are used Use of filters for exploitations Filters are used to 1 Tolet 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
26. how to use the information Take the following example which could be generated from a slider SSETGLOBAL STEPS 99 8 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 Seval steps round steps set step 51 5 5 2 Useitin an combined definition and declaration statement for a scalar Scalar steps 5 Z 3 Use it in assignment p control Steps 5 5 4 Use it for pre compiler conditions Seval steps round steps Sifthen steps 5 Use for GAMS program controls if 5 5 gt 18H 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 Wolfgang Britz Version May 2013 42 GGIG Graphical Interface Generator Documentation Siftheni task Estimate constant terms Sinclude est const gms Sendif Er iftheni task Estimate constant terms and trend parameters Sinclude est const and trend gms Sendif
27. les 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 Wolfgang Britz Version May 2013 33 GGIG Graphical Interface Generator Documentation PARAMETER p_tradeElas hgriculture Import supply 8 5 Furestry Import supply 8 5 Other primary sectors Import supply 8 5 Food Praocessing Import supply 8 5 Hanufacturing Import supply 8 5 Enerqyu Import supply 8 5 DLonstruction Import supply 8 5 Trade and Transport Import supply 8 5 Hotel and restaurants Import supply 8 5 Education Import supply 8 5 Other seruices Imnport supply 8 5 Rgriculture Import supply 8 5 Forestry Import supply 8 5 Other primary sectors Import supply 8 5 Food Pracessing Import supply 8 5 Manufacturing Import supply 8 5 Energy Import supply 8 5 Construction Import supply 8 5 Trade and Transport Import supply 8 5 Hotel and restaurants Import supply 8 5 Education Import supply 8 5 Other seruices Import supply 8 5 hgriculture Export demand Furestry Export demand Other primary sectaors Export demand 8 8 Export demand 8 8 Hanufacturing Export d
28. mple definition lt control gt lt order gt 1116 lt order gt lt lt gt lt Title gt First year lt Title gt Ualue gt 1984 Ualue gt lt Options gt 1984 1985 1986 1987 1988 1989 199 1991 1992 1993 1994 1995 1996 Options gt xgqamsNane gt FirstYear lt gamsName 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 Lasks gt lt control gt Output to GAMS SETGLOBAL Choose model tupe Wolfgang Britz Version May 2013 25 GGIG Graphical Interface Generator Documentation filesel Purpose Used for 1 of n selections of a list of files That is e g interesting when the user can chose from a list of pre existing scenario definitions in GAMS files Applicable fields Title GamsName Value Options Tasks 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 1616 lt order gt Type 8581 Type gt lt Title gt Scenario description lt
29. nce 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 1s stored Wolfgang Britz Version May 2013 35 GGIG Graphical Interface Generator Documentation 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 Option TRIMAG model files directory britz trimag Result Directory britz trimag Restart Directory britz trimag Data Files Directory britz trimag Note The name of the system here TRIMAG is defined in the GGIG INI file GAMS and R related settings i Option Option User Settings CAPRI System Settings Path to GAMS exe D gams24 0 gams exe GAMS scratch Directory d scerdir T britz dairydyn R 2 15 1 bin x64 Rscript exe GAMS Opti threads 8 Number of processors sed GAVS Processor speed relative 100 2 4
30. ns For details the CAPRI GUI user manual should be consulted Selecting scenarios When the user clicks on Exploit scenarios in the task selection panel five drop boxes are shown on the right hand side Each box comprises the list of GDX files found in the result director The user can select in each box a file or leave it empty Wolfgang Britz Version May 2013 40 GGIG Graphical Interface Generator Documentation DAIRYDYN gams EIER File Settings Utilities DAIRYDYN taks Scenario exploitation Start DAIRYDYN Scenario 1 v Exploit scenarios Scenario 2 Inge 30COWS 2017 RES_30COWS UNTIL 2015 RES cys UNTIL 2017 RES_30COWS UNTIL 2020 RES_30COWS UNTIL 2023 Scenario 5 RES_30COWS UNTIL 2024 RES_30COWS UNTIL 2025 Scenario 3 Scenario 4 At the bottom of the panel pressing the show results button will open the exploitation tools Show resulks DAIRYDYN gams View Handling Windows Herd summary mean 0 nx Year Farm View type Costs of concentrates Variable costs incl Revenues Euro ha Herd size Heads Gross margin Labour Euro ha hoursiha Milk yield liter head and year Euro ha Bee 25 11 2980 48 451 46 201 29 2529 02 22 00 144 redi 25 68 2973 75 449 12 199 42 2524 63 22 00 1 11 red2 25 01 2971 81 448 56 199 08 2523 25 22 00 7 13 red3 2424 2975 55 449
31. 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 Should not be used for 1 of n selections where n gt 2 use a List instead Applicable fields Title GamsName Value Tasks Control optic Use branching priorities Possible value true false User action tick untick box with mouse Example definition lt control gt lt order 162 order gt lt Type gt EHBERBBR lt Tupe gt lt Title gt Generate 5 child processes on different threads lt Title gt lt Value gt true lt Value gt lt gamsName gt threads lt gamsName gt lt tasks gt Build HSHU database Run scenario with market model Generate expost results Run scenario without market model Baseline calibration supply models baseline Downscale scenario results lt tasks gt lt control gt Output to GAMS SETGLOBAL Priorities false Wolfgang Britz Version May 2013 24 GGIG Graphical Interface Generator Documentation 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 Control optic Choose model type Fe 25 Note Drop down list will appear if the user clicks on arrow Possible value Defined by options field User action tick untick one of the selection possibilities with mouse Exa
32. ontribution of GGIG 158 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 MIVAD and the village CGEs developed in Advanced Eval GAMS tools models resp Java based GUIs where the CAPRI exploitation tools had been used These GAMS based projects used the CAPRI exploitations but did not add any GUI functionalities to also steer their models The experiences with these examples can hence be seen as the starting point for the development of GGIG in order to expand beyond a pure project adjusted implementation of the CAPRI exploitation tools 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 CAPRI exploitation tool It therefore pays typically off to start using GGIG for exploitation from the beginning 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 feat
33. pers themselves know how to change run specific settings in the GAMS code and do so typically quite efficiently As a consequence they seldom feel the need to invest resources in the development of 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 n project Wolfgang Britz Version May 2013 5 GGIG Graphical Interface Generator Documentation specific GUIs The IDE allows inter alia 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 Firstly possible users are often not familiar with GAMS But even with some elementary knowledge of the language they might face problems understanding code making use of advanced GAMS features Secondly they face the challenge to familiarize themselves with the specific code of the project They would need to learn enough to know exactly which specific code changes are necessary to implement e g scenarios in a given project In some cases the large and or complex code of projects basically excludes their 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
34. re 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 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 dimension parameter JTable Wolfgang Britz Version May 2013 20 GGIG Graphical Interface Generator Documentation 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 Genera settings Farm Settings Market settings Algorithm Remark The user can only see one of the tab pane at any time care should 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 Wolfgang Britz Version May 2013 21 GGIG Graphical Interface Generator Documentation Separator Purpose Used to structure the interface gives a title for the next block of controls Appli
35. roject 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 a specific run It is however easily to use a text control to enter the directly the name of a include file The generated include file is overwritten each time the user starts the GAMS project Basic concept of the control definition file GGIG support two format 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 allows breaking up the settings for a control task etc into several XML tags and these tags can additional by stored in different lines see example below Wolfgang Britz Version May 2013 11 GGIG Graphical Interface Generator Documentation scontrol gt sorder gt 1118 order gt lt Type gt singlelist lt Type gt lt Title gt First year lt Title gt Ualue gt 1984 Ualue lt Options gt 1984 1985 1986 1987 1988 1989 1998 1991 1992 1993 1994 1995 1996 lt Options gt lt gamsName gt FirstYear lt gamsHame gt lt tasks gt Prepare national databa
36. se 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 The keywords are discussed in detail below Standard Java property files 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 project independent controls are to a larger extent borrowed from the CAPRI user interface On top a first rudimentary control editor s embedded n the tool Call of GGIG In a normal installation there are two ini files 1 One default file with the control definitions and related default values That file should be typically under version control It can be un XML or ini file format 2 A second file which is installation specific 1t will store
37. the GDX element loaded in the viewer e g to only load records for a specific country A filter definition consist of 3 or 4 fields 1 The logical dimension to which it is applied region activity product year scen dim5 Wolfgang Britz Version May 2013 14 GGIG Graphical Interface Generator Documentation 2 The selection control which 1s used for the filter 3 The type of filter a Starts with or ends with for GDX element filters i e only such records will be loaded where the item describing the logical dimension starts with one of the selected keys b 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 with the following filters amp Filter region CountriesSel starts with lt filter gt lt filter gt Base year BaseYearsSel 7 8 skipi filter amp filter ear SimYearsSel 9 18 s5kipi filter The first filter starts with does not affect the file selection but will affect the records loaded in the viewer In our example only records where the region key starts with DE or BL will be available 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
38. tz ILR University Bonn Institute for Food and Resource Economics CgeRegEU Tni file regcge ini User name undefined User type runner As shown above the GUI consists a few elements Wolfgang Britz Version May 2013 9 GGIG Graphical Interface Generator Documentation 1 A menu bar which allows to change some settings see the section on general interface settings 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 and a windows in which the message log from GAMS is shown A panel to select scenario and to start the exploitation 11 The exploitation tools 4 A small window in the left lower corner which present a logo Whereas the elements 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 task and each task might have its own GAMS process That allows steering even rather complex GAMS installations with one GUI It allows supports a structured development of the GAMS code as either separate
39. ultilist MultiListNonZero 020 00000000 0 SHAEF Wolfgang Britz Version May 2013 GGIG Graphical Interface Generator Documentation Starting GAMS Trom GGG zer ae 35 General titer aCe 36 GAMSandRTel ted SELON 36 DV NTC late d Se las 37 Settings linked to the exploitation tools 37 Meta dat handl ne sensationell 38 Ins NIORT TT ine 38 TSG TRAN A iie 9 T 38 EX DIGI AT OMe 40 SEIECUNS 40 Menu Bar 4 Design hints for structured programming in GAMS with 42 sine aniormation passed rom GIS an ae ee 42 Str cture your programm DY tasks ne a vb dade 42 One entry points for run specific sei 8 nen 43 Wolfgang Britz Version May 2013 4 GGIG Graphical Interface Generator Documentation Overview The GAMS Graphical Interface Generator GGIG is a tool to generate a basic Graphical User Interface GUI for a GAMS 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 of the controls Th
40. ures a set of utilities originally developed for CAPRI such as HTML based documentation of the GAMS code or a GDX viewer Wolfgang Britz Version May 2013 7 GGIG Graphical Interface Generator Documentation 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 depicted below At its core stands the GGIG Control generator based on Java code Based on a XML based definition file 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 in automatically generated include file including 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 pre defined reports to exploit the results The details of the different elements are discussed below GGIG Controls and Settings GGIG definition file Control Generator Project specific GUI GAMS Exploitation executable tools GAMS include file
Download Pdf Manuals
Related Search
Related Contents
D-Link DES-3010G/3018 3026 INSTRUCTIUNI C104 testo 316-3 · Leakage detector for refrigerants 揮発油規格に違反する燃料を販売する事業者に係る公表について - DynaScan Skross SKR1500215 FCH取扱説明書 - Fintech.co.jp Drum Mower User`s Manual Manual de Usuario RETARDADOR-FH GEL Copyright © All rights reserved.
Failed to retrieve file