-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstance_dense.m
More file actions
27 lines (23 loc) · 937 Bytes
/
instance_dense.m
File metadata and controls
27 lines (23 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function [p_times, weights, release_times] = instance_dense(N, M, max_r, max_p, max_w)
% A function to generate a dense random instance of concurrent open
% shop; each job has uniform processing time on all machines, on [0,
% max_p].
%
% inputs:
% N = number of jobs
% M = number of machines
% max_r = maximum release time of any job
% max_p = maximum processing time of any job on a machine
% max_w = maximum weight of a job
%
% outputs:
% p_times = an M x N matrix; ijth entry is job j's time on machine i
% weights = a length-N vector of job weights
% release_times = a length-N vector of job release times
%Generate weights, release times and processing times uniformly on the
%interval. Weights are always non-zero.
weights = randi(max_w, N, 1);
%Without loss of generality, sort release times in non-decreasing order
release_times = sort(randi(max_r + 1, N, 1) - 1);
p_times = randi(max_p + 1, M, N) - 1;
end