-
Notifications
You must be signed in to change notification settings - Fork 1
List of scheduling environments
This class serves to model a single machine scheduling problem.
Some of the attributes are mandatory and produce an error if not found when loading the instance file. Others are optional, but they may produce errors in some cases if missing (e.g. if due dates are ommitted, then due-date related criteria cannot be computed).
- Mandatory:
jobs
- number of jobspt
- processing times (a list containing the processing time of each job)
- Optional:
w
- weights. The weight of each job. If not specified, they are assumed to be 1.0r
- release dates. The earliest starting time of each job. If not specified, they are assumed to be 0dd
- due dates. The due date of each job. If not specified, they are assumed to be infinite
A typical instance is the following:
[PT=2,10,1,1]
[DD=11,13,13,14]
[W=2.0,1,1,2]
[R=0,0,0,0]
[JOBS=4]
A non-idle schedule for a single machine typically consists of providing an order (sequence) in which the jobs are processed in the machine, i.e.
solution = [3,2,0,1,4]
This class serves to model a (identical) parallel machine scheduling problem. Each job has to be processed in one machine. This is the Gantt chart produced with the instance in the sample and the solution in the solution encoding section.
Some of the attributes are mandatory and produce an error if not found when loading the instance file. Others are optional, but they may produce errors in some cases if missing (e.g. if due dates are ommitted, then due-date related criteria cannot be computed).
- Mandatory:
jobs
- number of jobspt
- processing times (a list containing the processing time of each job), which is the same in all machines
- Optional:
w
- weights. The weight of each job. If not specified, they are assumed to be 1.0r
- release dates. The earliest starting time of each job. If not specified, they are assumed to be 0dd
- due dates. The due date of each job. If not specified, they are assumed to be infinite
A typical instance is the following:
[PT=2,10,4,5,7,9,1,8]
[JOBS=8]
[MACHINES=3]
There are several possibilites for encoding a solution. Perhaps the easiest is to provide an order (sequence) in which the jobs enter the system and assign the job to the machine according to the ECT (Earliest Completion Time) rule, i.e. the job is allocated to the machine that finishes first. Ties are broken according to the index of the machine, so machines with lower index have higher priority for the allocation.
solution = [1, 5, 6, 2, 3, 4, 7, 0]
This class serves to model the permutation flowshop scheduling problem. Each job has to be processed in all machines in the same order. This is the Gantt chart produced with the instance in the sample and the solution in the solution encoding section.
Some of the attributes are mandatory and produce an error if not found when loading the instance file. Others are optional, but they may produce errors in some cases if missing (e.g. if due dates are ommitted, then due-date related criteria cannot be computed).
- Mandatory:
jobs
- number of jobspt
- processing times of each job on each machine. It is a list of lists, i.e. a list containing the processing times of all jobs on the machine, soinstance.pt[i][j]
indicates the processing times of jobj
on machinei
.
- Optional:
w
- weights. The weight of each job. If not specified, they are assumed to be 1.0r
- release dates. The earliest starting time of each job. If not specified, they are assumed to be 0dd
- due dates. The due date of each job. If not specified, they are assumed to be infinite
A typical instance is the following:
[JOBS=5]
[MACHINES=4]
[PT=10,2,12,1,8;8,3,14,1,5;1,5,10,7,12;9,1,4,20,4]
There are several possibilites for encoding a solution. Perhaps the easiest is to provide an order (sequence) in which the jobs enter the system and assign the job to the machine according to the ECT (Earliest Completion Time) rule, i.e. the job is allocated to the machine that finishes first. Ties are broken according to the index of the machine, so machines with lower index have higher priority for the allocation.
solution = [0,1,4,3,2]
from scheptk.scheptk import FlowShop
instance = FlowShop("test_flowshop.txt")
sequence = [0,1,4,3,2]
instance.print_schedule(sequence)
makespan = instance.Cmax(sequence)
This class serves to model the jobshop scheduling problem. Each job has to be processed in all machines in an order given by a routing matrix. This is the Gantt chart produced with the instance in the sample and the solution in the solution encoding section.
Some of the attributes are mandatory and produce an error if not found when loading the instance file. Others are optional, but they may produce errors in some cases if missing (e.g. if due dates are ommitted, then due-date related criteria cannot be computed).
- Mandatory:
jobs
- number of jobspt
- processing times of each job on each machine. It is a list of lists, i.e. a list containing the processing times of all jobs on the machine, soinstance.pt[i][j]
indicates the processing times of jobj
on machinei
.rt
- routing matrix. It is a list of lists, i.e. a list containing the routing of each jobs across the machines, soinstance.rt[j]
indicates the routing of jobj
, i.e. a list of the machines to be visited by the job soinstance.rt[j][i]
indicates the machine to be visited by jobj
in the i-th order.
- Optional:
w
- weights. The weight of each job. If not specified, they are assumed to be 1.0r
- release dates. The earliest starting time of each job. If not specified, they are assumed to be 0dd
- due dates. The due date of each job. If not specified, they are assumed to be infinite
A typical instance is the following:
[JOBS=5]
[MACHINES=4]
[PT=31,19,23,13,33;41,55,42,22,5;25,3,27,14,57;30,34,6,13,19]
[RT=0,1,2,3;3,1,0,2;2,0,1,3;1,3,2,0;3,0,2,1]
[DD=300,0,0,0,0]
[R=0,0,0,0,0]
There are several possibilites for encoding a solution in a Job Shop. Perhaps the easiest is to provide an extended sequence where the jobs iteratively are assigned to the corresponding machine in their routing. solution =[4, 4, 3, 1, 1, 3, 1, 4, 1, 3, 2, 0, 4, 2, 2, 2, 0, 0, 0, 3]
indicates that first job 4 is assigned to its first machine in its routing matrix, then job 4 is assigned to its second machine, then job 3 is assigned to its first job, etc.
from scheptk.scheptk import JobShop
instance = JobShop('test_jobshop.txt')
sol = [4, 4, 3, 1, 1, 3, 1, 4, 1, 3, 2, 0, 4, 2, 2, 2, 0, 0, 0, 3]
print(sol)
print('Cmax={}'.format(instancia.Cmax(sol)))
print('SumCj={}'.format(instancia.SumCj(sol)))
instance.write_schedule(sol, 'jobshop.sch')
instance.print_schedule(sol, '..\\documentation\\images\\jobshop_sample.png')