Skip to content
Snippets Groups Projects
Commit 8cfb2b41 authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix union.

parent cd0b5d4a
No related branches found
No related tags found
1 merge request!6Resource reuse
......@@ -98,7 +98,7 @@ float queue_task_overlap ( struct qsched *s , qsched_task_t a , qsched_task_t b
/* Return the Jaccard similarity, i.e. the ratio of the intersection
and the union. */
return ((float)res_isect) / res_union;
return ((float)res_isect) / (res_union - res_isect);
}
......@@ -159,6 +159,7 @@ int queue_get ( struct queue *q , struct qsched *s , int insist , int last ) {
if (qsched_locktask(s, window[ind_max].tid)) {
tid = window[ind_max].tid;
ind = window[ind_max].ind;
// message("best task has overlap %f.", window[ind_max].score);
break;
} else {
window[ind_max].ind = k;
......@@ -177,6 +178,7 @@ int queue_get ( struct queue *q , struct qsched *s , int insist , int last ) {
if (qsched_locktask(s, window[ind_max].tid)) {
tid = window[ind_max].tid;
ind = window[ind_max].ind;
// message("best task has overlap %f.", window[ind_max].score);
break;
} else {
window_count -= 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment