Skip to content

Commit

Permalink
factoring age into recomendation algorithm, newer stuff has an advantage
Browse files Browse the repository at this point in the history
  • Loading branch information
revflash committed May 25, 2016
1 parent a01b04e commit f387795
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libraries/app/database_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,8 @@ vector<discussion> database_api::get_recommended_for( const string& u, uint32_t
const auto& c = vitr->comment(my->_db);
if( c.parent_author.size() == 0 && c.created > max_age && c.author != u && c.net_rshares > 0 )
{
stage[vitr->comment] += itr->rank * vitr->vote_percent;
auto agediscount = float((c.created - max_age).count())/fc::days(1).count();
stage[vitr->comment] += agediscount * itr->rank * vitr->vote_percent;
max_votes_per_peer--;
}
++vitr;
Expand Down

0 comments on commit f387795

Please sign in to comment.