MCPcopy Create free account
hub / github.com/Gecode/gecode / JobShopBase

Method JobShopBase

examples/job-shop.cpp:280–295  ·  view source on GitHub ↗

Actual model

Source from the content-addressed store, hash-verified

278public:
279 /// Actual model
280 JobShopBase(const JobShopOptions& o)
281 : IntMinimizeScript(o), opt(o), spec(opt.instance()),
282 start(*this, spec.machines() * spec.jobs(), 0, spec.upper()),
283 makespan(*this, spec.lower(), spec.upper()) {
284 // Number of jobs and machines/steps
285 int n = spec.jobs(), m = spec.machines();
286 // Endtimes for each job
287 IntVarArgs end(*this, n, 0, spec.upper());
288
289 // Precedence constraints and makespan
290 for (int i=0; i<n; i++) {
291 for (int j=1; j<m; j++)
292 rel(*this, start[i*m+j-1] + spec.duration(i,j) <= start[i*m+j]);
293 rel(*this, start[i*m+m-1] + spec.duration(i,m-1) <= makespan);
294 }
295 }
296 /// Do not overload machines
297 void nooverload(void) {
298 // Number of jobs and machines/steps

Callers

nothing calls this directly

Calls 8

machinesMethod · 0.80
jobsMethod · 0.80
durationMethod · 0.80
instanceMethod · 0.60
relFunction · 0.50
upperMethod · 0.45
lowerMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected