Add the AMPL model from the introduction
This commit is contained in:
parent
a35f42b456
commit
3a623816c8
16
assets/misc/intro_open_shop.mod
Normal file
16
assets/misc/intro_open_shop.mod
Normal file
@ -0,0 +1,16 @@
|
||||
param Machines integer > 0;@\Vlabel{line:intro:param:start}@
|
||||
param Jobs integer > 0;
|
||||
param Duration {1..Machines, 1..Jobs};@\Vlabel{line:intro:param:end}@
|
||||
|
||||
var start {1..Machines, 1..Jobs} integer >= 0;@\Vlabel{line:intro:var:start}@
|
||||
var end_time integer >= 0;@\Vlabel{line:intro:var:end}@
|
||||
|
||||
minimize goal: end_time;@\Vlabel{line:intro:goal}@
|
||||
subject to job_exclusive {m in 1..Machines, j1 in 1..Jobs, j2 in j1+1..Jobs}:@\Vlabel{line:intro:con:start}@
|
||||
start[m,j1] + Duration[m,j1] <= start[m,j2]
|
||||
or start[m,j2] + Duration[m,j2] <= start[m,j1];
|
||||
subject to machine_exclusive {j in 1..Jobs, m1 in 1..Machines, m2 in m1+1..Machines}:
|
||||
start[m1,j] + Duration[m1,j] <= start[m2,j]
|
||||
or start[m2,j] + Duration[m2,j] <= start[m1,j];
|
||||
subject to push_end_time {m in 1..Machines, j in 1..Jobs}:
|
||||
start[m,j] + Duration[m,j] <= end_time;@\Vlabel{line:intro:con:end}@
|
Reference in New Issue
Block a user