I would like to define a decision vector xij in OPL such that the range of index j is dependent on index i. This is, for i in I, j assumes a value in a range f(i)..J.

asked 14 Sep '16, 15:32

Anselmo's gravatar image

Anselmo
112
accept rate: 0%


Hi, then you should use a tuple set with the right <i,j>.

range I=1..3;

int J=10;

int f[i in I]=J-i;

tuple t
{
  int i;
  int j;
}

{t} s={<i,j> | i in I,j in (f[i]..J)};

dvar boolean x[s];

subject to
{
 x[<1,10>]==1;
}

regards

link

answered 17 Sep '16, 05:33

AlexFleischer's gravatar image

AlexFleischer
863
accept rate: 10%

edited 17 Sep '16, 05:33

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×191
×13
×2
×2

Asked: 14 Sep '16, 15:32

Seen: 1,260 times

Last updated: 17 Sep '16, 05:33

OR-Exchange! Your site for questions, answers, and announcements about operations research.