Created
July 11, 2022 00:27
-
-
Save Dekker1/0336083418f5ca615cab4d2618dc532a to your computer and use it in GitHub Desktop.
Example of Gantt visualisations in the MiniZinc standard library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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