Originally posted by: JMendes
Hi, thank you for your attention. I'll try to explain better:
My data is about flights. However, first of all I did a "leg generator", ie, getting the date and origin and destination of the flights, I create 3 vectors: the first vector means the actual leg (pair Origin-Destination of a flight). The second one, have all the subsequent flights that can happen by any plain. For example, the decision variable x(1,2,1) it means that after leg 1, its possible to fly leg 2 with the fleet type 1. The objective is to choose witch possibilities (x) are cheaper.
The decision variable is already code, like you suggested to me. My doubt is about to define the total cost, the number of spill passengers and the penalization cost per each spilled passenger, witch I'll use this variables in the objective function.
So, the idea of these variables are:
spill(l) = max(demand(l)-capacity;0) #number of spill passengers for leg l.
I cant do this in linear programming, so that's the reason that I spill the variable in 2 parts.
The spill variables are dived in two parts, the inbound legs (legs that the destination its my hub) and the spill for the outbound legs (legs that the origin are the hub): so, the formula of spill are:
spill(l in inbound legs) >= demand of each leg (proc_low(l in legs)) - capacity of aircraft all aircrafts (sum(f in Fleet)cap(f)) * sum(i in outbound legs) (x(i,l,f)*x(0,l,f))
Analogous for the spill(l in outbound legs).
The penalty cost it's easier... I've the input of penalty cost for 1 spilled passenger for all the Origin-Destination pairs... So, It's only to do spill(l)*penalty(l). Just need to check some assumptions before. like I've in the code.
For last, the cost is calculated by the fixed cost of assign the aircraft (cof(f)), plusthe variable cost per km of each aircraft (cov_km(f)), times the distance of the leg(dist(l)).
pass_in(l) it's just the name of the expression... like all the name_here(...):=
I've seen the forum here and the OPL examples... I've made the majority of the model, I just can't define these variables that depends of input data and decision variable x(leg_atual,leg_after,fleet)...
Thank you again! regards
#CPLEXOptimizers#DecisionOptimization