Skip to content

Instantly share code, notes, and snippets.

@Dekker1
Created July 11, 2022 00:27
Show Gist options
  • Save Dekker1/0336083418f5ca615cab4d2618dc532a to your computer and use it in GitHub Desktop.
Save Dekker1/0336083418f5ca615cab4d2618dc532a to your computer and use it in GitHub Desktop.
Example of Gantt visualisations in the MiniZinc standard library
include "output/gantt.mzn";
include "ide/vis.mzn";
set of int: Tasks = 1..10;
array[Tasks] of var 1..1440: start;
array[Tasks] of int: dur = [35 | i in Tasks];
constraint forall(i,j in Tasks where i > j) (if i mod 2 == 0 then start[i] + dur[i] < start[j] else start[i] + 16 < start[j] endif);
output [ show_gantt(start, dur) ];
constraint vis_gantt(start, dur);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment