Skip to content

Generate a Scene with a Random Number of Objects #373

@afishman-openai

Description

@afishman-openai

Describe the feature and motivation

Apologies if this is already implemented, but I haven't been able to figure it out. I'm trying to generate a scene that places a random number of objects in a rectangle. For example, the following doesn't work:

scenic_string = """
workspace = Workspace(RectangularRegion((0, 0), 0 deg, 1.2, 1.0))
numObjects = DiscreteRange(0, 5)
for i in range(numObjects):
    new Object in workspace,
        with width 0.015,
        with length 0.015
# """
scene = scenic.scenarioFromString(scenic_string)

I'd like to be able to randomize over the number of things in my scene. Is there any way to do this currently?

Additional context

No response

Issue Submission Checklist

  • I checked the open and closed issues, forum, etc. and have not found any solution

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttype: featureNew features or enhancements

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions