• 沒有找到結果。

CHAPTER 3 Problem Definitions

3.4 Scheduling with Mold Constraints

In real applications, machines need to be mounted with some molds to be able to process jobs. This thesis thus considers the scheduling problems with mold constraints.

The mold setup time is considered in two situations: (1) a machine loads its first job with a start mold; (2) molds change when jobs with different mold requirement are consecutively executed.. Therefore, the makespan of a schedule will increase when the

molds installed on machines are changed often. For simplicity, the setup time is assumed to be a constant in this thesis. But arbitrary setup times for different modes can also be easily handled. Below, an example is given to illustrate the mold constraints.

Example 3.5. Five jobs are to be assigned on three machines, and the molds used

by the jobs are shown in Table 3.5. Besides, assume that the molds can be installed on each machine. Job 3 can use molds 1 or 2 for processing, and job 5 can use molds 3 or 4.

Different mold selection strategies for two scheduling results are presented in Figure 3.5, where s stands for setup time and a job is denoted by a job-mold pair which means that a specific mold is used by a job. For instance, job 1 assigned on machine A using mold 1 is denoted as 1-1 following a setup time in Figure 3.5(a).

Assume that the setup time is given as 3 time units in this example. Each machine needs a setup time for installing the mold used by the first job. Since job 5 using mold 4 on machine C is different from job 4 using mold 3, a setup time for mold change is required in Figure 3.5(a). Therefore, the makespan of the scheduling result in Figure 3.5(a) is L = LC = 13. On the other hand, the makespan is L = LB = 11 when job 5 uses mold 3. There is no additional setup time needed for arranging job 5 to machine C in Figure 3.5(b). Therefore, to reduce the makespan, the setup time required on machines

needs to take as little as possible. That means, the frequency for mold change needs to be as small as possible.

Table 3.5 Five jobs and the used molds in Example 3.5

Job 1 2 3 4 5

Processing Time 6 3 5 4 3

Mold 1 2 1, 2 3 3, 4

Figure 3.5 Scheduling results with different mold selections in Example 3.5

As mentioned above, to reduce the makespan of the scheduling task, the cost of setup time on a machine should be as little as possible. Therefore, the mold selection for a job is important. Since the setup time is considered in this study, the lower bound of the makespan L in a feasible schedule is modified as:

𝐿 ≥∑𝑖∈𝑀𝐿𝑖 + 𝑠 ∗ 𝑚

𝑚 =∑𝑖∈𝑀𝐿𝑖 𝑚 + 𝑠.

The reason is that at least one setup time is required for installing the mold for the first job on each machine.

CHAPTER 4

The Proposed Algorithm

To deal with the scheduling problem as defined in Chapter 3. A GA-based algorithm is introduced in this chapter to find the optimal makespan on parallel machines while considering mold constraint. The mold constraint in this study is that each job can be processed by one of a set of specified molds on a machine and each type of mold has a given number of quantities. Besides, molds can only be installed on the specified machines, and the setup time is needed when the first job starts on a machine, or a job assigned on a machine when the installed mold is not matched with it. The setup time here is assumed the same for simplicity.

The proposed GA-based scheduling algorithm is described in this section to solve the scheduling problem where a set of non-preemptive jobs and a set of machines with a set of molds are given to find the minimum for the completion time of each machine.

The processing time of each job is assigned respectively, and it is the same while processing on each of the machines. The mold constraints and setup time mentioned above are also given. Therefore, the goal of the algorithm is to find the minimum makespan defined in Chapter 3.

4.1 Chromosome Presentation

To present a possible solution in our GA-based algorithm, the encoded schema adopted in this study is shown in Figure 4.1. A possible solution is encoded as a chromosome with n gens, n is the number of jobs for scheduling, and each gene includes a triple of a job ji, a machine ki, and a mold mi, where i =1 to n. A gene of a chromosome stands for job ji which uses the mold mi being processed on a machine ki, where ji  J. Since a set of adoptable molds for each job are given as the mold constraints, the mold in each gene must be one of the adoptable molds for job ji, that is mi  H(i). Besides, jobs are assigned to machines according to the load of machines,

and the machine with the lowest load is assigned jobs first. An example is given below for demonstrating the adopted encoding schema.

Figure 4.1 The encoding schema

Example 4.1. Assume that there is a set of five jobs and a set of three machines, and

four kinds of molds are given for scheduling. Also assume that the number of each kind of mold is one. The chromosome shown in Figure 4.2 presents job 3 uses mold 2 on

machine A, and job 5 uses mold 1 on machine B, and so on.

Figure 4.2 The representation of the chromosome in Example 4.1

