• No se han encontrado resultados

6.5. ACTIVIDADES EDUCACIÓN AMBIENTAL Y VOLUNTARIADO

6.5.5. PRÁCTICAS

For the container rail scheduling problem, we first apply a simple pre-processing procedure to get rid of the model variables xt and ytj if there is no customer demand on timeslot t, the total demand on timeslot t is less than the minimum train loading P1, or there is a service restriction banning xt. After pre-processing constraints (3.8) can be removed as well.

Points in the search space correspond to a complete assignment of 0 or 1 to all decision variables. The search space is explored by a sequence of simple randomised moves which are influenced by the violated constraints at the current point.

CLS starts with an initial random assignment, in which some hard constraints in the model can be violated. In the iteration loop, the algorithm always selects a violated hard constraint at random, e.g. an assigned train timeslot for which the demands exceed train capacity or an assigned timeslot that is not consistent with a customer’s booking preferences.

Having selected a violated hard constraint, the algorithm randomly selects one variable in that constraint and another variable, either from the violated hard constraint or from the search space. Then two flip trials are performed in which the current value of the variable is changed to its complementary binary value. Suppose that Vi takes the value vi at the start of the iteration so that the current solution A=

(

v1,v2,...,vm |h

)

, where m is the total number of variables and h is the total violation of all hard constraints. Suppose further that V1,V2 are chosen and that their flipped values are v1, v2 respectively. We then look at the assignments A1 =

(

v1,v2,...,vm|h1

)

, A2 =

(

v1,v2,...,vm|h2

)

and select the alternative with the smaller total hard violation. This alternative becomes the new current point. It is noted that CLS selects the best alternative (A1 or A2) for a new current solution even if it is worse than A. The aim is to allow diversity in the search so that the search space may be fully explored. CLS terminates when a feasible solution A is found or when no improvement to the best total hard constraint violation found has been achieved for a specified number of iterations Z. The procedure of the basic CLS is outlined in Figure 4.1.

proc CLS

A ← initial random assignment h ← initial hard constraint violation if h= 0 then output A, exit CLS

terminate ← false try ← 0

while not terminate do

C:= select-violated-hard-constraint

( )

A P:= select-two-variables

(

C,A

)

A1, A2 := flip

(

A,P

)

try ← try +1

if

(

h1 <h2

)

then

(

AA1

)

if h1 <h then hh1 try ← 0

else

(

AA2

)

if h2 <h then hh2 try ← 0

end if

if h = 0 then output A, terminate ← true if try = Zthen terminate true

end while end proc

Figure 4.1: The basic CLS procedure

From Figure 4.1, in select-violated-hard-constraint, CLS randomly selects a constraint that is not satisfied by the current assignment, and then in select-two-variables, CLS randomly

selects one variable in that constraint and another variable, either from the violated hard constraint or from the search space to flip.

The principal goal of CLS is to find a complete assignment of values to variables which is consistent with all the hard constraints. This task is eased if partial consistency is maintained throughout the search. The approach taken in applying CLS to the container rail scheduling problem is to decompose it into a series of similar subproblems, each with the number, but not timing, of trains fixed in relation to the minimum train loading parameter P and 1 maintaining the coverage constraints (3.4). Thus consistency is maintained within each set of variables but enforced across different sets.

When CLS finds a feasible solution A, the refined-improvement procedure is called in an attempt to reduce the soft violation for the customer satisfaction constraint s2 ((3.13) in Section 3.4.2.1). The main concept of the refined-improvement procedure is to search more intensively on A by fixing the number and timing of trains. This is because it is expensive to maintain the consistency between the timeslot variables xt and the customer’s booking variables ytj if the train timetable is not fixed. In this procedure only feasible improving moves are allowed. Here, the refined-improvement does not try to reduce the soft violation for the timeslot-operating cost constraint s3 ((3.15) in Section 3.4.2.1) for the same reason as above; in addition, the variation in timeslot-operating cost is small. However, in Section 4.3.2, the artificial soft violation S* is introduced in an attempt to reduce the total soft violation whilst all hard constraints are still to be fully satisfied by CLS.

The refined-improvement procedure is:

Step 1 Record the soft violation s2 for A.

For each customer:

Step 2 Order the alternative, active timeslots for this customer in increasing order of satisfaction cost for this customer.

For each possible timeslot:

Step 3 Swap this customer with a customer currently served in this timeslot.

Step 4 If the new assignment is feasible and reduces the soft violation s2, replace A, s2. Repeat step 2 for the next customer, if any exist. If the new

assignment is not feasible or is feasible but does not reduce s2, repeat step 3 with the next customer if any exist served in this timeslot.

After the refined improvement is performed, the algorithm reduces the soft violation cost s1 ((3.11) in Section 3.4.2.1) by removing one train out of the current feasible solution. As a result, the problem is more constrained and the current solution becomes infeasible. The value of stopping criterion parameter Z is refreshed and CLS is called again to find a new feasible solution for the problem.