4 ms·
Several - My most recent was to manage dumbbell work outs. Problem: 1) I hated changing weights in the middle of a session 2) Wanted to manage progression
by sloaken 2y ago
Several -
My most recent was to manage dumbbell work outs.
Problem:
1) I hated changing weights in the middle of a session
2) Wanted to manage progression
Situation - I have 4 metal sets of dumbbell handles, a plastic set, some individual 3 - 5 pound pairs. A single, dial the weight dumbbell. Plates in metal range from 10 lbs to 0.25 lbs.
The SW:
1) using SQLite for DB
2) One application to calculate optimum weight settings - typical run takes 100 to 200 tries to get the best set.
3) Another application to present / track sessions. It was a BIG timer display to ensure I do not do the workout too fast (goal is 45 sec a set)
4) A tracking report.
Complexity issues:
Not all dumbbell handles weigh the same - even the tightening nuts vary. Solution was to weigh everything and pair up the nuts so that each dumbbell handle with nuts matched its pair - oh I color coded the metal dumbbell handles.
First algorithm took too long - my first version would calculate ALL combinations of all weights. Then select the optimal solution - before adding the 0.25, 0.5, 0.75 and 1 pound plates would take between 15 to 30 minutes to run. This was solved with a slightly more complex algorithm. I calculated the all combinations for each dumbbell. Merged those lists into a big list, Found the perfect setting for each exercise. Check for conflicts. When a conflict occurred, found the exercise with the least delta from optimal and changed it to the next weight setting.... Check for conflict. Now it takes no more than 20 sec and reports 100 to 200 times it hit conflict before solving.