{"id":31480609,"url":"https://github.com/commonroad/commonroad-scenario-factory","last_synced_at":"2025-10-02T05:08:46.622Z","repository":{"id":317327213,"uuid":"1066236551","full_name":"CommonRoad/commonroad-scenario-factory","owner":"CommonRoad","description":"Automated traffic scenario generation in CommonRoad. ","archived":false,"fork":false,"pushed_at":"2025-09-30T06:56:26.000Z","size":99402,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-30T08:40:27.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CommonRoad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-29T08:04:00.000Z","updated_at":"2025-09-29T08:07:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"be6dc351-f90f-48ca-8060-388c338093e3","html_url":"https://github.com/CommonRoad/commonroad-scenario-factory","commit_stats":null,"previous_names":["commonroad/commonroad-scenario-factory"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/CommonRoad/commonroad-scenario-factory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommonRoad%2Fcommonroad-scenario-factory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommonRoad%2Fcommonroad-scenario-factory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommonRoad%2Fcommonroad-scenario-factory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommonRoad%2Fcommonroad-scenario-factory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CommonRoad","download_url":"https://codeload.github.com/CommonRoad/commonroad-scenario-factory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CommonRoad%2Fcommonroad-scenario-factory/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277958035,"owners_count":25905626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-02T02:00:08.890Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-02T05:08:44.678Z","updated_at":"2025-10-02T05:08:46.615Z","avatar_url":"https://github.com/CommonRoad.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CommonRoad Scenario Factory\n\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/commonroad-scenario-factory.svg)](https://pypi.python.org/pypi/commonroad-scenario-factory/)\n[![PyPI version fury.io](https://badge.fury.io/py/commonroad-scenario-factory.svg)](https://pypi.python.org/pypi/commonroad-scenario-factory/)\n[![PyPI download month](https://img.shields.io/pypi/dm/commonroad-scenario-factory.svg?label=PyPI%20downloads)](https://pypi.python.org/pypi/commonroad-scenario-factory/)\n[![PyPI license](https://img.shields.io/pypi/l/commonroad-scenario-factory.svg)](https://pypi.python.org/pypi/commonroad-scenario-factory/)\n\n\nThe CommonRoad Scenario Factory is a toolbox that combines many different tools from the whole CommonRoad ecosystem to efficiently process CommonRoad scenarios.\nIts current main use case is the generation of new CommonRoad scenarios with the traffic simulators OpenTrafficSim (OTS) and SUMO.\n\n\n## Quick Start\n\n### Installation\n\nThe CommonRoad Scenario Factory is available on PyPI and can be easily installed with pip:\n\n```sh\n$ pip install commonroad-scenario-factory\n```\n\n#### Additional Requirements\n\nMost required dependencies are already included, but some have to be installed manually on your system:\n\n* [Java Runtime Environment](https://www.java.com/en/): Required for running simulations with OpenTrafficSim (OTS).\n* [osmium](https://osmcode.org/osmium-tool/): Required for extracting segments from pre-downloaded OSM maps.\n\nSUMO and OTS are distributed as python packages and included as dependencies. Therefore, they do not need to be installed separately.\n\n### Example Usage\n\nThis example will setup a basic scenario generation pipeline with SUMO and output new scenarios to `/tmp/scenario-factory`:\n\n```python\nfrom pathlib import Path\n\nfrom scenario_factory.globetrotter import Coordinates, OsmApiMapProvider, RegionMetadata\nfrom scenario_factory.pipelines import (\n    create_globetrotter_pipeline,\n    create_scenario_generation_pipeline,\n)\nfrom scenario_factory.pipeline_steps import (\n    pipeline_add_metadata_to_scenario,\n    pipeline_simulate_scenario_with_sumo,\n    pipeline_assign_tags_to_scenario,\n    pipeline_write_scenario_to_file,\n)\nfrom scenario_factory.scenario_config import ScenarioFactoryConfig\nfrom scenario_factory.simulation import SimulationConfig, SimulationMode\n\nradius = 0.1\nseed = 5678\nsimulation_steps = 500\ncr_scenario_time_steps = 50\ncoords_str = \"48.2570465,11.6580003\"\noutput_path = Path(\"/tmp/scenario-factory\")\noutput_path.mkdir(exist_ok=True)\n\n\nmap_provider = OsmApiMapProvider()\nsimulation_config = SimulationConfig(\n    mode=SimulationMode.RANDOM_TRAFFIC_GENERATION,\n    simulation_steps=simulation_steps,\n    seed=seed,\n)\nscenario_config = ScenarioFactoryConfig(\n    seed=seed, cr_scenario_time_steps=cr_scenario_time_steps, source=\"example\"\n)\n\nbase_pipeline = (\n    create_globetrotter_pipeline(radius, map_provider)\n    .map(pipeline_add_metadata_to_scenario)\n    .map(pipeline_simulate_scenario_with_sumo(simulation_config))\n)\n\nscenario_generation_pipeline = create_scenario_generation_pipeline(\n    scenario_config.criterions, scenario_config.filters\n)\n\npipeline = (\n    base_pipeline.chain(scenario_generation_pipeline)\n    .map(pipeline_assign_tags_to_scenario)\n    .map(pipeline_write_scenario_to_file(output_path))\n)\n\ncoordinates = Coordinates.from_str(coords_str)\nregion = RegionMetadata.from_coordinates(coordinates)\n\nprint(f\"Starting scenario generation for coordinates {coords_str}.\")\nresult = pipeline.execute([region], num_threads=2, num_processes=2)\nresult.print_cum_time_per_step()\nprint(f\"Generated {len(result.values)} scenario(s) at {output_path}.\")\n```\n\n## Documentation\n\nThe full documentation can be found at [cps.pages.gitlab.lrz.de/commonroad/scenario-factory](https://cps.pages.gitlab.lrz.de/commonroad/scenario-factory/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonroad%2Fcommonroad-scenario-factory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcommonroad%2Fcommonroad-scenario-factory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcommonroad%2Fcommonroad-scenario-factory/lists"}