Forum Discussion
FICO
5 years agoCommunity Manager
Hi, I am in the process of developing a simple optimization model for a supply chain. Two of the constraints relate to suppliers and the kitting facility.
The two constraints are: 1) Only one kitting facility can be chosen 2) Only one (or a variable number) of suppliers of one ingredient needs to be chosen. Why don't the constraints expressed on lin...
FICO
5 years agoCommunity Manager
Hi Tristan,
Sounds good. Thanks again.
Two questions:
1) I am not sure why I am getting an error when populating an array within an array with one element. Some ingredients only have one supplier.
! Declaration of sets. This is will eventually be a list
declarations
Supplier_sites = 1..16 !Defines the supplier sites
Potential_kf = 1..2 !Defines the potential kitting facilities
Copackers = 1..6 ! Defines the copackers
Ingredients = 1..8 ! Defines the number of ingredients
test_Supplier_sites: array(Ingredients) of list of integer
!...
end-declarations
!Declaration of parameters
declarations
DISTANCES_M1: array (Supplier_sites,Potential_kf ) of integer ! Distances from sp sites to potential kfs
DISTANCES_M2: array(Potential_kf, Copackers) of integer ! Distances from sp sites to potential kfs
INGREDIENT_DEMAND: array(Ingredients) of real
end-declarations
!read data from file
initializations from "mmsheet.excel:"+ dataSource
DISTANCES_M1 as 'Supplier_PotentialKf'
DISTANCES_M2 as 'Possiblekf_Copacker'
end-initializations
declarations
supplier_kf: array(Supplier_sites,Potential_kf) of mpvar
kf_copacker: array(Potential_kf, Copackers) of mpvar
kf: array(Potential_kf) of mpvar
!sp: array(Supplier_sites) of mpvar
end-declarations
! Objective: Minimize the overall cost of the new supply chain
MinCost := sum(i in Supplier_sites, j in Potential_kf )supplier_kf(i,j)*DISTANCES_M1(i,j) + sum(i in Potential_kf, j in Copackers) kf_copacker(i,j)*DISTANCES_M2(i,j)
test_Supplier_sites :: [[1],[2,3],[4],[5],[6],[7,8],[9,10],[11..16]]
n := 1
m := 12) I am on PST and wondering if you and Susanne are operating from a different timezone. I am only asking so I can plan my work more strategically.
At any rate, this forum is a helpful resource.