As the scheduling assignment encoded by the chromosome, the processing order of the jobs is job 3, job 5, job 1, job 4 and job 2. The scheduling result is shown in Figure 4.3 for the above chromosome. The first three jobs, job 3, job 5 and job 1, are assigned to machine A, machine B and machine C respectively in alphabetical order, and setup time is needed on each machine. Since the load of machine B is lowest when it turns to job 4 to be assigned, job 4 is then assigned to machine B. job 2 is processed on machine C which has the lowest load in turn to job 2. An additional setup time is needed between job 1 and job 2 on machine C, since they use different molds.

Figure 4.3 The scheduling result in Example 4.1

4.2 Initialization

The first set of feasible solutions is required for updating during the evolution processes of a GA-based algorithm. Therefore, a set of chromosomes are randomly generated according to the above encoding schema, and each chromosome is mapped to be a corresponding possible schedule. The set of the n given jobs are randomly assigned to n genes of a chromosome, and the mold of each gene is randomly picked from the adoptable molds of respective jobs. No genes are assigned to the same job. The initially generated p chromosomes are formed as the initial population, where p is the defined size of a population. The method of generating chromosomes for a population is introduced as follows.

The chromosome generating procedure

INPUT: A set of n jobs with processing times and their adoptable molds, a set of m

machines, a set of h molds with given amounts.

OUTPUT: A set of p chromosomes, where p is the size of the population.

STEP 1: Set i = 1, where i is an index of the i-th chromosome with n genes being generated.

STEP 2: Set q = 1, where q is an index of the q-th gene with the triple of job, machine,

and mold, jq-kq-mq, being generated.

STEP 3: Randomly select a job r from the given set J of jobs, r  J, and let jq = r.

STEP 4: Set t is the machine with the lowest loading, t  M. Let kq = t. If the lowest

loading is kept by multiple machines, then t is set in alphabetical order.

STEP 5: Randomly select a mold s from the given set of molds adoptable to job r, s 

H(r), and let mq= s.

STEP 6: If q = n, then go to next step; otherwise, set q = q + 1, and return to STEP 3.

STEP 7: Check if the contradiction about mold constraint happens, then the adjustment operator introduced in Section 4.3 is executed.

STEP 8: If i = p, then stop the generating processes and output the n generated chromosomes; otherwise, set i = i + 1, and return to STEP 3.

4.3 Contradiction Avoidance

4.3.1 The contradictions with mold constraints

To keep chromosomes away from violation of the given mold constraints when new chromosomes are generated at initialization, or at reproduction, by executing the genetic operators, some contradictions may be found when mold constraints are considered. Therefore, the chromosome tuning operators is adopted to adjust the

may happen on a chromosome, and they are (1) the mold assigned to a job in a chromosome cannot be installed on the machine that processes the job; (2) the number of a mold is not enough to install on the machines that process the jobs using the same mold. Example 4.2 is given below to demonstrate these two contradictions.

Example 4.1. Assume the mold constraints are given as Table 4.1, Table 4.2 and

Table 4.3. The adoptable molds for respective jobs are given in Table 4.1. In Table 4.2, the molds installed on respective machines are shown. The number of each mold can then be found in Table 4.3. Also assume that a chromosome, 1A4-3B2-2C1-4A1-5C1, is generated from the chromosome generating procedure in Section 4.3. And this chromosome represents the scheduling result which is shown in Figure 4.4.

Table 4.1 Jobs and their adoptable molds in Example 4.2

Job 1 2 3 4 5

Time 4 4 8 10 3

Molds 3, 4 1, 2 2 1 1, 2, 4

Table 4.2 The molds for each machine in Example 4.2

Machine A B C

Molds 1, 3 2, 3 1, 4

Table 4.3 The number of molds in Example 4.3

Mold 1 2 3 4

The number

of molds 1 3 2 1

There are two contradictions being observed from in Figure 4.4. One is the first gene 1A4 of the chromosome, job 1 using mold 4 on machine A, violates the given mold constraint, since mold 4 used by job1 cannot be installed on machine A. The other is both gene 4A1 and gene 5C1 need mold 1 at the same time but there is only one mold 1 according to Table 4.3.

Figure 4.4 The scheduling result violating the mold constraints

4.3.2 The adjustment operator for avoiding contradictions

The contradictions that illustrated in Section 4.4.1 could happen, when a chromosome is generated or it reproduces from the crossover operator and the mutation operator. To deal with the contradictions, an adjustment operator is proposed to avoid a chromosome violating the given mold constraints. The adjustment operator scans the genes of a chromosome one by one to check if they satisfy the given mold constraints. A gene is made of a triple, <j, k, m>, which means that job j is processed on machine k with mold m. Each gene is checked if job j with mold m is able to be processed on machine k. There are two situations for job j with mold m can be processed on machine k. The first is the used mold m cannot be installed on machine k, since mold m is not an adoptable mold of machine k. The second, the amount of the mold is not enough for installing on machines at the same time. In the proposed adjustment operator, the first situation is handled by replacing another suitable mold for the gene. After the first situation of contradictions is handled, if the contradictions are still found in the chromosome, the second situation is then dealt with. Another available machine that is suitable for job j is selected. If there are multiple choices of suitable machines, then find the lowest loading one.

