- Fixed problem where urgency was not properly calculated for waiting tasks.
- Tweaked urgency coefficients to make most of the values closer together, and
  therefore more sensitive.
- Inverted 'waiting' coefficient.
- Boosted 'next', 'due' and 'blocking' coefficients.
- Modified unit tests accordingly.
- Lessened the impact of 'blocked', 'project', 'tags' and 'age'.
This commit is contained in:
Paul Beckingham 2012-02-26 23:13:15 -05:00
parent 9fb015f72c
commit 5feb736939
4 changed files with 115 additions and 98 deletions

View file

@ -136,17 +136,17 @@ std::string Config::_defaults =
"dependency.confirmation=on # Should dependency chain repair be confirmed?\n"
"\n"
"# Urgency Coefficients\n"
"urgency.next.coefficient=10.0 # Urgency coefficient for 'next' special tag\n"
"urgency.blocking.coefficient=9.0 # Urgency coefficient for blocking tasks\n"
"urgency.blocked.coefficient=-8.0 # Urgency coefficient for blocked tasks\n"
"urgency.due.coefficient=7.0 # Urgency coefficient for due dates\n"
"urgency.next.coefficient=15.0 # Urgency coefficient for 'next' special tag\n"
"urgency.due.coefficient=12.0 # Urgency coefficient for due dates\n"
"urgency.blocking.coefficient=8.0 # Urgency coefficient for blocking tasks\n"
"urgency.priority.coefficient=6.0 # Urgency coefficient for priorities\n"
"urgency.waiting.coefficient=5.0 # Urgency coefficient for waiting status\n"
"urgency.active.coefficient=4.0 # Urgency coefficient for active tasks\n"
"urgency.project.coefficient=3.0 # Urgency coefficient for projects\n"
"urgency.tags.coefficient=2.0 # Urgency coefficient for tags\n"
"urgency.age.coefficient=2.0 # Urgency coefficient for age\n"
"urgency.annotations.coefficient=1.0 # Urgency coefficient for annotations\n"
"urgency.age.coefficient=5.0 # Urgency coefficient for age\n"
"urgency.tags.coefficient=1.0 # Urgency coefficient for tags\n"
"urgency.project.coefficient=1.0 # Urgency coefficient for projects\n"
"urgency.blocked.coefficient=-5.0 # Urgency coefficient for blocked tasks\n"
"urgency.waiting.coefficient=-3.0 # Urgency coefficient for waiting status\n"
"urgency.age.max=365 # Maximum age in days\n"
"\n"
"#urgency.user.project.foo.coefficient=5.0 # Urgency coefficients for 'foo' project\n"

View file

@ -27,6 +27,7 @@
#define L10N // Localization complete.
//#include <iostream>
#include <sstream>
#include <stdlib.h>
#include <algorithm>
@ -1228,6 +1229,21 @@ float Task::urgency_c () const
value += urgency_blocking () * context.config.getReal ("urgency.blocking.coefficient");
value += urgency_age () * context.config.getReal ("urgency.age.coefficient");
/*
std::cout << "# Urgency for " << id << ":\n"
<< "# pri " << (urgency_priority () * context.config.getReal ("urgency.priority.coefficient"))
<< "# pro " << (urgency_project () * context.config.getReal ("urgency.project.coefficient"))
<< "# act " << (urgency_active () * context.config.getReal ("urgency.active.coefficient"))
<< "# wai " << (urgency_waiting () * context.config.getReal ("urgency.waiting.coefficient"))
<< "# blk " << (urgency_blocked () * context.config.getReal ("urgency.blocked.coefficient"))
<< "# ann " << (urgency_annotations () * context.config.getReal ("urgency.annotations.coefficient"))
<< "# tag " << (urgency_tags () * context.config.getReal ("urgency.tags.coefficient"))
<< "# nex " << (urgency_next () * context.config.getReal ("urgency.next.coefficient"))
<< "# due " << (urgency_due () * context.config.getReal ("urgency.due.coefficient"))
<< "# bkg " << (urgency_blocking () * context.config.getReal ("urgency.blocking.coefficient"))
<< "# age " << (urgency_age () * context.config.getReal ("urgency.age.coefficient"));
*/
// Tag- and project-specific coefficients.
std::vector <std::string> all;
context.config.all (all);
@ -1310,7 +1326,7 @@ float Task::urgency_active () const
////////////////////////////////////////////////////////////////////////////////
float Task::urgency_waiting () const
{
if (get ("status") == "pending")
if (get ("status") == "waiting")
return 1.0;
return 0.0;