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
If the ranges you have specified within your spreadsheet include the index values then there is no need to provide any fixed values for index sets within your model (it is indeed generally recommended good practice for optimization model implementations to make your model code independent of specific data instances by removing any fixed data from the model itself). For your case you should be able to use declarations along these lines:
declarations
Supplier_sites: range ! Defines the supplier sites
Potential_kf: range ! Defines the potential kitting facilities
Copackers: range ! Defines the copackers
Ingredients: range ! Defines the number of ingredients
test_Supplier_sites: array(Ingredients) of list of integer
end-declarations
! Read data from file (range definitions are expected to contain index values)
initializations from "mmsheet.excel:"+dataSource
DISTANCES_M1 as 'Supplier_PotentialKf'
DISTANCES_M2 as 'Possiblekf_Copacker'
end-initializations
!...
! Specify index range if not known previously:
test_Supplier_sites :: [1..8][[1],[2,3],[4],[5],[6],[7,8],[9,10],[11,12,13,14,15,16]]
