Problem with a constraint modelling

14 views
Skip to first unread message

Miroslav Prokic

unread,
Aug 26, 2016, 5:01:55 PM8/26/16
to am...@googlegroups.com
Dear all, 
I am sorry for bordering you, but I need your help. I am desperate. Namely, I have the 
problem with a constraint modelling, I dont know how to express it in AMPL. The pictures of constraint are in attachment. Please help me how to solve this.

Miroslav


1.JPG
2.JPG

Miroslav Prokic

unread,
Aug 29, 2016, 10:37:33 AM8/29/16
to am...@googlegroups.com
Please can you help me? Thanks

Robert Fourer

unread,
Aug 30, 2016, 10:27:52 AM8/30/16
to am...@googlegroups.com

The mathematical constraints that you posted use some informal and nonstandard notation that makes them hard to understand.  Since the mathematical constraints are hard to understand, it is also hard to figure out how to express the same constraints in AMPL.  For your first constraint I am guessing that the AMPL formulation would be as follows:

   set T;
   param ed {T};
   param ld {T};
   param Dep {T};
   param d {t in T, ed[t]..ld[t]};

   var x {T,??,??} binary;

   subject to Constr1 {t in T}:
      sum {k in ed[t]..ld[t]} x[t,Dep[t],d[t,k]] = 1;

I am not sure what you should put for ?? in the indexing of var x, however, because I do not know what values Dep[t] and d[t,k] would take.

For your second constraint I am not sure what to do, because I do not know what the notations like (i+1)
l and im are supposed to mean.

Bob Fourer
am...@googlegroups.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 ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages