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

Add low dimension interest observation. #1977

Merged
merged 13 commits into from
Apr 25, 2023

Conversation

Gamenot
Copy link
Collaborator

@Gamenot Gamenot commented Apr 24, 2023

Closes #1918

@Adaickalavan
Copy link
Member

We also need episode termination or done criteria based on termination of vehicle of interest.

@Gamenot
Copy link
Collaborator Author

Gamenot commented Apr 24, 2023

We also need episode termination or done criteria based on termination of vehicle of interest.

I am in the process of adding it.

Comment on lines 197 to 206
class ActorsAliveDoneCriteria:
"""Require actors to persist."""

actors_of_interest: Tuple[str, ...] = ()
actors_filter: Tuple[str, ...] = ()
"""Actors that should exist to continue this agent."""

strict: bool = True
"""If strict the agent will be done instantly if a target actor is not available
immediately.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we remove ActorsAliveDoneCriteria, because we already have (i) ScenarioInterestDoneCriteria and (ii) AgentsAliveDoneCriteria ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They have slightly different uses. One is specified at the scenario generation level, the other solely in the interface. Maybe I could merge the two?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, do consider merging the underlying code for both of them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I merged the two. Now agent interface defined actors of interest also show up in the observations.

Comment on lines +213 to +217
@cached_property
def actors_pattern(self) -> re.Pattern:
"""The expression match pattern for actors covered by this interface specifically."""
return re.compile("|".join(rf"(?:{aoi})" for aoi in self.actors_filter))

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to place this method elsewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placing it elsewhere would complicate its use. It is fine since it has no side effects.

My consideration is if I should compress actors_pattern and actors_filter to be a single attribute since it is not clear that actors_filter uses regular expression matching.

@Gamenot Gamenot requested a review from saulfield April 25, 2023 14:27
@Gamenot Gamenot merged commit 00a80ff into master Apr 25, 2023
@Adaickalavan Adaickalavan deleted the tucker/low_dimension_interest_observations branch April 25, 2023 21:56
Copy link
Contributor

@qianyi-sun qianyi-sun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have merged this branch on my branch and tested with several scenarios, the episodes now end with the vehicle of interest done, thanks Tucker!

@qianyi-sun
Copy link
Contributor

have merged this branch on my branch and tested with several scenarios, the episodes now end with the vehicle of interest done, thanks Tucker!

oops, wrong PR, was intented to comment under #1995

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

Successfully merging this pull request may close these issues.

[Feature request] Expose vehicles of interest in low dimension observations.
4 participants