Something went wrong. Try again.
This repository has no description
Something went wrong. Try again.
3.6 kB · 101 lines
at develop
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102%------------------------------------------------------------------------------% Airport Check-in Counter Allocation Problem (ACCAP) with fixed opening/closing times%------------------------------------------------------------------------------% % Airports have certain number of check-in counters that can be used by any airlines(common-use% check-in counters) throughout the day. Airlines need to start and end the check-in operations% for their flights at given times before the departure time of the flights. Each flight has a% given time interval/duration (opDur) that they need to keep the check-in open, and this is% fixed for the whole duration of the check-in. Given the number of airlines, their flights% (FLIGHTS), starting time of each check-in (xCoor) ,required number of counters (cNum), and% duration of the check-in (opDur), the objective is to find such an allocation of flights% (check-ins) to counters (yCoor: starting counter ID ) to minimise the maximum used number of% counters throughout the day (D), as well as making sure that the flights of the same airlines% are clustered in the same check-in area by minimising the sum of the total distances (S)% between the counters of each pair of flights of the same airline (S).%%%------------------------------------------------------------------------------% Includesinclude "diffn.mzn";%------------------------------------------------------------------------------% Sets and indices% set of flightsint: flights;set of int: FLIGHT = 1..flights;% time intervalsint: times; set of int: TIME = 1..times;% set of counter IDsset of int: COUNTER = 1..sum(cNum);% set of airlinesint: airlines;set of int: AIRLINE = 1..airlines;% set of flights of airlinesarray[AIRLINE] of set of FLIGHT: FA; % set of steart-end check-in times of flightsarray[FLIGHT] of set of TIME: ISet = [ {k| k in xCoor[f]..(opDur[f] + xCoor[f] - 1)} | f in FLIGHT];%------------------------------------------------------------------------------% Variables and parametersarray[FLIGHT] of int: xCoor; %starting timearray[FLIGHT] of var COUNTER: yCoor; %lower-bottom corner of the rectangle (counter) : variablearray[FLIGHT] of int: opDur; %Length - opening Durationarray[FLIGHT] of int: cNum; %Height - required numebr of countersvar max(cNum)..((airlines + 1) * sum(cNum)): objective; %objective: variable% Distance between two flights :variablearray[AIRLINE] of var 0..sum(cNum): S; % Domain of D(maximum counter use) :variablevar max(cNum)..sum(cNum): D; %------------------------------------------------------------------------------% Constraints% C1: Non-overlapping constraintconstraint diffn(xCoor, yCoor, opDur, cNum); % C2: Capacity constraintconstraint forall(f in FLIGHT)( (yCoor[f] + cNum[f] - 1) <= D ); % C3: Distance constraintconstraint forall(a in AIRLINE, f, g in FA[a] where f != g)( ((yCoor[f] + cNum[f] - 1) - (yCoor[g]) <= S[a])); % C4: Objective functionconstraint objective = sum(a in AIRLINE)(S[a]) + D;%------------------------------------------------------------------------------% Solve itemsolve :: seq_search([ int_search(yCoor, first_fail, indomain_min, complete), int_search(S, first_fail, indomain_min, complete), int_search([D], input_order, indomain_min, complete) ]) minimize objective;%------------------------------------------------------------------------------% Outputoutput [ "yCoor = \(yCoor);\n", "S = \(S);\n", "D = \(D);\n", "objective = \(objective);\n"];