Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command line interface for the solver #14

Open
Vlad-Shcherbina opened this issue Aug 8, 2015 · 5 comments
Open

Command line interface for the solver #14

Vlad-Shcherbina opened this issue Aug 8, 2015 · 5 comments
Assignees

Comments

@Vlad-Shcherbina
Copy link
Owner

The one that supports all the flags organizers require to support (like -p, -c and whatnot)

Obviously, requires a solver.
But it would be nice to have a skeleton in advance. One that parses all the flags and inputs, and outputs dummy solution (in the correct format and all).

@martignlo
Copy link
Collaborator

Committed first skeleton of the tool.

@martignlo
Copy link
Collaborator

The core is done.

I'm particularly concerned that print()s in the code can corrupt the output so I:

  • redirect stdout to stderr when the solver runs
  • added a script to make sure the output of the tool is valid json
$ production/play_icfp2015 | production/check_solution_is_well_formed

It should print nothing.

$ echo garbage | production/check_solution_is_well_formed

It should shout at you.

@martignlo
Copy link
Collaborator

To run it:

$ production/play_icfp2015 -f data/qualifier/problem_12.json -c 3 \
   -p "tsathoggua" -p "Yuggoth" 2> /tmp/out | production/golden/submit /dev/stdin

@martignlo
Copy link
Collaborator

To run the tool on all problems and with all power phrases:

$ production/run_play_icfp2015 2> /tmp/log

@martignlo
Copy link
Collaborator

To run all and submit:

$ production/run_play_icfp2015 2> /tmp/log | production/golden/submit /dev/stdin

The log contains at the end the scores and the total runtime. To see the runtime of each problem instance:

$ grep 'Problem.*solved' /tmp/log

Problematic runs have 0 score:

$ grep 'Problem:.*Seed:.* Score: 0' /tmp/log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants