Open
Conversation
The method to identify nodes has two problems: - A node with a single-word name (like "Example") will have the same name and caption, since there are no empty spaces to replace with "_". This will trigger an "Identifier is not unique" in GeNIe. - Two nodes cannot have the same name, even if there are at different branches in the graph. To solve these two problems, I suggest we use NodeId instead of node caption, for two reasons: - The internal mechanic of NodeId, incrementing each time a node is created, ensures that every ID is unique. - The name is displayed, not the ID, so the user interface is not changed too much. Limitations: Now the error will happen if you name a node something like "Node_1". But this is a more unlikely behaviour.
XZETGEXI
commented
Jan 18, 2021
| self.from_node = from_node | ||
| self.to_node = to_node | ||
| self.to_node.addArcConnection(self.from_node.getName(),self.from_node.getIdNum(),self.from_node.getSize()) | ||
| self.to_node.addArcConnection(self.from_node.getName(),self.from_node.getNodeId(),self.from_node.getSize()) |
Contributor
Author
There was a problem hiding this comment.
This changes what gets into the var of a node
This change might actually break how computeBeliefs work
Thus it is not necessary to make this change, even if redesigning computeBeliefs would be better in the long run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The method to identify nodes has two problems:
To solve these two problems, I suggest we use NodeId instead of node caption, for two reasons:
Limitations:
Now the error will happen if you name a node something like "Node_1". But this is a more unlikely behaviour.