BerkeleyLearnVerify / Scenic

A compiler and scenario generator for the Scenic scenario description language.
https://scenic-lang.org/
Other
271 stars 93 forks source link

Setting the ego object of a modular scenario to the ego of a subscenario #143

Closed abol-karimi closed 5 months ago

abol-karimi commented 1 year ago

I want to make a strictly modular scenario i.e. one that does not add anything to its subscenarios. Since a scenario must have an ego, the ego of the modular scenario must be specified in one of its subscenarios. Is it possible? I'd like to be able to do something like this:

scenario Main():
   setup:
      ego_scenario = EgoScenario()
      ego = ego_scenario.ego
   compose:
      ego_scenario, OtherScenario()

This results in scenic.core.errors.RuntimeParseError: tried to make non-object the ego object.

My goal is to choose the specification and behavior of the ego object at runtime, e.g. by asking the user the path of the scenic file that contains the EgoScenario, then importing that scenario using importlib.

Eric-Vin commented 5 months ago

In Scenic 3.0 an ego object is no longer required, so hopefully this fixes your issue.