Skip to content

Commit

Permalink
🐛 Use node reference in call graph for complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisFederico committed Feb 1, 2024
1 parent 3d479d8 commit 5447dff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/hebg/call_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def _extend_frontiere(self, nodes: List["Node"], heb_graph: "HEBGraph"):
else:
branch_id = parent.branch
call_node = CallNode(branch_id, parent.rank + 1)

if node.name in heb_graph.all_behaviors:
node = heb_graph.all_behaviors[node.name]
self.add_node(call_node, heb_node=node, heb_graph=heb_graph)
self.add_edge(parent, call_node, CallEdgeStatus.UNEXPLORED)
call_nodes.append(call_node)
Expand Down
2 changes: 1 addition & 1 deletion tests/examples/behaviors/loop_with_alternative.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def build_looping_behaviors() -> List[Behavior]:
all_behaviors = {behavior.name: behavior for behavior in behaviors}
for behavior in behaviors:
behavior.graph.all_behaviors = all_behaviors
behavior.complexity = 20
behavior.complexity = 5
return behaviors

0 comments on commit 5447dff

Please sign in to comment.