I passed my code through chat-gpt and was told the code should work, but when I try to load my model, I get an error:
line 1 (offset 9):
syntax error
context: set grid >>> symbolic; <<<
I explained the error to chat-gpt and was told I might have unprintable characters so I ran cat -A on my input file to get:
set grid symbolic;
set beam in b_supply symbolic;
set beam_options{i in grid} within beam:=beam;
param b_supply{beam} >= 0;
param g_demand{grid} >= 0;
param g_b_bps{grid,beam};
var g_assign{i in grid, j in beam_options} binary;
minimize Aggregate:
sum({i in grid, j in beam_options} min(0,g_demand[i]/g_b_bps[i,j] - g_assign[i,j]*g_demand[i]/g_b_bps[i,j])) +
sum({i in grid, j in beam} g_assign[i,j]*g_demand[i]/g_b_bps[i,j]);
subject to card(g_assign, beam_options) <= 1;
subject to sum({i in grid, j in beam_options} g_assign[i,j]*g_demand[i]/g_b_bps[i,j]) <= b_supply[j];
I checked to see if grid was a reserved word and I did not find it on the list. symbolic is a reserved word but I think I am using it correctly.
I am running ampl version: AMPL Version 20240606 (MSVC 19.40.33811.0, 64-bit) which I include because chat-gpt also asked this question.