Two OpMs are randomly chosen and their locations in the plan are exchanged.
Randomly generate a feasible plan (OpM1; OpM2; . . . ; OpMn), named as the current plan.
Begin from the initial temperature T = T0.
Generate a random change to the current-plan; assume temp-plan be the plan after the change.
Check to confirm that temp-plan is valid. Or else, go back to Step 2.1.
Determine the costs of current-plan as E1 and temp-plan as E2.
If E2 < E1
Let temp-plan be current-plan;//assume E2 as E1
Randomly generate X (0 < X < 1)
If x < e(E1 - E2)/T //if condition
Let temp-plan be current-plan;
Let current-plan remain unchanged;
Do again steps 2.1- 2.4 till termination criterion is satisfied.
Decrease the temperature to a new T.
Programme no.4: Implementation of SA Algorithm in Process Planning Problem