--
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/b590cc2d-b061-476d-9e38-a67b58bb7cde%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/reply-77152-1093012455-3101923198-1582676006-99358035%40helpscout.net.
Dear Filipe,In the screenshot you can see the output when I run with ampl.eval('display rating;'). The first batch (period) runs fine, but for the second batch we get an error message. Indeed, we see that the number of values for rating is equal to number of mentors in that batch. Still, we get an error with invalids subscripts.In case we are not able to identify the issue from this, I'll also add a version of the AMPL model, the Python script and the datasets for students and mentors.Best, Aksel
ons. 26. feb. 2020 kl. 01:13 skrev AMPL Google Group <am...@googlegroups.com>:
{#HS:1093012455-68873#}Could you please provide us a minimal example with code so that we can reproduce this issue on our end?
Updating parameters should not be a problem unless the change conflicts with other data set previously. Could you please add ampl.eval('display rating;') right before ampl.getParameter('rating').setValues(rating) and send us the output?
--
Filipe Brandão
am...@googlegroups.com
![]()
On Tue, Feb 25, 2020 at 8:38 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hi,--I am developing a multiperiod optimiziton model that allocates mentors to students with Python and AMPL. All data is processed and stored in Python, while the optimization model is in AMPL. My problem is that the parameter for "number of students" and "number of mentors" is dynamic and varies from period to period. Each period is processed as an iteration of a for loop and my intention is to update these peremeters for each period. However, I find that if the "number of students" and "number of mentors" of a period does not equal the number in period 1, the program encounters an error.Can anyone help me finding a solution on how to dynamically update the parameters for number of students and mentors in AMPL for each iteration?Attached is screenshots of the error message, and some of the scripts.
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 am...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/b590cc2d-b061-476d-9e38-a67b58bb7cde%40googlegroups.com.
--
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 am...@googlegroups.com.
By the way, the reason why it is 7 invalid subscripts is that there is 11 mentors in batch 1, and only 4 in batch 2. So I assume AMPL is expecting 11 also in the second batch. However, the length of the set of mentors (set mentor= 1..nMentors;) is supposed to be updated for the second batch.
onsdag 26. februar 2020 10.15.03 UTC+1 skrev Aksel Petter Spence følgende:
Dear Filipe,
In the screenshot you can see the output when I run with ampl.eval('display rating;'). The first batch (period) runs fine, but for the second batch we get an error message. Indeed, we see that the number of values for rating is equal to number of mentors in that batch. Still, we get an error with invalids subscripts.
In case we are not able to identify the issue from this, I'll also add a version of the AMPL model, the Python script and the datasets for students and mentors.
Best, Aksel
ons. 26. feb. 2020 kl. 01:13 skrev AMPL Google Group <[url=javascript:]am...@googlegroups.com>:
Could you please provide us a minimal example with code so that we can reproduce this issue on our end?
Updating parameters should not be a problem unless the change conflicts with other data set previously. Could you please add ampl.eval('display rating;') right before ampl.getParameter('rating').setValues(rating) and send us the output?
--
Filipe Brandão
On Wed, Feb 26, 2020 at 9:15 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Dear Filipe,
In the screenshot you can see the output when I run with ampl.eval('display rating;'). The first batch (period) runs fine, but for the second batch we get an error message. Indeed, we see that the number of values for rating is equal to number of mentors in that batch. Still, we get an error with invalids subscripts.
In case we are not able to identify the issue from this, I'll also add a version of the AMPL model, the Python script and the datasets for students and mentors.
Best, Aksel
ons. 26. feb. 2020 kl. 01:13 skrev AMPL Google Group <am...@googlegroups.com>:
On Wed, Feb 26, 2020 at 12:13 AM UTC, AMPL Google Group <am...@googlegroups.com> wrote:
Could you please provide us a minimal example with code so that we can reproduce this issue on our end?
Updating parameters should not be a problem unless the change conflicts with other data set previously. Could you please add ampl.eval('display rating;') right before ampl.getParameter('rating').setValues(rating) and send us the output?
--
Filipe Brandão
am...@googlegroups.com
On Tue, Feb 25, 2020 at 8:38 AM UTC, AMPL Modeling Language <am...@googlegroups.com> wrote:
Hi,--I am developing a multiperiod optimiziton model that allocates mentors to students with Python and AMPL. All data is processed and stored in Python, while the optimization model is in AMPL. My problem is that the parameter for "number of students" and "number of mentors" is dynamic and varies from period to period. Each period is processed as an iteration of a for loop and my intention is to update these peremeters for each period. However, I find that if the "number of students" and "number of mentors" of a period does not equal the number in period 1, the program encounters an error.Can anyone help me finding a solution on how to dynamically update the parameters for number of students and mentors in AMPL for each iteration?Attached is screenshots of the error message, and some of the scripts.
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/reply-77152-1093012455-3104514600-1582747689-1447777334%40helpscout.net.