Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
numElements = 3;
numLoaders = 1;
maxTime = 5;

noConflict = [|
  true  , true  , true  , true  , true
| true  , true  , true  , true  , true
| false , true  , false , true  , false
|];

elementSlotCapacity = [1, 2, 1, 3, 3];

% Since the (unique) loader has virtually
% infinity capacity, we assign the number
% of elements as capacity.
% We can also do:
% loaderCapacity = [|
% numElements, numElements, numElements, numElements, numElements
% |];
loaderCapacity = [|
 3, 3, 3, 3, 3
|];


numAttributes = 0;
attributesRange = [];

% attributes = []; does not work on version 2.2.1.
% We must built it explicitly
attributes = array2d(1..numElements, 1..numAttributes, []);

% attributeConcurrencyLimit = []; does not work on version 2.2.1.
% We must built it explicitly
attributeConcurrencyLimit = array2d(1..numAttributes, 1..maxTime, []);




This request will represent the information gathered by the Scheduler Optimizer to be passed to the Mini Zinc schedule optimizer engine.

...

  • numLoaders is 1 (scheduler)
  • loaderCapacity is unlimited (scheduler must be able to support the slotCapacity)
  • numAttributes, attributeRange, attributes and attributeConcurrencyLimit - From policy / templates.


To solve the problem, we use the following command line:

Code Block
$ minizinc --solver OSICBC --time-limit 60000 --soln-sep '' --search-complete-msg '' generic_attributes.mzn generic_attributes_3.dzn 

where:

  • --solver OSICBC: uses the Coin CBC solver, with is the preferable solver in the most cases. For cases it does not work, we recommend to use Google OR tools;
  • --time-limit 60000: 60 seconds of time limit. If the input is big, the solver may require more time to deploy a solution;
  • --soln-sep '': avoid to print "----" between solutions;
  • --search-complete-msg '': avoid to print "====" between solutions in the end.

This is the result output when using the command line (it may varies if using IDE):

Code Block
results:
  -
    num_scheduled: 3
    results:
 -
   num_scheduled: 0
   total_completion_time: 0
   element_slot_loader: |
     1,0,1
     2,0,1
     3,0,1
     4,0,1
     5,0,1
 -
   num_scheduled: 1
   total_completion_time: 2
   element_slot_loader: |
     1,0,1
     2,0,1
     3,2,1
     4,0,1
     5,0,1
 -
   num_scheduled: 4
   total_completion_time: 85
    element_slot_loader: |
      1,2,1
      2,1,1
      3,2,1
     4,0,1
     5,3,1
elapsed_millis: 3400

This request will represent the information returned to the Scheduler Optimizer from the Mini Zinc schedule optimizer engine.

Multiple "schedules" may be returned the objective being to schedule the most changes in the least amount of time. 


Other important notes: