Open toruseo opened 3 days ago
I have found it confusing at times that the Node id
and name
are used in different situations. I would suggest always using the id in UXsim internally, and leaving the name just for something the user can use to track different nodes.
We recently had a similar discussion over at Mesa, it might be interesting:
yes, that is also confusing. Refactoring the internal code will be difficult, but let me think if there are feasible solutions.
Thanks for the info too. It is interesting that many people are facing similar issues.
Currently we can specify Node (or Link, Vehicle) by Node object itself or its name which is str. This is sometimes confusing and causes a bug. It may be possible to solve this issue by overriding
__eq__
method (==
) properly so that something likenode == "node_name"
holds true ifnode.name = "node_name"
.Also, it will be great if we can use Node object and node name as a dictionary key interchangeably.
But I am not familiar to overriding
__eq__
method, so this requires some study.