Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help in modifying your code for right shifting #2

Open
Akhilnandh opened this issue Oct 9, 2024 · 3 comments
Open

Help in modifying your code for right shifting #2

Akhilnandh opened this issue Oct 9, 2024 · 3 comments

Comments

@Akhilnandh
Copy link

Hi,

Do you know how to modify your code for right shifting:
Where, I already have a list with some clashes-job_wise (for eg, for a particular job, operation 3starting before operation 2) and so on. The right shifting operation should avoid machine wise and job wise clashes:

Eg
Job 1:
Operation 1 - Machine: 7, Start Time: [0, 0, 0], End Time: [49.65, 63.45, 71.72]
Operation 2 - Machine: 7, Start Time: [120.46, 153.93, 174.0], End Time: [191.26999999999998, 244.41000000000003, 276.28]
Operation 3 - Machine: 1, Start Time: [120.46, 153.93, 174.0], End Time: [140.22, 179.17, 202.54]
Job 2:
Operation 1 - Machine: 3, Start Time: [0, 0, 0], End Time: [348.02, 444.69, 502.69]
Operation 2 - Machine: 1, Start Time: [348.02, 444.69, 502.69], End Time: [409.87, 523.72, 592.03]
Operation 3 - Machine: 11, Start Time: [426.89, 545.48, 616.6300000000001], End Time: [435.4, 556.36, 628.9300000000002]
Operation 4 - Machine: 2, Start Time: [418.38, 534.6, 604.33], End Time: [474.35, 606.11, 685.17]
Job 4:
Operation 1 - Machine: 5, Start Time: [0, 0, 0], End Time: [89.23, 114.02, 128.89]
Operation 2 - Machine: 11, Start Time: [192.08999999999997, 245.46000000000004, 277.47], End Time: [243.51999999999995, 311.18000000000006, 351.76000000000005]
Operation 3 - Machine: 2, Start Time: [140.66, 179.74, 203.18], End Time: [159.86, 204.28, 230.92]
Operation 4 - Machine: 10, Start Time: [159.86, 204.28, 230.92], End Time: [183.09, 233.97, 264.48]
Operation 5 - Machine: 8, Start Time: [183.09, 233.97, 264.48], End Time: [216.45, 276.59, 312.66]
Job 3:
Operation 1 - Machine: 11, Start Time: [0, 0, 0], End Time: [11.0, 11.0, 11.0]
Operation 2 - Machine: 4, Start Time: [17.362573615775315, 17.362573615775315, 17.362573615775315], End Time: [52.10257361577531, 61.75257361577532, 67.54257361577531]
Operation 3 - Machine: 4, Start Time: [312.64, 399.47, 451.58], End Time: [579.64, 740.6300000000001, 837.24]
Job 5:
Operation 1 - Machine: 6, Start Time: [0, 0, 0], End Time: [84.93, 108.53, 122.68]
Operation 2 - Machine: 6, Start Time: [134.72, 172.15, 194.6], End Time: [184.51, 235.77, 266.52]

Particularly i want to modify this function

def time_allocate(self, machine_arranged, current_machine, job_arranged, current_product, possible_begin_time,current_process_time, complete_arranged, k,i):
#machine_arranged[current_machine] += [(possible_begin_time, possible_begin_time + current_process_time)]
#job_arranged[current_product] += [(possible_begin_time, possible_begin_time + current_process_time)]
#complete_arranged[k[i]] += [possible_begin_time, possible_begin_time + current_process_time]

    #machine_arranged[current_machine]+=[(possible_begin_time[0],possible_begin_time[0]+current_process_time[0]),(possible_begin_time[1],possible_begin_time[1]+current_process_time[1]),(possible_begin_time[2],possible_begin_time[2]+current_process_time[2])]
    #job_arranged[current_product]+=[(possible_begin_time[0],possible_begin_time[0]+current_process_time[0]),(possible_begin_time[1],possible_begin_time[1]+current_process_time[1]),(possible_begin_time[2],possible_begin_time[2]+current_process_time[2])]
    #complete_arranged[k[i]]=[(possible_begin_time[0], possible_begin_time[0] + current_process_time[0]), (possible_begin_time[1], possible_begin_time[1] + current_process_time[1]),(possible_begin_time[2], possible_begin_time[2] + current_process_time[2])]
    machine_arranged[current_machine].append([[possible_begin_time[0],possible_begin_time[1],possible_begin_time[2]],[possible_begin_time[0]+current_process_time[0],possible_begin_time[1]+current_process_time[1],possible_begin_time[2] + current_process_time[2]]])
    job_arranged[current_product].append([[possible_begin_time[0],possible_begin_time[1],possible_begin_time[2]],[possible_begin_time[0]+current_process_time[0],possible_begin_time[1]+current_process_time[1],possible_begin_time[2] + current_process_time[2]]])
    complete_arranged[k[i]].append([[possible_begin_time[0],possible_begin_time[1],possible_begin_time[2]],[possible_begin_time[0]+current_process_time[0],possible_begin_time[1]+current_process_time[1],possible_begin_time[2] + current_process_time[2]]])
    return machine_arranged,job_arranged,complete_arranged
@Akhilnandh
Copy link
Author

The start time and end time and hence the processing for most operations are available. We need to begin from operation 1 and ensure job-wise and machine wise clashes are avoided. We have some clashes such as in operation Operation 1 - Machine: 5, Start Time: [0, 0, 0], End Time: [89.23, 114.02, 128.89]
Operation 2 - Machine: 11, Start Time: [192.08999999999997, 245.46000000000004, 277.47], End Time: [243.51999999999995, 311.18000000000006, 351.76000000000005]
Operation 3 - Machine: 2, Start Time: [140.66, 179.74, 203.18], End Time: [159.86, 204.28, 230.92]
Operation 4 - Machine: 10, Start Time: [159.86, 204.28, 230.92], End Time: [183.09, 233.97, 264.48]
Operation 5 - Machine: 8, Start Time: [183.09, 233.97, 264.48], End Time: [216.45, 276.59, 312.66]

@Akhilnandh
Copy link
Author

Some help in modifying your code will be useful

@Barbale98
Copy link
Owner

I don’t think I understand your problem. What do you mean with right shifting? How do you want to create a schedule? My code takes in input data about processing times that you have to put in the excel spreadsheets. Then you probably want to use some dispatching rules?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants