Skip to content

Commit

Permalink
Add INHERIT as an option.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamenot committed Jun 9, 2023
1 parent 3cf15b1 commit 85368b8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
12 changes: 8 additions & 4 deletions smarts/core/plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,8 @@ def from_pose(cls, pose: Pose):


@dataclass(frozen=True)
class AutomaticStart(StartBase):
"""Generates a start"""

pass
class InheritedStart(StartBase):
"""A starting state that inherits from the original vehicle."""


@dataclass(frozen=True, unsafe_hash=True)
Expand All @@ -95,6 +93,12 @@ def is_reached(self, vehicle_state) -> bool:
return False


@dataclass(frozen=True)
class InheritedGoal(Goal):
"""Describes a goal that is inherited from the vehicle (or original dataset)."""

pass

@dataclass(frozen=True, unsafe_hash=True)
class AutomaticGoal(Goal):
"""A goal that determines an end result from pre-existing vehicle and mission values."""
Expand Down
10 changes: 6 additions & 4 deletions smarts/primatives/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@


class SmartsLiteral(Enum):
AUTO: Final = "auto"
MAX: Final = 9223372036854775807
MISSING: Final = MAX
NONE: Final = None
AUTO = "auto"
INHERIT = ...
MAX = 9223372036854775807
MISSING = MAX
NONE = None


AUTO: Final = SmartsLiteral.AUTO
INHERIT: Final = SmartsLiteral.INHERIT
MAX: Final = SmartsLiteral.MAX
MISSING = SmartsLiteral.MISSING
NONE: Final = SmartsLiteral.NONE
6 changes: 3 additions & 3 deletions smarts/sstudio/types/actor/social_agent_actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

@dataclass(frozen=True)
class SocialAgentActor(Actor):
"""Used as a description/spec for zoo traffic actors. These actors use a
pre-trained model to understand how to act in the environment.
"""Used as a description/spec for zoo traffic actors. These actors are controlled by a
pre-trained model that understands how to behave in the environment.
"""

name: str
Expand All @@ -43,7 +43,7 @@ class SocialAgentActor(Actor):
agent_locator: str
"""The locator reference to the zoo registration call. Expects a string in the format
of 'path.to.file:locator-name' where the path to the registration call is in the form
`{PYTHONPATH}[n]/path/to/file.py`
``{PYTHONPATH}[n]/path/to/file.py``.
"""
policy_kwargs: Dict[str, Any] = field(default_factory=dict)
"""Additional keyword arguments to be passed to the constructed class overriding the
Expand Down
2 changes: 1 addition & 1 deletion smarts/sstudio/types/mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __post_init__(self):
class EndlessMission:
"""The descriptor for an actor's mission that has no end."""

begin: Tuple[str, int, float]
begin: Union[Tuple[str, int, float], Literal[AUTO]]
"""The (road, lane_index, offset) details of the start location for the route.
road:
Expand Down
2 changes: 1 addition & 1 deletion smarts/sstudio/types/route.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Route:
"""The ids of roads that must be included in the route between `begin` and `end`."""

map_spec: Optional[MapSpec] = None
"""All routes are relative to a road map. If not specified here,
"""All routes are relative to a road map. If not specified here,
the default map_spec for the scenario is used."""

@property
Expand Down

0 comments on commit 85368b8

Please sign in to comment.