GAMS Rev 149 x86_64/MS Windows 01/11/21 14:28:56 Page 1 G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m C o m p i l a t i o n 4 5 Option limrow = 999999 6 Option limcol = 999999 7 8 9 10 { syntax_version is the flag we use in the $if statements to compile in/out different bits of code. 11 Comment/uncomment to switch between the two syntax versions } 12 //$setglobal syntax_version simple 14 15 Sets 16 g "units" /unit1, unit2/ 17 y "years" /1999* 2020/ 18 ; 19 20 Alias (g,g2) 21 (y,y2) 22 23 Sets 24 26 complex1(g,y,y2) 27 complex2(g,y,y2) 28 $endIf **** $2 **** LINE 31 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 29 ; 30 32 33 complex1(g,y,y2) = yes; 34 complex2(g,y,y2) = no; 35 36 $endif **** $2 **** LINE 43 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 37 38 Variables 39 41 v_complex1(g,y,y2) 42 v_complex2(g,y,y2) 43 $endif **** $2 **** LINE 53 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 44 v_obj_z; 45 46 47 Positive Variables 49 v_complex1, v_complex2 50 $endif **** $2 **** LINE 62 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 51 ; 52 53 54 Equations 55 57 c_complex_lower(g,y,y2) 58 c_complex_upper(g,y,y2) 59 $endif **** $2 **** LINE 74 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 60 c_obj_z; 61 62 64 c_complex_lower(g,y,y2) .. v_complex1(g,y,y2)$complex1(g,y,y2) + v_complex2(g,y,y2)$complex2(g,y,y2) =G= 10; 65 c_complex_upper(g,y,y2) .. v_complex1(g,y,y2)$complex1(g,y,y2) + v_complex2(g,y,y2)$complex2(g,y,y2) =L= 20; 66 $endif **** $2 **** LINE 86 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 67 68 69 70 c_obj_z .. v_obj_z =E= 72 sum((g,y,y2), v_complex1(g,y,y2)$complex1(g,y,y2) + v_complex2(g,y,y2)$complex2(g,y,y2)); 73 $endif **** $2 **** LINE 95 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 74 75 model demo / all /; 76 option lp = mosek; 77 demo.optfile = 1; 78 solve demo using lp minimizing v_obj_z; **** $257 **** LINE 100 INPUT D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms 79 80 execute_unload "modelDump"; **** Incomplete $IfThen at nest level 1 from line 25 inclevel 0 **** Incomplete $IfThen at nest level 2 from line 31 inclevel 0 **** Incomplete $IfThen at nest level 3 from line 40 inclevel 0 **** Incomplete $IfThen at nest level 4 from line 48 inclevel 0 **** Incomplete $IfThen at nest level 5 from line 56 inclevel 0 **** Incomplete $IfThen at nest level 6 from line 63 inclevel 0 **** Incomplete $IfThen at nest level 7 from line 71 inclevel 0 **** $675,299 UNEXPECTED END OF FILE (1) GAMS Rev 149 x86_64/MS Windows 01/11/21 14:28:56 Page 2 G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m Error Messages 2 Identifier expected 257 Solve statement not checked because of previous errors 299 Unexpected end of file 675 Closing $endif missing **** 10 ERROR(S) 0 WARNING(S) COMPILATION TIME = 0.063 SECONDS 3 Mb WEX226-149 Dec 19, 2007 USER: Ira Shavel G090128:1328CS-WIN Charles River Associates DC60 **** FILE SUMMARY Input D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.gms Output D:\Current\IHS\GEO\Rowan\syntax_investigation_combined_model\if_then_else.lst **** USER ERROR(S) ENCOUNTERED