Skip to content

Commit 85368b8

Browse files
committed
Add INHERIT as an option.
1 parent 3cf15b1 commit 85368b8

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

smarts/core/plan.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,8 @@ def from_pose(cls, pose: Pose):
7676

7777

7878
@dataclass(frozen=True)
79-
class AutomaticStart(StartBase):
80-
"""Generates a start"""
81-
82-
pass
79+
class InheritedStart(StartBase):
80+
"""A starting state that inherits from the original vehicle."""
8381

8482

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

9795

96+
@dataclass(frozen=True)
97+
class InheritedGoal(Goal):
98+
"""Describes a goal that is inherited from the vehicle (or original dataset)."""
99+
100+
pass
101+
98102
@dataclass(frozen=True, unsafe_hash=True)
99103
class AutomaticGoal(Goal):
100104
"""A goal that determines an end result from pre-existing vehicle and mission values."""

smarts/primatives/constants.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@
2525

2626

2727
class SmartsLiteral(Enum):
28-
AUTO: Final = "auto"
29-
MAX: Final = 9223372036854775807
30-
MISSING: Final = MAX
31-
NONE: Final = None
28+
AUTO = "auto"
29+
INHERIT = ...
30+
MAX = 9223372036854775807
31+
MISSING = MAX
32+
NONE = None
3233

3334

3435
AUTO: Final = SmartsLiteral.AUTO
36+
INHERIT: Final = SmartsLiteral.INHERIT
3537
MAX: Final = SmartsLiteral.MAX
3638
MISSING = SmartsLiteral.MISSING
3739
NONE: Final = SmartsLiteral.NONE

smarts/sstudio/types/actor/social_agent_actor.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131

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

3838
name: str
@@ -43,7 +43,7 @@ class SocialAgentActor(Actor):
4343
agent_locator: str
4444
"""The locator reference to the zoo registration call. Expects a string in the format
4545
of 'path.to.file:locator-name' where the path to the registration call is in the form
46-
`{PYTHONPATH}[n]/path/to/file.py`
46+
``{PYTHONPATH}[n]/path/to/file.py``.
4747
"""
4848
policy_kwargs: Dict[str, Any] = field(default_factory=dict)
4949
"""Additional keyword arguments to be passed to the constructed class overriding the

smarts/sstudio/types/mission.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __post_init__(self):
7575
class EndlessMission:
7676
"""The descriptor for an actor's mission that has no end."""
7777

78-
begin: Tuple[str, int, float]
78+
begin: Union[Tuple[str, int, float], Literal[AUTO]]
7979
"""The (road, lane_index, offset) details of the start location for the route.
8080
8181
road:

smarts/sstudio/types/route.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class Route:
8686
"""The ids of roads that must be included in the route between `begin` and `end`."""
8787

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

9292
@property

0 commit comments

Comments
 (0)