| Type | ||
|---|---|---|
| Name | Type | Values |
| Product | string | P1, P2, P3 |
| Resource | string | R1, R2, R3 |
| Function | |
|---|---|
| Name | Type |
| demand of Product | Int |
| inside cost of Product | Int |
| outside cost of Product | Int |
| capacity of Resource | Int |
| nb Resource required for Product | Int |
| nb Product produced inside | Int |
| nb Product produced outside | Int |
| usage of Resource | Int |
| Constant | |
|---|---|
| Name | Type |
| total cost | Int |
| Product data | ||||
|---|---|---|---|---|
| D | Product | demand of Product | inside cost of Product | outside cost of Product |
| 1 | P1 | 250 | 6 | 8 |
| 2 | P2 | 300 | 8 | 9 |
| 3 | P3 | 200 | 3 | 4 |
| Resource data | ||
|---|---|---|
| D | Resource | capacity of Resource |
| 1 | R1 | 1200 |
| 2 | R2 | 800 |
| 3 | R3 | 700 |
| Resource data | |||
|---|---|---|---|
| D | Resource | Product | nb Resource required for Product |
| 1 | R1 | P1 | 5 |
| 2 | R2 | P1 | 2 |
| 3 | R3 | P1 | 0 |
| 4 | R1 | P2 | 4 |
| 5 | R2 | P2 | 4 |
| 6 | R3 | P2 | 0 |
| 7 | R1 | P3 | 3 |
| 8 | R2 | P3 | 0 |
| 9 | R3 | P3 | 6 |
| Meet demand | ||||
|---|---|---|---|---|
| E* | Product | demand of Product | nb Product produced inside | nb Product produced outside |
| 1 | - | nb Product produced inside + nb Product produced outside | ≥ 0 | ≥ 0 |
| Calculate total cost | ||
|---|---|---|
| C+ | Product | total cost |
| 1 | - | (nb Product produced insides * inside cost of Product) + (nb Product produced outside * outside cost of Product) |
| Calculate capacity | |||
|---|---|---|---|
| C+ | Resource | Product | usage of Resource |
| 1 | - | - | nb Product produced inside * nb Resource required for Product |
| Don't exceed capacity | ||
|---|---|---|
| E* | Resource | usage of Resource |
| 1 | - | ≤ capacity of Resource |
| Constant | |
|---|---|
| Name | Type |
| total cost | Int |
| capacity percentage margin | Real |
| max percent external | Real |
| min percent internal | Real |
| Don't exceed capacity | ||
|---|---|---|
| E* | Resource | usage of Resource |
| 1 | - | ≤ capacity of Resource * (capacity percentage margin /100) |
| Extra product constraints | |||
|---|---|---|---|
| E* | Product | nb Product produced inside | nb Product produced outside |
| 1 | - | > (min percent internal/100) * demand of Product | < (max percent external/100) * demand of Product |