The adjustment operator for avoiding contradiction

Input: A generated chromosome, C; the given mold constraints.

Output: A chromosome without violating the mold constraints.

STEP 1: Set C’= null, Tq1 = null, and Tq2 = null, where C’, Tq1 and Tq2 are temporal queues.

STEP 2: Pop a gene from C, and set the gene as g. The triple of the gene g is denoted as a triple <j, k, m>.

STEP 3: If the mold m of gene g is not adoptable to the assigned machine k, then push g to Tq1; otherwise, push g to C’.

STEP 4: If C is empty, then go to STEP 5; otherwise, go to STEP 2.

STEP 5: If Tq1 is empty, then go to STEP 7; otherwise, pop the a gene from Tq1 and

set the gene as g.

STEP 6: Select one of the suitable molds m’ of job j, where m’  H(j) ∩ M(k). The

mold m is then substituted by m’. If there is no suitable mold for job j, then push g to Tq2; otherwise, push g to C’. Go to STEP 5.

STEP 7: If Tq2 is empty, then go to STEP 9; otherwise, pop a gene from Tq2, and set the gene as g.

STEP 8: Select one of the available machine k’ that is suitable for job j. If there are multiple choices of suitable machines, then find the lowest loading one. Set

k = k’, and push g to C’. Go to STEP 7.

STEP 9: Set C = C’, and output the chromosome C.

4.3.3 An example of dealing with the contradictions

Example 4.2. Continue with Example 4.1, assume that the chromosome,

4A1-3B2-2C1-5C4-1B4, generated from the chromosome generating procedure in Section 4.3. In this example, we demonstrate the above chromosome is tuned by the proposed adjustment operator and output without violating the mold constraints.

STEP 1: Let C = 4A1-3B2-2C1-5C4-1B4, and set C’ = Tq1 = Tq2 = null.

STEP 2: Pop a gene from C, and set as g, that is g = 4A1.

STEP 3: Since gene g = 4A1 do not violate the mold constraints, it is then pushed to C’.

STEP 4: Since C is not empty, go to STEP 2.

STEP 2: Pop a gene from C, and set as g, that is g = 3B2.

STEP 3: Gene g = 3B2 do not violate the mold constraints, it is then pushed to C’.

Therefore, C’ = 4A1-3B2

STEP 4: Go to STEP 2, since C is not empty.

STEP 2: Pop a gene from C, and set as g, that is g = 2C1.

job 2 of gene g is 1. Job 2 cannot be processed on machine C by using mold 1. Therefore, gene g is then pushed into Tq1.

STEP 4: STEP 2 is executed while C is not empty.

STEP 2 to STEP 4 carry out three times until C is empty. C’ = 4A1-3B2-5C4 and Tq1

= 2C1-1B4.

STEP 5: Since Tq1 is not empty, then pop the first gene from Tq1 and set g = 2C1.

STEP 6: Since the alternative mold that is suitable to job 2 is mold 2, and mold 2 cannot installed on machine C. Therefore, gene g is pushed into Tq2. STEP 5 is then processed.

STEP 8: Change the machine of gene g to machine B, since the loading of machine B is the lowest and mold 1 is adopted by machine B. Therefore, gene g is

set as 2B1. No contradiction happens on g = 2B1, then g is pushed into C’.

C’ = 4A1-3B2-5C4-1C3-2B3.

STEP 7: Tq2 is empty, and then go to STEP 9.

STEP 9: Set C = C’ = 4A1-3B2-5C4-1C3-2B3, and output the chromosome C.

4.4 Crossover Operator

Crossover is a main evolution operator of the genetic algorithm. Two chromosomes are randomly selected to exchange their genes to generate two new offspring chromosomes for further evolving. In this study, the two-point crossover is adopted to mate for the exchanging genes of two chromosomes. In the two-point cross operator, each of the offspring chromosomes inherits half of the genes from each of parents. One offspring inherits the half of chromosome, from a-th gene to b-th gen, and the remaining part of the offspring's chromosome comes from the other parent's genes, whose jobs are different from those between a and b. The point a is randomly assigned from 1 to (n/2 + 1), and point b is decided by a, that is b = a + (n/2 – 1), where n is the number of genes in a chromosome. After new offsprings are generated, the adjustment operators are performed to tune them from violating the mold constraints. Example 4.3 is given below for present the cross operator adopted in this study.

Example 4.3. Assume that chromosome A and chromosome B are both randomly

selected from the population. These two chromosomes, shown in Figure 4.5, are chosen

to perform the two-crossover operator for generating new chromosomes as offsprings.

When the cross point a is set at 2 and n = 8, then the cross point b is 2 + (8 / 2 – 1) = 5.

In Figure 4.6(a), offspring 1 is generated by inheriting chromosome A's genes from 2-nd gene to 5-th gene, and the other genes come from chromosome B where the jobs are different from genes between gene 2 to gene 5 of chromosome A. In the same manner, the offspring mainly inherits from chromosome B and shown in Figure 4.6(b).

Figure 4.5 Two parent chromosomes of Example 4.3

Figure 4.6 The offspring chromosomes generated by crossover operator

4.5 Mutation Operator

The mutation operator is seen as the secondary evolution operator in this study for helping the GA-based algorithm escape from the trap of searching the local optimum.

Two mutation operators are adopted in this study: the reverse mutation operator and the swapping mutation operator. The details of these two mutation operators are described as follows.

a.

The reverse mutation operator

When the reverse mutation operator is performed, the order of genes in a chromosome is reversed, and a new chromosome is then outputted. This kind of mutation is a mass change for reordering genes in a chromosome. It may be performed once on a new chromosome as it is newly generated. In Figure 4.7, chromosome A' is generated by performing the reverse mutation operator on chromosome A.

Figure 4.7 A new chromosome generated by the reverse mutation

b.

The swapping mutation operator

The reverse mutation may be performed once on a new chromosome as it is newly generated. The swapping mutation is a minor change on a chromosome, and it swaps two genes of a chromosome with a certain probability. Figure 4.8 shows that chromosome A' is generated by performing the swapping mutation.

Figure 4.8 A new chromosome generated by the swapping mutation

After mutation operators are performed, the adjustment operators are then used for tuning the chromosomes violating the mold constraints.

4.6 Adjustment Operators for Improving the Makespan

Once a scheduling solution is outputted by genetic operators, the following adjustment can improve the makespan. The adjustment operators are adopted in this study for improving the fitness of chromosomes. They are considered as the process of genetic modification when chromosomes are randomly generated. Three improvements we considered to adjust the structure of scheduling results for the improvement of the makespan, such as the adjustment of job order, replacement of molds, and swapping machines, are addressed as follows. A simple example is given below to illustrate the scheduling problem found in this study.

Example 4.4. Assume a scheduling requirement to be solved is that five jobs are

assigned on three machines to process while using four molds. Table 4.3 shows the profiles of the ten jobs to be scheduled. The processing time and the using molds of each job are given in each column. For instance, to process Job 1 takes six units of time and requires a machine, which mounts with Mold 1 or Mold 3. Job 4 can only be processed by machines with Mold 3 and needs four units of processing time.

Table 4.3 Five jobs and the used molds in Example 4.4

Job 1 2 3 4 5

Processing Time 6 3 5 4 3

Mold 1,3 2,3 1,2 3 2,3,4

The molds vary in amount in this study. The numbers of the molds are shown in Table 4.4.

Table 4.4 The amount of each mold

Mold 1 2 3 4

Number of mold 1 2 2 1

Machines are unrelated here since each of them can be mounted with a specified

respectively. For instance, Machine A can use Mold 2 and Mold 3.

Table 4.5 The adoptable molds for each machine

Machine A B C

Adoptable

molds 2, 3 1, 3, 4 1, 2

The time every machine takes for completing its assigned jobs of a scheduling task is known as the makespan. When the setup time is given as three, a scheduling result for Example 4.4 is shown in Figure 4.9, and the makespan of the job assignment is 19.

Figure 4.9 The scheduling result for Example 4.4

4.6.1 Adjustment of job order

The higher the frequency of mold replacement that happens on a machine, the more set-up time is needed for installing the molds to fit the jobs. If jobs using the same

mold on a machine are not continuously processed, it will cost multiple set-up times for switching molds. Therefore, the jobs using the same mold on a machine that are shifted together to be processed continuously can improve the scheduling results.

Example 4.5 Continuing with Example 4.4, both of Jobs 5 and 4 use Mold 3 but

they are not processed continuously on Machine A, so that it needs the set-up time for installing Mold 3 twice. An improvement is taken that Job 4 is reordered from the last processing job following Job 5. The number of set-up times taken on Machine A is reduced from 3 to 2. The adjusted results are shown in Figure 4.10

Figure 4.10 The adjustment of the job order in Example 4.5.

Figure 4.10 The adjustment of the job order in Example 4.5.

相關文件