mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-28 04:27:20 +02:00
Burndown Chart
- Added debug output showing calculations. - Made the bias configurable, defaulting to 0.666. - Added 'burndown.bias' to the taskrc.5 man page.
This commit is contained in:
parent
42c0b33f07
commit
955634c35b
3 changed files with 28 additions and 10 deletions
|
@ -80,6 +80,7 @@ std::string Config::defaults =
|
|||
"recurrence.indicator=R # What to show as a task recurrence indicator\n"
|
||||
"recurrence.limit=1 # Number of future recurring pending tasks\n"
|
||||
"undo.style=side # Undo style - can be 'side', or 'diff'\n"
|
||||
"burndown.bias=0.666 # Weighted mean bias toward recent data\n"
|
||||
"\n"
|
||||
"# Dates\n"
|
||||
"dateformat=m/d/Y # Preferred input and display date format\n"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <iostream> // TODO Remove
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
|
@ -409,7 +408,6 @@ std::string Chart::render ()
|
|||
return "No matches.\n";
|
||||
|
||||
// Create a grid, folded into a string.
|
||||
// TODO Upgrade grid to a vector of strings, for simpler optimization.
|
||||
grid = "";
|
||||
for (int i = 0; i < height; ++i)
|
||||
grid += std::string (width, ' ') + "\n";
|
||||
|
@ -893,36 +891,45 @@ void Chart::calculateRates (std::vector <time_t>& sequence)
|
|||
float fix_rate_50 = 1.0 * total_removed_50 / half_days;
|
||||
float fix_rate_75 = 1.0 * total_removed_75 / quarter_days;
|
||||
|
||||
// TODO Make configurable.
|
||||
float bias = 0.666;
|
||||
// Make configurable.
|
||||
float bias = (float) context.config.getReal ("burndown.bias");
|
||||
|
||||
find_rate = (find_rate_50 * (1.0 - bias) + find_rate_75 * bias);
|
||||
fix_rate = (fix_rate_50 * (1.0 - bias) + fix_rate_75 * bias);
|
||||
|
||||
// find rate = ((N added / N days) + 2 * (N added / N days)) / 3.0
|
||||
// fix rate = ((N removed / N days) + 2 * (N removed / N days)) / 3.0
|
||||
// Q: Why is this equation written out as a debug message?
|
||||
// A: People are going to want to know how the rates and the completion date
|
||||
// are calculated. This may also help debugging.
|
||||
std::stringstream rates;
|
||||
rates << "Chart::calculateRates find rate: "
|
||||
<< "("
|
||||
<< total_added_50
|
||||
<< " added / "
|
||||
<< half_days
|
||||
<< " days) + 2 * ("
|
||||
<< " days) * (1.0 - "
|
||||
<< bias
|
||||
<< ") + ("
|
||||
<< total_added_75
|
||||
<< " added / "
|
||||
<< quarter_days
|
||||
<< " days)) / 3.0 = "
|
||||
<< " days) * "
|
||||
<< bias
|
||||
<< ") = "
|
||||
<< find_rate
|
||||
<< "\nChart::calculateRates fix rate: "
|
||||
<< "("
|
||||
<< total_removed_50
|
||||
<< " removed / "
|
||||
<< half_days
|
||||
<< " days) + 2 * ("
|
||||
<< " days) * (1.0 - "
|
||||
<< bias
|
||||
<< ") + ("
|
||||
<< total_removed_75
|
||||
<< " added / "
|
||||
<< quarter_days
|
||||
<< " days)) / 3.0 = "
|
||||
<< " days) * "
|
||||
<< bias
|
||||
<< ") = "
|
||||
<< fix_rate;
|
||||
context.debug (rates.str ());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue