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

Support and add command options : --show-arg, --retry, --help, --score, --bench and --show-index #10

Merged
merged 9 commits into from
Jan 13, 2022

Conversation

GlaceCoding
Copy link
Contributor

@GlaceCoding GlaceCoding commented Dec 10, 2021

I improve this tester to be more convenient when we use for debug purpose, with --retry we can retry the last run with the same arguments.

I added a benchmarked system to store the lowest iteration number to compare between to build of push_swap. The score is only saved when we use --bench to allow readonly mode.

My Changes :

  • I added the following command options: --show-arg, --retry, --help, --score, --bench and --show-index.
USAGE
./push_swap_tester.sh [directory-to-push_swap] [stacksize 0R range] [nb_of_test] {options}

OPTIONS
  --show-arg	Display arguments after the number of instructions.
  --retry	Retry with same arguments during the last run or the specified run with --retry=[NUM].
  --score	Show the score of the current entries, useful to compare output of two differents push_swap algo.
  --bench	Use with --score: Save the score in push_swap_benchmark.log, if is a new record or a new entries.
  --show-index	Display sorted index of each arguments, the index is the offset position when the list is sorted.
  --help/-h	Show this message.
  • If we got a KO or an error, we displayed the arguments (can be --quiet).
  • I used .log extension instead of .txt (the rules *.log in .gitignore is more convenient).

Display arguments after the number of instructions.
@GlaceCoding
Copy link
Contributor Author

GlaceCoding commented Dec 10, 2021

A screenshot of my change :

image

Retry with same arguments during the last run or the specified run with --retry=[NUM]
These commands can be used to compare 2 different pushs_swap algo/build.
Because 4 2 and 5 2 is the same thing for push_swap, I use the index (=offset position when sorted) instead of the real value.
n0 n1
5  2
4  1
@GlaceCoding
Copy link
Contributor Author

I added --quiet and --rewrite-bench

USAGE
./push_swap_tester.sh [directory-to-push_swap] [stacksize 0R range] [nb_of_test] {options}

OPTIONS
  --show-arg    Display arguments after the number of instructions.
  --quiet       Don't display arguments if the tester catch an error.
  --retry       Retry with same arguments during the last run or the specified run with --retry=[NUM].
  --score       Show the score of the current entries, useful to compare output of two differents push_swap algo.
  --bench       Use with --score, save the score in push_swap_benchmark.log, if is a new record or a new entries.
                Use --rewrite-bench to erase saved score by the current score.
  --show-index  Display sorted index of each arguments, the index is the offset position when the list is sorted.
  --help/-h     Show this message.

@GlaceCoding
Copy link
Contributor Author

@lmalki-h I don't know if you Watch your repo to get a notification 🤔

Do not hesitate to let me know if I need to make a change on my PR

@louisabricot louisabricot merged commit beadb1c into louisabricot:main Jan 13, 2022
@louisabricot
Copy link
Owner

Sorry, I don't get any notification somehow.. I'll have a look a this repo very soon, what you did looks awesome!

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

Successfully merging this pull request may close these issues.

None yet

2 participants