Skip to content

Commit

Permalink
fixed DegreeModelComponent to work for directed networks
Browse files Browse the repository at this point in the history
  • Loading branch information
narnolddd committed Mar 7, 2023
1 parent 611ae1c commit 353861a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions feta/objectmodels/components/DegreeModelComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,20 @@ public void updateNormalisation(UndirectedNetwork net, HashSet<Integer> availabl
}
}

public void updateNormalisation(DirectedNetwork net, HashSet<Integer> availableNodes, int chosenNode) {
if (!random_) {
if (useInDegree_) {
tempConstant_ -= net.getInDegree(chosenNode);
} else {
tempConstant_ -= net.getOutDegree(chosenNode);
}
}
if (random_ || tempConstant_==0) {
random_=true;
tempConstant_=availableNodes.size();
}
}

public void calcNormalisation(UndirectedNetwork network, int [] removed) {
int degSum = 0;
for (int j : removed) {
Expand Down

0 comments on commit 353861a

Please sign in to comment.