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

Semaphore task (aka ResourceGuard) #34

Open
limbonaut opened this issue Feb 10, 2024 · 0 comments
Open

Semaphore task (aka ResourceGuard) #34

limbonaut opened this issue Feb 10, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@limbonaut
Copy link
Owner

limbonaut commented Feb 10, 2024

Thoughts

  • Limit concurrent access to a shared resource (use elevator, med kit station, etc.).
  • Should be possible to limit number of attackers vs specific targets.
  • wait_for_resource: If true, the task should wait for the resource to be released; otherwise, return FAILURE when the resource is not available.
  • max_concurrency: maximum number of concurrent access allowed.
    • Alternative names: counter or count, units_available, available.
  • Resource can be any Object-derived instance on the blackboard.
    • Use Object::get_instance_id() for resource identification.
    • Optional: If not specified, the decorated branch is considered to be the resource that is limited, thus only a number of agents can access the limited branch.
  • Intention: StringName or String
    • Default value: &"default"
    • If the resource can be used in various ways without limit, the intention property can be used to specify how exactly it will be used.
    • Intention examples: &"engage", &"heal", &"hack".
    • Not applicable when resource object is not specified (when limiting the branch executions).
    • The purpose is to limit specific interactions with the resource: "Only 2 enemies can attack player at the same time", "Only 1 pylon can heal player at the same time" (player is the resource in these examples, and attacking and healing are intentions).
    • Q: Too convoluted? Does it complicate implementation too much?
    • Q: Should it be StringName?
  • Internal counter is associated with both instance_id and intention.
  • Internal counter is global, and it is not associated with the agent instance or specific BehaviorTree.
@limbonaut limbonaut added the enhancement New feature or request label Feb 15, 2024
@limbonaut limbonaut modified the milestone: v1.1 Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant