//MANAGEMENT
}
protected void mergeParallelEdges(EdgeDraftImpl[] sources, EdgeDraftImpl dest) {
EdgeWeightMergeStrategy mergeStrategy = parameters.getEdgesMergeStrategy();
int count = 1 + sources.length;
double sum = dest.getWeight();
double min = dest.getWeight();
double max = dest.getWeight();
for (EdgeDraftImpl edge : sources) {
sum += edge.getWeight();
min = Math.min(min, edge.getWeight());
max = Math.max(max, edge.getWeight());
}
double result = dest.getWeight();
if (mergeStrategy.equals(EdgeWeightMergeStrategy.AVG)) {
result = sum / count;
} else if (mergeStrategy.equals(EdgeWeightMergeStrategy.MAX)) {
result = max;
} else if (mergeStrategy.equals(EdgeWeightMergeStrategy.MIN)) {
result = min;
} else if (mergeStrategy.equals(EdgeWeightMergeStrategy.SUM)) {
result = sum;
}
dest.setWeight(result);
}