-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
343e222
commit cb2c9a5
Showing
8 changed files
with
56 additions
and
111 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,40 @@ | ||
using LockPatternComplexity | ||
using ArgParse | ||
|
||
n = 4 # 2, 4, 6 | ||
N, xs, ys, ds = line_types(n) | ||
minizinc = "/home/jaan/bin/MiniZincIDE-2.5.5-bundle-linux-x86_64/bin/minizinc" | ||
cmd = `$minizinc src/nxn_gen.mzn | ||
-D "n=$n;N=$N;xs=$(string(xs));ys=$(string(ys));ds=$(string(ds));" | ||
--solver chuffed | ||
--statistics | ||
--all-solutions | ||
--two-pass` | ||
|
||
run(cmd) | ||
function data(n::Int) | ||
N, xs, ys, ds = line_types(n) | ||
return "n=$n;N=$N;xs=$(xs);ys=$(ys);ds=$(ds);" | ||
end | ||
|
||
function command(n::Int, minizinc, solver, flags)::Cmd | ||
d = data(n) | ||
return `$minizinc src/nxn.mzn -D $d --solver $solver $flags` | ||
end | ||
|
||
s = ArgParseSettings() | ||
|
||
@add_arg_table s begin | ||
"-n" | ||
help = "grid size" | ||
arg_type = Int | ||
default = 3 | ||
"--minizinc" | ||
help = "full path to MiniZinc. Use command `which minizinc` to find it out." | ||
arg_type = String | ||
default = "/home/jaan/bin/MiniZincIDE-2.5.5-bundle-linux-x86_64/bin/minizinc" | ||
end | ||
|
||
args = parse_args(s) | ||
n = args["n"] | ||
minizinc = args["minizinc"] | ||
|
||
function cmd(n) | ||
n == 2 && return command(2, minizinc, "gecode", ["--all-solutions", "--statistics"]) | ||
n == 3 && return command(3, minizinc, "gecode", ["--all-solutions", "--statistics"]) | ||
n == 4 && return command(4, minizinc, "chuffed", ["--all-solutions", "--statistics", "--two-pass"]) | ||
n == 5 && return command(5, minizinc, "chuffed", ["--all-solutions", "--statistics", "--two-pass"]) | ||
n == 6 && return command(6, minizinc, "chuffed", ["--all-solutions", "--statistics", "--two-pass"]) | ||
error("") | ||
end | ||
|
||
run(cmd(n)) |
This file contains 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
This file was deleted.
Oops, something went wrong.