You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
https://github.com/samitch/SpokeDartsPublic/blob/ab8348c4aa624c02e01a79271a702b50488d26d1/source/MPS_Spoke.cpp#L94
This line
size_t loop_count(0), outer_loop_count(0);
inMPS_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
ofmps
class as these variables are used in both member methodsvoid MPS::output_results()
andreport_darts(*perf_out, _loop_count);
ofmps
class.So in the current situation
_loop_count
will not be change as it was not used insideMPS_Spoke
class so it will zero and consequentlynumber of thrown spokes
declared insidereport_darts(*perf_out, _loop_count);
method will equal Zero.In the same way, in this line
size_t next_report = _loop_count-1;
invoid MPS::output_results()
will overflow as_loop_count-1
will produces negative value andnext_report
is of typesize_t
. This will cause a problem in thereport(_loop_count, next_report);
method as this conditionif (loop_count > next_report)
will not be satisfied. Consequently, the time for the last loops will not be consider for_main_time
The text was updated successfully, but these errors were encountered: