|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
[AMPL 2586] Re: Assignment and constraintsHi, Thanks for the reply. I indeed want the former - L[0] <= M[0], L[1] <= M[1], L[2] <= M[2], L[3] <= M[3], L[4] <= M[4]. My question was about what happens subsequently when I assign L[0] to M[j], whether this L[0] will be chosen to satisfy the constraint above L[j] <= M[j], as I expect it to. [There is a reason for why I'm doing it this way.] Thanks so much! --- On Sat, 6/6/09, Robert Fourer <4er@...> wrote: > From: Robert Fourer <4er@...> > Subject: [AMPL 2583] Re: Assignment and constraints > To: ampl@..., "'x'" <to_rent_2000@...> > Date: Saturday, June 6, 2009, 10:42 AM > > > When you write "c1{j in 0..4}: L[j] <= M[j]" AMPL sets j > successively to the > values 0, 1, 2, 3, 4 and generates the corresponding > constraints L[0] <= > M[0], L[1] <= M[1], L[2] <= M[2], L[3] <= M[3], > L[4] <= M[4]. > > Evidently you're looking for something else, so you need to > write your > constraint differently. The constraint "c3{j in > 0..4}: L[0] <= M[j]" seems > more nearly like what you are describing, since it > generates L[0] <= M[0], > L[0] <= M[1], L[0] <= M[2], ... > > To be sure you could get a listing of all the constraints > generated by > giving the AMPL commands "expand c1;", "expand c3;" and the > like. The > solver does not have any effect on what constraints AMPL > generates; only > after AMPL generates all the constraints (and the > objective) does the solver > try to find a solution for them. If FilMINT is > crashing on some problem > then you best bet is to bring that to the attention of > FilMINT's developers. > > Bob Fourer > 4er@... > > > > -----Original Message----- > > From: ampl@... > [mailto:ampl@...] > On Behalf Of x > > Sent: Thursday, June 04, 2009 1:16 PM > > To: ampl@... > > Subject: [AMPL 2576] Assignment and constraints > > > > > > > > Hi all, > > > > I have the following. I'm keeping the syntax simple > here for ease of > > discussion. > > > > var L{0..4}, M{0..4}; > > var final >= 0; > > > > c1{j in 0..4}: L[j] <= M[j]; > > > > c2{j in 1..4}: L[j] = L[0]; > > > > c{j in 0..4}: final = sum{j} (M[j] - L[j]); > > > > minimize{j in 0..4}: final; > > > > #need this explicitly? > > #c3{j in 0..4}: L[0] <= M[j]; > > > > This crashes FilMINT solver. Unfortunately, I don't > get any indication of > > what or where the problem is when the solver crashes.. > So, I tried it with > > MINOS solver; it ignores integrality (not related to > the variables shown > > here) but solves the problem. However, it picks L[0] > to have a value that > > is not <= each M[j] which makes final negative. But > this is not what I > > expected. > > > > So, my question is this - when L[1..4] is assigned > L[0], will L[0] value > > be selected by the solver to be <= each of the M[j] > per constraint c1? > > > > [Or, does the solver pick L[0] <= M[0], assign L[0] > to the rest of the > > L[j] and then crash if c1 or final_LB is violated? In > that case, I'd have > > to include c3 constraint but even that hasn't helped > me with FilMINT so > > far. However, me forcing L[0] to have a valid value > (through a constraint) > > helps..] > > > > Sincere thanks in advance for any and all > information! > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group. To post to this group, send email to ampl@... To unsubscribe from this group, send email to ampl+unsubscribe@... For more options, visit this group at http://groups.google.com/group/ampl?hl=en -~----------~----~----~----~------~----~------~--~--- |
| Free embeddable forum powered by Nabble | Forum Help |