SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-21-2014 03:05 PM

In SAS OPTMODEL procedure, let's assume we have four string sets: products {pro1, pro2, pro3}, items {pro1, pro2, pro3}, fakeitem {pro1, pro3}, gooditem {pro1, gooda, goodb};

and one number, cost(products) = {3, 5, 2}.

Then apparently, we have sum{p in products} cost(p) = 10.

My question to you is that: Are the below three equations true as well?

sum{p in items} cost(p) = 10;

sum(p in fakeitem} cost(p) = 5;

sum(p in gooditem} cost(p) = 3.

Appreciate your answers, thank you very much.

Accepted Solutions

Solution

02-21-2014
05:16 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to wutao9999

02-21-2014 05:16 PM

The first two equations are true. The third equation requires cost['gooda'] and cost['goodb'] to be defined. You could assign those costs to be 0, and then the third equation would be true. Alternatively, you could modify the sum in the third equation in any of the following three ways:

sum{p in gooditem inter products} cost

sum{p in gooditem: p in products} cost

sum{p in gooditem} (if p in products then cost

)

Each of these approaches would yield 3.

All Replies

Solution

02-21-2014
05:16 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to wutao9999

02-21-2014 05:16 PM

The first two equations are true. The third equation requires cost['gooda'] and cost['goodb'] to be defined. You could assign those costs to be 0, and then the third equation would be true. Alternatively, you could modify the sum in the third equation in any of the following three ways:

sum{p in gooditem inter products} cost

sum{p in gooditem: p in products} cost

sum{p in gooditem} (if p in products then cost

)

Each of these approaches would yield 3.