Skip to content
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

Repeating actions per plan #12

Closed
AJ92 opened this issue Jun 14, 2020 · 1 comment
Closed

Repeating actions per plan #12

AJ92 opened this issue Jun 14, 2020 · 1 comment

Comments

@AJ92
Copy link

AJ92 commented Jun 14, 2020

Hi, nice piece of simple and short goap you got there,
anyways, i noticed, that it isn't possible to reuse actions once they have been used, so a goal that e.g. requires to collect 5x wood isn't really possible.

My suggestion is to pass all actions all the time, but limit the use somehow so that actions can be reused, but infinite loops are prevented.

Maybe just pass all actions instead of filtering them out at:

const subset = actions.filter(a => a.key !== action.key);

and limit the calls to buildGraph from the createPlan function?

@wmdmark
Copy link
Owner

wmdmark commented Aug 31, 2020

@AJ92 good idea! I'd happily accept a pull request for this if you'd like to give it a go 👍

@wmdmark wmdmark closed this as completed Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants