Index of subset

537 views
Skip to first unread message

clarissa....@gmail.com

unread,
Sep 27, 2020, 1:14:51 PM9/27/20
to AMPL Modeling Language
Hello! I have some problem over summations index of subset. I can't solve it, AMPL shows me syntax error and index undefined.

Thank for your help.
Copertura.mod

Mikhail

unread,
Sep 27, 2020, 2:41:00 PM9/27/20
to AMPL Modeling Language
Hello! I do not pretend to be 100% correct, but the syntax is fixed. Try this ..



Copertura.mod

Clarissa Pannullo

unread,
Sep 28, 2020, 3:04:37 AM9/28/20
to am...@googlegroups.com
Thank you Mikhail, I was going crazy. Can I also ask you about my file .dat? AMPL gives me these errors:
line 40
offset 2283
wrong number of *'s for table
file -
line 50
offset 2542
only one set name allowed between colons
Error executing "solve" command:
error processing set START:
START contains ('M1',1), which is not
within CUCE cross GIRI;
Error executing "solve" command:
error processing set START:
START contains ('M1',2), which is not
within CUCE cross GIRI;
Error executing "solve" command:
error processing set START:
START contains ('M1',3), which is not
within CUCE cross GIRI;
Error executing "solve" command:
error processing set START:
START contains ('M2',4), which is not
within CUCE cross GIRI;
Error executing "solve" command:
error processing set START:
START contains ('M2',5), which is not
within CUCE cross GIRI;
Error executing "solve" command:
error processing param D:
invalid subscript D['C4','Multi'] discarded.
Error executing "solve" command:
error processing param TRFISSO:
5 invalid subscripts discarded:
TRFISSO[1]
TRFISSO[2]
TRFISSO[3]
and 2 more.
Error executing "solve" command:
error processing param TRVAR:
5 invalid subscripts discarded:
TRVAR[1]
TRVAR[2]
TRVAR[3]
and 2 more.
Error executing "solve" command:
error processing param TRKM:
5 invalid subscripts discarded:
TRKM[1]
TRKM[2]
TRKM[3]
and 2 more.
Error executing "solve" command:
error processing param TRT:
5 invalid subscripts discarded:
TRT[1]
TRT[2]
TRT[3]
and 2 more.
I'm reading many manuals to write the instructions but the problem could be my student version.
Thank you so much.
 

Mail priva di virus. www.avg.com

Il giorno dom 27 set 2020 alle ore 20:41 Mikhail <rabt...@tut.by> ha scritto:
Hello! I do not pretend to be 100% correct, but the syntax is fixed. Try this ..



--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/937a64f4-d1ba-4300-9fee-2c5ef09686c9o%40googlegroups.com.
Copertura.dat

Mikhail

unread,
Sep 28, 2020, 7:27:34 AM9/28/20
to AMPL Modeling Language
Without a problem statement, it's hard enough to understand the whole logic of your model. In this regard, please provide a statement of the problem. Other than that, my AMPL output is different from the one you presented. In this regard, please provide your working * .mod file again.

понедельник, 28 сентября 2020 г., 10:04:37 UTC+3 пользователь Clarissa Pannullo написал:
To unsubscribe from this group and stop receiving emails from it, send an email to am...@googlegroups.com.

AMPL Google Group

unread,
Sep 28, 2020, 9:05:53 AM9/28/20
to AMPL Modeling Language
There is a typing error in your data for set GIRI:

set GIRI: 1 2 3 4 5;

The : should be := here.

As a general rule, fix the first error that AMPL reports, then run your model and data again. Often when one error is fixed, some other errors disappear.


--
Robert Fourer
am...@googlegroups.com
{#HS:1293845051-89159#}
On Mon, Sep 28, 2020 at 11:27 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Without a problem statement, it's hard enough to understand the whole logic
of your model. In this regard, please provide a statement of the problem.
Other than that, my AMPL output is different from the one you presented. In
this regard, please provide your working * .mod file again.

понедельник, 28 сентября 2020 г., 10:04:37 UTC+3 пользователь Clarissa
Pannullo написал:


Mail
priva di virus. www.avg.com


Il giorno dom 27 set 2020 alle ore 20:41 Mikhail <rabt...@tut.by> ha
scritto:
On Sun, Sep 27, 2020 at 6:41 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hello! I do not pretend to be 100% correct, but the syntax is fixed. Try this ..

--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.

Clarissa Pannullo

unread,
Sep 28, 2020, 11:41:30 AM9/28/20
to am...@googlegroups.com

Clarissa Pannullo

unread,
Sep 30, 2020, 1:14:24 PM9/30/20
to AMPL Modeling Language
Sorry, I still have problems with my model. This time, the AMPL output gives me not binary variables.
In file.docx my mathematical statement. 
Thanks in advance

Modello Copertura.docx
Copertura.mod

AMPL Google Group

unread,
Sep 30, 2020, 4:27:42 PM9/30/20
to AMPL Modeling Language
Be sure that you are telling AMPL to use a solver that can optimize over binary variables. This is done with an "option solver . . ." command. For example,

To use CPLEX, add: option solver cplex;
To use Gurobi, add: option solver gurobi;
To use Xpress, add: option solver xpress;

Other solvers, such as MINOS and SNOPT, will give an "ignoring integrality . . ." message and may return some fractional values for variables defined as binary.

If you continue to have this problem, copy your entire AMPL session -- everything that you typed and all lines that AMPL displayed -- into your email. Also attach the current version of your data file along with your model file.


--
Robert Fourer
am...@googlegroups.com
{#HS:1293845051-89159#}
On Wed, Sep 30, 2020 at 5:14 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Sorry, I still have problems with my model. This time, the AMPL output gives me not binary variables.
In file.docx my mathematical statement.
Thanks in advance

On Mon, Sep 28, 2020 at 3:41 PM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Thank you for your help

Il lun 28 set 2020, 15:05 AMPL Google Group <am...@googlegroups.com> ha scritto:

On Mon, Sep 28, 2020 at 1:05 PM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
There is a typing error in your data for set GIRI:

set GIRI: 1 2 3 4 5;

The : should be := here.

As a general rule, fix the first error that AMPL reports, then run your model and data again. Often when one error is fixed, some other errors disappear.


--
Robert Fourer
am...@googlegroups.com

Mikhail

unread,
Sep 30, 2020, 11:10:41 PM9/30/20
to AMPL Modeling Language
After you connect the required solver, you will need to fix the following errors:
1.in the declaration of the set MIXD: = (C1, Mono) (C2, Mono) (C3, Multi) (C4, Multi) (C5, Multi); the pair (C4, Multi) is used, and in param D: [C4, Mono] - this discrepancy needs to be corrected.
2. I think that the BETA parameter should have the values 0 or 1. Therefore, in its declaration you need to specify:
param: BETA (tr) default 0:=...
After these changes, you will receive the result of the solution.

Mikhail

unread,
Sep 30, 2020, 11:46:36 PM9/30/20
to AMPL Modeling Language
Sory, param BETA (tr) default 0:=...


Reply all
Reply to author
Forward
0 new messages