{"action":"created","issue":{"url":"https://api.github.com/repos/luxkun/ReGoap/issues/3","repository_url":"https://api.github.com/repos/luxkun/ReGoap","labels_url":"https://api.github.com/repos/luxkun/ReGoap/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/luxkun/ReGoap/issues/3/comments","events_url":"https://api.github.com/repos/luxkun/ReGoap/issues/3/events","html_url":"https://github.com/luxkun/ReGoap/issues/3","id":195717023,"number":3,"title":"Thoughts on pooling/sharing actions?","user":{"login":"jswigart","id":4065267,"avatar_url":"https://avatars.githubusercontent.com/u/4065267?v=3","gravatar_id":"","url":"https://api.github.com/users/jswigart","html_url":"https://github.com/jswigart","followers_url":"https://api.github.com/users/jswigart/followers","following_url":"https://api.github.com/users/jswigart/following{/other_user}","gists_url":"https://api.github.com/users/jswigart/gists{/gist_id}","starred_url":"https://api.github.com/users/jswigart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jswigart/subscriptions","organizations_url":"https://api.github.com/users/jswigart/orgs","repos_url":"https://api.github.com/users/jswigart/repos","events_url":"https://api.github.com/users/jswigart/events{/privacy}","received_events_url":"https://api.github.com/users/jswigart/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-12-15T04:55:31Z","updated_at":"2016-12-18T12:34:51Z","closed_at":null,"body":"I am tinkering with using ReGoap in situations where there is a plurality of actions that may satisfy a goal, which is different from the simplistic approach that the included example used(singleton resource managers, etc). The reason being is that I want to try and use the planner to create a good solution using some spatial considerations as well, which is not something the example does. Naturally this can create quite a number of action instances. Have you considered or thought about setting the actions up in a more dynamic or poolable manner, where the actions can be considered more globally available for any number of agents, rather than each agent having copies of them?\r\n\r\nTo get an idea what I'm shooting for, consider if the GoapTest example that is included allocated an action per instance of a tree resource, bank resource, workstation resource, etc, with conditions based on it's spatial location. The idea here is that provided the GoTo actions estimated their cost based on distance or travel time, the overall plan should represent the most efficient set of actions to perform based on travel time as well as just fixed action costs.\r\n\r\nSeems GOAP isn't used that often in this manner, but I wanted to get your thoughts on the feasibility of globalizing a set of the actions rather than having to clone potentially dozens per agent.\r\n\r\nAlternately, if you have a reasonable way to configure the conditions through the planner that might avoid the need to have an action per in-world resource and still get reasonable spatial considerations, I'm interested in that too.\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/luxkun/ReGoap/issues/comments/267818791","html_url":"https://github.com/luxkun/ReGoap/issues/3#issuecomment-267818791","issue_url":"https://api.github.com/repos/luxkun/ReGoap/issues/3","id":267818791,"user":{"login":"luxkun","id":22868,"avatar_url":"https://avatars.githubusercontent.com/u/22868?v=3","gravatar_id":"","url":"https://api.github.com/users/luxkun","html_url":"https://github.com/luxkun","followers_url":"https://api.github.com/users/luxkun/followers","following_url":"https://api.github.com/users/luxkun/following{/other_user}","gists_url":"https://api.github.com/users/luxkun/gists{/gist_id}","starred_url":"https://api.github.com/users/luxkun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luxkun/subscriptions","organizations_url":"https://api.github.com/users/luxkun/orgs","repos_url":"https://api.github.com/users/luxkun/repos","events_url":"https://api.github.com/users/luxkun/events{/privacy}","received_events_url":"https://api.github.com/users/luxkun/received_events","type":"User","site_admin":false},"created_at":"2016-12-18T12:34:51Z","updated_at":"2016-12-18T12:34:51Z","body":"I think this can be already done with a component (something like GlobalActionPooler), which automatically adds nearby (or all) actions from a pool (GlobalActionPool) to the current agent.\r\nAm I wrong? Of course this would have the \"problem\" to have multiple actions for every agent.\r\nAnother approch is to have an action that automatically gets SmartObjects (an object which has all the informations the action need to operate) in someway (nearby, facing, your logic here) and changes its preconditions and effects based on the smartobject, the goal could also do the same like you proposed.\r\n\r\nAs for the resources the current example can be made more generic having a single action to gather any resource, this is not very complicated at all, just remove resourceName and dynamically update it with your logic.\r\n\r\nBut I get why you want to do this, it's simplier and has less overhead since you don't have to instantiate the actions for every agent, but I'm pretty sure this is almost negligible (if this is not the case an example with performance profiling would be nice).\r\n\r\nIt's the same with goals of course.\r\n\r\nI'm open to add this to the library, but working on other things right now, also I'm unsure if I would ever use this or the normal approach, since this does not add anything to the things the agent can do, so if you're interested in implementing this I would appreciate a pull request with your changes, pull requests are always welcome! 👍 "}}
{"actor":{"display_login":"luxkun"}}