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

Incorrect Main time calculation and number of thrown darts for line spoke method #1

Open
AhmedElbossily opened this issue Sep 2, 2019 · 1 comment

Comments

@AhmedElbossily
Copy link

https://github.com/samitch/SpokeDartsPublic/blob/ab8348c4aa624c02e01a79271a702b50488d26d1/source/MPS_Spoke.cpp#L94

This line size_t loop_count(0), outer_loop_count(0); in MPS_Spoke.cpp file causes incorrect Main time calculation and produces wrong number of thrown darts in case of using line spoke method.

These variables size_t loop_count(0), outer_loop_count(0); should be replaced with Protected member variables _loop_count, _outer_loop_count of mps class as these variables are used in both member methods void MPS::output_results() and report_darts(*perf_out, _loop_count); of mps class.

So in the current situation _loop_count will not be change as it was not used inside MPS_Spoke class so it will zero and consequently number of thrown spokes declared inside report_darts(*perf_out, _loop_count); method will equal Zero.

In the same way, in this line size_t next_report = _loop_count-1; in void MPS::output_results() will overflow as _loop_count-1 will produces negative value and next_report is of type size_t. This will cause a problem in the report(_loop_count, next_report); method as this condition if (loop_count > next_report) will not be satisfied. Consequently, the time for the last loops will not be consider for _main_time

@AhmedElbossily AhmedElbossily changed the title Incorrect Main time calculation and number of thrown darts Incorrect Main time calculation and number of thrown darts for line spoke method Sep 2, 2019
@samitch
Copy link
Collaborator

samitch commented Sep 9, 2019

Thanks so much! I'll get to this in about a month.

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