Dear all

I would like to make a set as follow in opl cplex : J in {1,..,n}-{6,12,18,....} how I should do that ? I also have a variable as follow: (sum of i ) X{ij}-1k , forall in j,k that j is as above and k , i =1,...,n

Regards

asked 05 Sep '17, 10:48

Shah's gravatar image

Shah
132
accept rate: 0%


Hi

 int n=20;
 int m=6;
 {int} J1=asSet(1..n) diff {6*i | i in 1..n};
 {int} J2={i | i in 1..n : i mod m!=0};

 execute
 {
 writeln(J1);
 writeln(J2); 
 }

gives

{1 2 3 4 5 7 8 9 10 11 13 14 15 16 17 19 20}
 {1 2 3 4 5 7 8 9 10 11 13 14 15 16 17 19 20}

regards

link

answered 06 Sep '17, 14:58

Alex%20Fleischer's gravatar image

Alex Fleischer
1564
accept rate: 11%

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:

×2
×2

Asked: 05 Sep '17, 10:48

Seen: 324 times

Last updated: 06 Sep '17, 14:58

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