Comments (5)
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 self.current = {agent_id: self.nodes[(0, 0)]}
to something like self.info {agent_id: {'node': self.nodes[(0, 0)], 'energy': 300}}
. Then we could make separate keys for the node object and the location. It's just that by simple doing Node.location you can get the location of the node, so storing the location as well just seems like an unnecessary thing to keep track of.
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
from mapc-uva.
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:
- A function that does it for us
if node.location == self.current_location()
or
- Simply storing it as a named variable in the Graph object
if node.location == self.current_location
from mapc-uva.
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).
from mapc-uva.
I added the function current_info() to agent.py.
def current_info(self, info):
if info == 'location':
return self.beliefs.get_current(self._user_id).location
elif info == 'node':
return self.beliefs.get_current(self._user_id)
This way you can easily get the current location as well as the node, + you can easily also add other information in necessary
from mapc-uva.
I would split it up as two functions, current_location() and current_node(). I'll do it in a separate branch.
from mapc-uva.
Related Issues (20)
- Unpack higher level functions in BDI agent
- Create universal run function in super agent for testing purposes
- Replace primitive function state flags by nav_to check
- Need a pretty_print function in one central location.
- Use STATUS-REQUEST message to determine server config, including no. agents
- Replace all bare excepts with the errors we wish to catch HOT 1
- Agents need to be able to navigate with blocks attached to them. HOT 9
- Agent needs a function to print the current state of the map (as known in the beliefs)
- Use Tobias Albrecht's idea for creating proper amount of agents HOT 2
- Expand single agent builders to complete complex tasks HOT 3
- Taskboards and dispensers are not correctly added to the beliefs
- Confusing usage of the word node HOT 1
- Should we treat the dictionary of nodes in graph as a defaultdict instead of a normal dict? HOT 1
- Find the middle of the goal state HOT 2
- move _manhattan_distance(coords1, coords2) from builder to agent HOT 2
- There needs to be a way to tag agents with an ID HOT 7
- Add drop_intention using the context
- We need a way to generate paths using our algorithm
- We should keep a copy of the server configuration we use for this research
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapc-uva.