• No results found

5.   AUTOMATION OF LAYOUT SELECTION FOR SPMS

5.1   Case-based reasoning for SPMs

5.1.2   Retrieval Cases

The task for the retrieval process in CBR is to search for matches between the target case and the cases in the case-base by using the generated code pattern in the indexing. The retrieval process can lead to a perfect match with the code pattern or to a partial match. In the case of a partial match, a threshold needs to be determined to refine the matched cases. A general approach for this process is given below:

The target case can be described as an attribute-code schema as follows:

< Target case >

For each attribute (j), a code (j) is determined and a code pattern is generated as:

Code pattern = [code (1) | code (2) | code (3) | ………. | cod (j)]

Each of these codes is compared with each case (i) in the case-base and the matched cases are retrieved. Therefore, the above retrieval approach can be revised as follows:

145 Determine how close the matched case (i) is

If matching > = threshold

Then add case (i) to the retrieved list Output list of retrieved cases

 End

The retrieval process for SPMs is divided into two levels. The first level involves retrieving a list of the most similar cases from the workpiece case-base to the target workpiece. The retrieval approach explained above was applied and a complete algorithm of the first level retrieval in this work was developed as shown in Figure 5-3.

146

147 Figure 5-3. A complete algorithm for the first level of the retrieval process for SPMs.

The matched cases are evaluated by the threshold. The cases that have values equal to or higher than the threshold are added to the Matched-case list. The threshold is considered in this algorithm to be a similarity measure to obtain the closest cases to the target case.

148 There are several approaches that have been applied to determine the threshold or the similarity measure in CBR. One of these approaches is calculating the similarity using the following equation [203]:

SIM (X,Y) 2 (1)

Where X is the target case, and Y is the old case, “count’ refers to the number of attributes that match between X and Y, and li is the length of each region consisting of two or more matches. As an example of this approach is considering the following workpiece attributes from Table 5-1 to be matched between X and Y:

Type of attributes: class shape size material number of machined surfaces Target case (X): flat plane small steel one

Old case (Y): cubic plane small steel two count: 0 1 1 1 0 = 3

In this method, 1 is given for the matched attributes and 0 is given for the unmatched attributes as shown above. By applying equation (1), the similarity measure is calculated as:

SIM (X,Y) = 3+23 = 11

The similarity measure for the old case (Y) in comparison to the target case (X) is 11, and the rest of the cases are evaluated in the same way. This is a good method if the attributes are coded as strings, but it is not suitable if an indexing (coding) system is used for the target and old cases, and some errors have been recorded while using this approach [200].

Another approach is using Euclidian distance which calculates the similarity measure by the following equation [198]:

SIM (X,Y) = 1- D(X,Y) = 1 - ∑ d xi, yi (2)

Where d is the distance between an attribute of the target case and the similar attributes of the old case. This method is more complicated than the previous one

149 and often requires assigning weights to the attributes; however, more accurate results have been achieved by using this method [198]. It is a very useful method when parameters such as diameter, length, or hardness are set to the attributes.

The approach that is most often used to define the similarity measure is the Hamming method, which uses the following equation [157]:

SIM (X,Y) =

(3)

Where nxy indicates the number of identical attributes between the target case and the old case, and n refers to the total number of attributes to be compared. It is a simple and appropriate method to be used in integration with the indexing system to calculate the similarity of the matched cases. Therefore, the Hamming approach was used in this work to define the threshold for the matched cases in the first level of the retrieval process using the following equation:

Threshold =

(4)

Where nm1 indicates the number of matched attributes in the first level, and nt

is the total number of compared attributes. In the first retrieval level, only the workpiece attributes are compared. By referring to Table 5-1, the value of nt is equal to 6, and the threshold ranges from 0.0 to 1.0 (0.0 for no match, and 1.0 for complete match). A value of >= 0.5 is set up to retrieve the closest cases from the matched cases. The closest cases are evaluated in the second retrieval level in order to find the optimum case with regard to the target case. At this level, the total similarity of the closest cases is calculated. For this purpose, equation (4) is modified as follows:

SIMt =

+ SIMHardness (5)

Where nm2 is the number of the matched attributes in the second level.

SIMHardness is the similarity degree of the hardness between the target case and the old case, and it is included in the equation because of the imporatnce of this

150 attribute in machining operations. The value of nt in equation (5) is equal to 13, which is the total number of attributes .The value of SIMHardness is calculated by applying a modified Euclidian distance equation, as follows [199]:

SIMHardness = 1 - D = 1 - (6)

By applying eqaution (5), the total similarity value is calculated for the retrieved cases, and the case with the highest value is considered to be the optimum case. The system then suggests the best solution for the SPM design, which is associated with the optimum case from the the SPM case-base. Figure 5-4 shows the algorithm that was developed in this work for the second level of the retrieval process, and the calculation of the total similarity SIMt for the retrieved cases from the first level to define the optimum case.

151

152 Figure 5-4. A complete algorithm for the second level of the retrieval process for SPMs

with a calculation of the total similarity value.