Hi all,
Having trouble writing zeros in a parameter to a spreadsheet (I am using squeeze, but still have the problem. With variables it is ok. For example, in the following code the output of the parameter squeezes the zero, but the output of the variable doesn’t. Any ideas?
set fruits /apples, oranges/;
parameter price(fruits) /
apples 5
oranges 10
/;
parameter quantity_fruits(fruits);
variable quantity(fruits), cost;
integer variable quantity
equations
cost_eq
quantity_eq;
cost_eq… cost =e= sum(fruits, quantity(fruits)*price(fruits));
quantity_eq… sum(fruits, quantity(fruits)) =g= 2;
model purchase fruits /all/;
solve purchase using Mip minimizing cost;
quantity_fruits(fruits) = quantity.l(fruits);
execute_unload ‘output’, quantity, quantity_fruits;
execute ‘xlstalk.exe -S output.xlsx’
execute ‘gdxxrw output.gdx squeeze=n par=quantity_fruits rng=Sheet1!A2 cdim=0 o=output.xlsx’
execute ‘gdxxrw output.gdx squeeze=n var=quantity rng=Sheet1!D2 cdim=0 o=output.xlsx’
execute ‘xlstalk.exe -O output.xlsx’
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/d/optout.