-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are we storing the current Node the agent is on as a dictionary? #47
Comments
There isn't a specific reason why we store the Node object instead of the coordinates. We noticed that the agents in the graph need to store more than just their current location (energy and attached blocks, for example), so we will change We could only store the location and not the Node Object itself, but then we would have to change the entire code for something that doesn't add extra clarify or practical value |
That makes sense, but the reason I find it a bit unwieldy is this, I want to check if a given node is the node an agent is currently located in. Because of the dictionary structure I hvae to do it like this: if node.location == self.beliefs.current[self._user_id].location It would be nicer if we could have either:
if node.location == self.current_location() or
if node.location == self.current_location |
You're right, it is a bit of a mouthful. I'll create the current_location() function (if we were to do a variable we would also need to keep updating it). |
I added the function current_info() to agent.py.
This way you can easily get the current location as well as the node, + you can easily also add other information in necessary |
I would split it up as two functions, current_location() and current_node(). I'll do it in a separate branch. |
In graph.py we are storing self.current like this:
self.current = {agent_id: self.nodes[(0, 0)]}
Why are we storing our current node like this instead of as a coordinate? Even though in the rest of the functions we always use the location of nodes instead of the specific instance of a node? Can we atleast add a variable that tracks the current location as a pair of coordinates?
The text was updated successfully, but these errors were encountered: