Commit 46be959f authored by Yoann Pigné's avatar Yoann Pigné

copyValueTo should actually copy values to the attribute given in paramater,...

copyValueTo should actually copy values to the attribute given in paramater, not to the centralityAttribute.
parent 78d362af
......@@ -144,7 +144,7 @@ public abstract class AbstractCentrality implements Algorithm {
for (int idx = 0; idx < count; idx++)
s += data[idx];
for (int idx = 0; idx < count; idx++)
graph.getNode(idx).setAttribute(centralityAttribute,
graph.getNode(idx).setAttribute(attribute,
data[idx] / s);
break;
......@@ -158,14 +158,14 @@ public abstract class AbstractCentrality implements Algorithm {
}
for (int idx = 0; idx < count; idx++) {
graph.getNode(idx).setAttribute(centralityAttribute,
graph.getNode(idx).setAttribute(attribute,
(data[idx] - min) / (max - min));
}
break;
case NONE:
for (int idx = 0; idx < count; idx++)
graph.getNode(idx).setAttribute(centralityAttribute, data[idx]);
graph.getNode(idx).setAttribute(attribute, data[idx]);
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment