I have a problem regarding formulating the following with math notation. My goal is that if shop i’s arrival time is lower than all the other shop’s arrival times, then shop i must be allocated to the palletspace with the lowest distance (to obtain this, the solution would choose the port accordingly, I imagine)
My parameters are:
- SL denoting shop labels (i)
- PL denoting port labels (j)
- PSL denoting palletspace labels (l)
- A_i denoting the arrival times for a shop to a port (same no matter which port)
- D_jl denoting the distance from port j to palletspace l
- S =range(0, len(SL)
- P =range(0, len(PL)
- PS =range(0, len(PSL)
Variables: x_ijl = 1 if shop i is using pallet space l through port j y_ij = 1 if shop i is using port j
Now for the constraint I imagine it could be formulated as such: If A_i <= A_k, forall i in S, forall k in S Then x_ijl must be assigned to the pallet space with the lowest distance which isn’t already used by another shop (I have a constraint which ensures that one palletspace can’t be used by another).
So maybe something like: If A_i <= A_k, then x_ijl**distance_jl <= x_kjl*distance_jl
I don’t know guys, I’ve never wrote a linear program for this kind of if statement with multiple indexes…
I read this stack exchange post but I can’t adapt it to my problem… How to write if else statement in Linear programming?