Setting constraints to maintain temporal flow of materials
Problem:
Setting constraints of materials flow (e.g. seeds) from field to facilities (e.g., storages, crushing mills). Seed data is avialable. I need to figure out the seed flow from fields to storages, crushing mills and storages to crushing mills from different locations of fields and facilities at different time periods. The conditions of flows like this:
- In the first quarter of a year seeds go to either storages and or mills.
- Seeds can also go to mills via storages from fields in the first quarter
- In the 2nd quarter the full or partial portion of remaining seeds from quarter 1 in the storages go to mills
- In the 3rd quarter the full or partial portion of remaining seeds from quarter 2 in the storages go to mills
- In the 4th quarter the remaining seeds from quarter 3 in the storages go to mills
- The process is repeated for every eyars.
set:
C = [County_1, County_2, ...........County_n] ............locations of fields (f), storages (s), crushing mills (m)
T = [1, 2, 3, .....20] ..............number of years
Q = [1, 2, 3, 4] ....................number of quarter in a year
Variables:
Seed = S[f,t,q] = {(f,t,q): ton of seeds in field f in year t at quarter q}
FieldToStorage = FS[f,s,t,q] = m.addVar()
FiledToMill = FM[f,m,t,q] = m.addVar()
StorageToMill = SM[s,m,t,q] = m.addVar()
For quarter 1:
m.addConstrs(
FS(f,s,t,q=1) + FM(f,m,t,q=1) <= S(f,t,q=1) for f in C for s in C for m in C for t in T)
m.addConstrs(
SM(s,m,t,q=1) <= FS(f,s,t,q=1) for s in C for m in C for f in C for t in T)
For quarter 2:
m.addContrs(
SM(s,m,t,q=2) <= FS(f,s,t,q=1) - SM(s,m,t,q=1) for s in C for m in C for f in C for t in T)
For quarter 3:
m.addContrs(
SM(s,m,t,q=3) <= FS(f,s,t,q=2) - SM(s,m,t,q=1) - SM(s,m,t,q=2) for s in C for m in C for f in C for t in T)
For quarter 4:
m.addContrs(
SM(s,m,t,q=4) <= FS(f,s,t,q=2) - SM(s,m,t,q=1) - SM(s,m,t,q=2) - SM(s,m,t,q=3) for s in C for m in C for f in C for t in T)
Repeat the process until T=20
Is there anyone can help to solve above problem?
Thanks in advance
Kazi
-
Official comment
This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
Post is closed for comments.
Comments
1 comment