Versions Compared

Key

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

Quick note 1: the data input format for MiniZinc model is, in general, dictated by the model. Therefore, we cannot use a generic interface such as JSON or YAML.

Quick note 2: depending on the MiniZinc version, we can describe enpty matrices like "M = []". On version 2.2.1, we have to build an empty matrices explicitly: "M = array2d(0..0, 1..10, [])". The dimensions must agree with the model. So, for example, if you have in the model file:

Code Block
int: numElements;int: numAttributes;
array[1..numElements, 1..numAttributes] of int: attributes;

but we have no attributes, the data file should look like this:

Code Block
numElements = 4;
numAttributes = 0;

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

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

Note that you may use a simpler syntax in other MiniZinc versions.


Code Block
5; 
maxTime = 5; 
numLoaders = 1; 
noConflict = [| true , true , true , true , true
 | true , true , true , true , true
 | false , true , false , true , false
 | false , false , false , false , false
 | true , false , true , false , true
 |];
slotCapacity = [5, 5, 5, 5, 5]; 
loaderCapacity = [| 
5, 5, 5, 5, 5 
|];


numAttributes = 0;
attributesRange = [];
attributes = [];
attributeConcurrencyLimit = [];

...