Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ULTRA Update existing maps #868

Merged
merged 3 commits into from May 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions ultra/tests/test_analysis.py
Expand Up @@ -54,6 +54,7 @@ def test_interface_analyze(self):
stopwatcher_route="south-west",
JenishPatel99 marked this conversation as resolved.
Show resolved Hide resolved
root_path="tests/scenarios",
save_dir=save_dir,
pool_dir="pool/analysis_pool",
)

if not os.path.exists(output):
Expand Down Expand Up @@ -98,6 +99,7 @@ def test_analyze_scenario(self):
stopwatcher_route="south-west",
root_path="tests/scenarios",
save_dir=save_dir,
pool_dir="pool/analysis_pool",
)
scenarios = glob.glob(f"{save_dir}")
try:
Expand Down
9 changes: 7 additions & 2 deletions ultra/ultra/scenarios/generate_scenarios.py
Expand Up @@ -686,6 +686,7 @@ def build_scenarios(
stopwatcher_route,
save_dir,
root_path,
pool_dir=None,
dynamic_pattern_func=None,
):
print("Generating Scenario ...")
Expand All @@ -700,7 +701,11 @@ def build_scenarios(
level_config = task_config["levels"][level_name]
scenarios_dir = os.path.dirname(os.path.realpath(__file__))
task_dir = f"{scenarios_dir}/{task}"
pool_dir = f"{scenarios_dir}/pool"

if pool_dir is None:
pool_path = os.path.join(scenarios_dir, "pool/experiment_pool")
else:
pool_path = os.path.join(scenarios_dir, pool_dir)

train_total, test_total = (
int(level_config["train"]["total"]),
Expand Down Expand Up @@ -751,7 +756,7 @@ def build_scenarios(
reverse=True,
)
seed_count = 0
map_dir = f"{pool_dir}/{intersection_type}"
map_dir = f"{pool_path}/{intersection_type}"
with open(f"{map_dir}/info.json") as jsonfile:
map_metadata = json.load(jsonfile)
route_lanes = map_metadata["num_lanes"]
Expand Down
11 changes: 9 additions & 2 deletions ultra/ultra/scenarios/interface.py
Expand Up @@ -53,14 +53,20 @@
"--task", help="type a task id [0, 1, 2, 3]", type=str
)
parser_generate_scenarios.add_argument(
"--save-dir", help="directory for saving maps", type=str, default=None
"--save-dir", help="directory for saving scenarios", type=str, default=None
)
parser_generate_scenarios.add_argument(
"--root-dir",
help="directory for saving maps",
help="path to task directory",
type=str,
default="ultra/scenarios",
)
parser_generate_scenarios.add_argument(
"--pool-dir",
help="directory for locating maps",
type=str,
default=None,
)
parser_generate_scenarios.add_argument("--level", help="easy/medium/hard", type=str)
parser_generate_scenarios.add_argument(
"--stopwatcher",
Expand Down Expand Up @@ -133,6 +139,7 @@
stopwatcher_route=stopwatcher_route,
save_dir=args.save_dir,
root_path=args.root_dir,
pool_dir=args.pool_dir,
)
else:
ray.init()
Expand Down
204 changes: 204 additions & 0 deletions ultra/ultra/scenarios/pool/experiment_pool/2lane_c/100kmh/map.net.xml

Large diffs are not rendered by default.

204 changes: 204 additions & 0 deletions ultra/ultra/scenarios/pool/experiment_pool/2lane_c/50kmh/map.net.xml

Large diffs are not rendered by default.

204 changes: 204 additions & 0 deletions ultra/ultra/scenarios/pool/experiment_pool/2lane_c/70kmh/map.net.xml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions ultra/ultra/scenarios/pool/experiment_pool/2lane_c/info.json
@@ -0,0 +1,4 @@
{
"routes" : [["north-NS", "south-NS"],["north-NS", "east-WE"],["north-NS", "west-EW"], ["south-SN", "west-EW"], ["south-SN", "east-WE"], ["south-SN", "north-SN"], ["east-EW","west-EW"], ["east-EW","south-NS"], ["east-EW", "north-SN"], ["west-WE","east-WE"],["west-WE","north-SN"],["west-WE","south-NS"] ],
"num_lanes": {"north-NS":1, "south-NS":1, "east-WE":1, "west-EW":1, "south-NS":1, "south-SN":1, "north-SN":1, "east-EW":1, "west-WE":1}
}
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2021-05-19 09:21:33 by Eclipse SUMO netedit Version 1.9.2
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">

<input>
<sumo-net-file value="C:\Users\j84181432\Documents\pool\2lane_curvy_t\100kmh\map.net.xml"/>
</input>

<output>
<output-file value="C:\Users\j84181432\Documents\pool\2lane_curvy_t\100kmh\map.net.xml"/>
</output>

<processing>
<geometry.min-radius.fix.railways value="false"/>
<geometry.max-grade.fix value="false"/>
<offset.disable-normalization value="true"/>
<lefthand value="false"/>
</processing>

<junctions>
<no-turnarounds value="true"/>
<junctions.corner-detail value="5"/>
<junctions.limit-turn-speed value="-1"/>
<rectangular-lane-cut value="false"/>
</junctions>

<pedestrian>
<walkingareas value="false"/>
</pedestrian>

<report>
<aggregate-warnings value="5"/>
</report>

</configuration>
-->

<net version="1.9" junctionCornerDetail="5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">

<location netOffset="0.00,0.00" convBoundary="-108.86,-69.28,294.16,100.00" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>

<edge id=":junction-intersection_0" function="internal">
<lane id=":junction-intersection_0_0" index="0" speed="27.78" length="14.40" shape="107.20,101.60 92.80,101.59"/>
</edge>
<edge id=":junction-intersection_1" function="internal">
<lane id=":junction-intersection_1_0" index="0" speed="20.84" length="5.93" shape="107.20,101.60 103.35,101.05 101.60,100.00"/>
</edge>
<edge id=":junction-intersection_6" function="internal">
<lane id=":junction-intersection_6_0" index="0" speed="20.84" length="8.26" shape="101.60,100.00 100.60,99.40 98.95,96.65 98.40,92.80"/>
</edge>
<edge id=":junction-intersection_2" function="internal">
<lane id=":junction-intersection_2_0" index="0" speed="20.84" length="9.03" shape="101.60,92.80 101.95,95.25 103.00,97.00 104.75,98.05 107.20,98.40"/>
</edge>
<edge id=":junction-intersection_3" function="internal">
<lane id=":junction-intersection_3_0" index="0" speed="20.84" length="14.19" shape="101.60,92.80 101.05,96.65 99.40,99.40 96.65,101.05 92.80,101.59"/>
</edge>
<edge id=":junction-intersection_4" function="internal">
<lane id=":junction-intersection_4_0" index="0" speed="20.84" length="9.03" shape="92.80,98.39 95.25,98.05 97.00,97.00 98.05,95.25 98.40,92.80"/>
</edge>
<edge id=":junction-intersection_5" function="internal">
<lane id=":junction-intersection_5_0" index="0" speed="27.78" length="14.40" shape="92.80,98.39 107.20,98.40"/>
</edge>

<edge id="edge-east-EW" from="junction-east" to="junction-intersection" priority="1">
<lane id="edge-east-EW_0" index="0" speed="27.78" length="186.96" shape="294.16,101.60 107.20,101.60"/>
</edge>
<edge id="edge-east-WE" from="junction-intersection" to="junction-east" priority="1" spreadType="center" shape="99.99,98.40 294.16,98.40">
<lane id="edge-east-WE_0" index="0" speed="27.78" length="186.96" shape="107.20,98.40 294.16,98.40"/>
</edge>
<edge id="edge-south-NS" from="junction-intersection" to="junction-south" priority="-1" shape="100.00,100.00 100.02,61.46 94.01,41.24 95.40,16.15 111.02,-2.85 111.38,-25.09 89.88,-69.28">
<lane id="edge-south-NS_0" index="0" speed="13.89" length="172.80" shape="98.40,92.80 98.42,61.69 92.40,41.43 93.83,15.54 109.43,-3.43 109.77,-24.73 88.44,-68.58"/>
</edge>
<edge id="edge-south-SN" from="junction-south" to="junction-intersection" priority="-1" shape="89.88,-69.28 111.38,-25.09 111.02,-2.85 95.40,16.15 94.01,41.24 100.02,61.46 100.00,100.00">
<lane id="edge-south-SN_0" index="0" speed="13.89" length="174.29" shape="91.32,-69.98 112.99,-25.45 112.61,-2.27 96.97,16.76 95.62,41.05 101.62,61.23 101.60,92.80"/>
</edge>
<edge id="edge-west-EW" from="junction-intersection" to="junction-west" priority="1">
<lane id="edge-west-EW_0" index="0" speed="27.78" length="201.66" shape="92.80,101.59 -108.86,101.44"/>
</edge>
<edge id="edge-west-WE" from="junction-west" to="junction-intersection" priority="1">
<lane id="edge-west-WE_0" index="0" speed="27.78" length="201.66" shape="-108.86,98.24 92.80,98.39"/>
</edge>

<junction id="junction-east" type="dead_end" x="294.16" y="100.00" incLanes="edge-east-WE_0" intLanes="" shape="294.16,100.00 294.16,96.80 294.16,100.00"/>
<junction id="junction-intersection" type="priority" x="100.00" y="100.00" incLanes="edge-east-EW_0 edge-south-SN_0 edge-west-WE_0" intLanes=":junction-intersection_0_0 :junction-intersection_6_0 :junction-intersection_2_0 :junction-intersection_3_0 :junction-intersection_4_0 :junction-intersection_5_0" shape="107.20,103.20 107.20,96.80 104.98,96.36 104.20,95.80 103.65,95.02 103.31,94.02 103.20,92.80 96.80,92.80 96.36,95.02 95.80,95.80 95.02,96.35 94.02,96.68 92.80,96.79 92.80,103.19" rightOfWay="edgePriority">
<request index="0" response="000000" foes="001000" cont="0"/>
<request index="1" response="110000" foes="111000" cont="1"/>
<request index="2" response="100000" foes="100000" cont="0"/>
<request index="3" response="100011" foes="100011" cont="0"/>
<request index="4" response="000000" foes="000010" cont="0"/>
<request index="5" response="000000" foes="001110" cont="0"/>
</junction>
<junction id="junction-south" type="dead_end" x="89.88" y="-69.28" incLanes="edge-south-NS_0" intLanes="" shape="89.88,-69.28 87.00,-67.88 89.88,-69.28"/>
<junction id="junction-west" type="dead_end" x="-108.86" y="99.84" incLanes="edge-west-EW_0" intLanes="" shape="-108.86,99.84 -108.86,103.04 -108.86,99.84"/>

<junction id=":junction-intersection_6_0" type="internal" x="101.60" y="100.00" incLanes=":junction-intersection_1_0 edge-west-WE_0" intLanes=":junction-intersection_3_0 :junction-intersection_4_0 :junction-intersection_5_0"/>

<connection from="edge-east-EW" to="edge-west-EW" fromLane="0" toLane="0" via=":junction-intersection_0_0" dir="s" state="M"/>
<connection from="edge-east-EW" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_1_0" dir="l" state="m"/>
<connection from="edge-south-SN" to="edge-east-WE" fromLane="0" toLane="0" via=":junction-intersection_2_0" dir="r" state="m"/>
<connection from="edge-south-SN" to="edge-west-EW" fromLane="0" toLane="0" via=":junction-intersection_3_0" dir="l" state="m"/>
<connection from="edge-west-WE" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_4_0" dir="r" state="M"/>
<connection from="edge-west-WE" to="edge-east-WE" fromLane="0" toLane="0" via=":junction-intersection_5_0" dir="s" state="M"/>

<connection from=":junction-intersection_0" to="edge-west-EW" fromLane="0" toLane="0" dir="s" state="M"/>
<connection from=":junction-intersection_1" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_6_0" dir="l" state="m"/>
<connection from=":junction-intersection_6" to="edge-south-NS" fromLane="0" toLane="0" dir="l" state="M"/>
<connection from=":junction-intersection_2" to="edge-east-WE" fromLane="0" toLane="0" dir="r" state="M"/>
<connection from=":junction-intersection_3" to="edge-west-EW" fromLane="0" toLane="0" dir="l" state="M"/>
<connection from=":junction-intersection_4" to="edge-south-NS" fromLane="0" toLane="0" dir="r" state="M"/>
<connection from=":junction-intersection_5" to="edge-east-WE" fromLane="0" toLane="0" dir="s" state="M"/>

</net>
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>

<!-- generated on 2021-05-19 09:20:30 by Eclipse SUMO netedit Version 1.9.2
<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/netconvertConfiguration.xsd">

<input>
<sumo-net-file value="C:\Users\j84181432\Documents\pool\2lane_curvy_t\50kmh\map.net.xml"/>
</input>

<output>
<output-file value="C:\Users\j84181432\Documents\pool\2lane_curvy_t\50kmh\map.net.xml"/>
</output>

<processing>
<geometry.min-radius.fix.railways value="false"/>
<geometry.max-grade.fix value="false"/>
<offset.disable-normalization value="true"/>
<lefthand value="false"/>
</processing>

<junctions>
<no-turnarounds value="true"/>
<junctions.corner-detail value="5"/>
<junctions.limit-turn-speed value="-1"/>
<rectangular-lane-cut value="false"/>
</junctions>

<pedestrian>
<walkingareas value="false"/>
</pedestrian>

<report>
<aggregate-warnings value="5"/>
</report>

</configuration>
-->

<net version="1.9" junctionCornerDetail="5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/net_file.xsd">

<location netOffset="0.00,0.00" convBoundary="-106.25,-44.69,296.31,144.48" origBoundary="-10000000000.00,-10000000000.00,10000000000.00,10000000000.00" projParameter="!"/>

<edge id=":junction-intersection_0" function="internal">
<lane id=":junction-intersection_0_0" index="0" speed="13.89" length="14.39" shape="109.06,145.92 94.67,145.92"/>
</edge>
<edge id=":junction-intersection_1" function="internal">
<lane id=":junction-intersection_1_0" index="0" speed="13.89" length="5.92" shape="109.06,145.92 105.22,145.36 103.47,144.32"/>
</edge>
<edge id=":junction-intersection_6" function="internal">
<lane id=":junction-intersection_6_0" index="0" speed="13.89" length="8.27" shape="103.47,144.32 102.47,143.71 100.81,140.96 100.26,137.11"/>
</edge>
<edge id=":junction-intersection_2" function="internal">
<lane id=":junction-intersection_2_0" index="0" speed="13.89" length="9.04" shape="103.46,137.11 103.81,139.56 104.86,141.31 106.61,142.36 109.06,142.72"/>
</edge>
<edge id=":junction-intersection_3" function="internal">
<lane id=":junction-intersection_3_0" index="0" speed="13.89" length="14.20" shape="103.46,137.11 102.91,140.96 101.27,143.71 98.52,145.36 94.67,145.92"/>
</edge>
<edge id=":junction-intersection_4" function="internal">
<lane id=":junction-intersection_4_0" index="0" speed="13.89" length="9.03" shape="94.67,142.72 97.12,142.36 98.87,141.31 99.91,139.56 100.26,137.11"/>
</edge>
<edge id=":junction-intersection_5" function="internal">
<lane id=":junction-intersection_5_0" index="0" speed="13.89" length="14.40" shape="94.67,142.72 109.06,142.72"/>
</edge>

<edge id="edge-east-EW" from="junction-east" to="junction-intersection" priority="1">
<lane id="edge-east-EW_0" index="0" speed="13.89" length="187.25" shape="296.31,146.08 109.06,145.92"/>
</edge>
<edge id="edge-east-WE" from="junction-intersection" to="junction-east" priority="1" spreadType="center" shape="101.86,142.71 296.31,142.88">
<lane id="edge-east-WE_0" index="0" speed="13.89" length="187.25" shape="109.06,142.72 296.31,142.88"/>
</edge>
<edge id="edge-south-NS" from="junction-intersection" to="junction-south" priority="-1" shape="101.87,144.31 101.82,111.53 97.60,81.96 86.53,64.53 72.48,46.39 60.93,26.10 58.50,3.17 61.52,-16.61 75.37,-31.92 94.16,-44.69">
<lane id="edge-south-NS_0" index="0" speed="13.89" length="210.41" shape="100.26,137.11 100.22,111.64 96.06,82.53 85.22,65.45 71.15,47.28 59.37,26.60 56.89,3.13 60.01,-17.33 74.31,-33.14 93.26,-46.01"/>
</edge>
<edge id="edge-south-SN" from="junction-south" to="junction-intersection" priority="-1" shape="94.16,-44.69 75.37,-31.92 61.52,-16.61 58.50,3.17 60.93,26.10 72.48,46.39 86.53,64.53 97.60,81.96 101.82,111.53 101.87,144.31">
<lane id="edge-south-SN_0" index="0" speed="13.89" length="207.23" shape="95.06,-43.37 76.43,-30.70 63.03,-15.89 60.11,3.21 62.49,25.60 73.81,45.50 87.84,63.61 99.14,81.39 103.42,111.42 103.46,137.11"/>
</edge>
<edge id="edge-west-EW" from="junction-intersection" to="junction-west" priority="1">
<lane id="edge-west-EW_0" index="0" speed="13.89" length="200.92" shape="94.67,145.92 -106.25,146.07"/>
</edge>
<edge id="edge-west-WE" from="junction-west" to="junction-intersection" priority="1">
<lane id="edge-west-WE_0" index="0" speed="13.89" length="200.92" shape="-106.25,142.87 94.67,142.72"/>
</edge>

<junction id="junction-east" type="dead_end" x="296.31" y="144.48" incLanes="edge-east-WE_0" intLanes="" shape="296.31,144.48 296.31,141.28 296.31,144.48"/>
<junction id="junction-intersection" type="priority" x="101.87" y="144.31" incLanes="edge-east-EW_0 edge-south-SN_0 edge-west-WE_0" intLanes=":junction-intersection_0_0 :junction-intersection_6_0 :junction-intersection_2_0 :junction-intersection_3_0 :junction-intersection_4_0 :junction-intersection_5_0" shape="109.06,147.52 109.07,141.12 106.84,140.67 106.06,140.11 105.51,139.33 105.17,138.33 105.06,137.10 98.66,137.11 98.22,139.34 97.66,140.11 96.89,140.67 95.89,141.00 94.67,141.12 94.67,147.52" rightOfWay="edgePriority">
<request index="0" response="000000" foes="001000" cont="0"/>
<request index="1" response="110000" foes="111000" cont="1"/>
<request index="2" response="100000" foes="100000" cont="0"/>
<request index="3" response="100011" foes="100011" cont="0"/>
<request index="4" response="000000" foes="000010" cont="0"/>
<request index="5" response="000000" foes="001110" cont="0"/>
</junction>
<junction id="junction-south" type="dead_end" x="94.16" y="-44.69" incLanes="edge-south-NS_0" intLanes="" shape="94.16,-44.69 92.36,-47.34 94.16,-44.69"/>
<junction id="junction-west" type="dead_end" x="-106.25" y="144.47" incLanes="edge-west-EW_0" intLanes="" shape="-106.25,144.47 -106.25,147.67 -106.25,144.47"/>

<junction id=":junction-intersection_6_0" type="internal" x="103.47" y="144.32" incLanes=":junction-intersection_1_0 edge-west-WE_0" intLanes=":junction-intersection_3_0 :junction-intersection_4_0 :junction-intersection_5_0"/>

<connection from="edge-east-EW" to="edge-west-EW" fromLane="0" toLane="0" via=":junction-intersection_0_0" dir="s" state="M"/>
<connection from="edge-east-EW" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_1_0" dir="l" state="m"/>
<connection from="edge-south-SN" to="edge-east-WE" fromLane="0" toLane="0" via=":junction-intersection_2_0" dir="r" state="m"/>
<connection from="edge-south-SN" to="edge-west-EW" fromLane="0" toLane="0" via=":junction-intersection_3_0" dir="l" state="m"/>
<connection from="edge-west-WE" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_4_0" dir="r" state="M"/>
<connection from="edge-west-WE" to="edge-east-WE" fromLane="0" toLane="0" via=":junction-intersection_5_0" dir="s" state="M"/>

<connection from=":junction-intersection_0" to="edge-west-EW" fromLane="0" toLane="0" dir="s" state="M"/>
<connection from=":junction-intersection_1" to="edge-south-NS" fromLane="0" toLane="0" via=":junction-intersection_6_0" dir="l" state="m"/>
<connection from=":junction-intersection_6" to="edge-south-NS" fromLane="0" toLane="0" dir="l" state="M"/>
<connection from=":junction-intersection_2" to="edge-east-WE" fromLane="0" toLane="0" dir="r" state="M"/>
<connection from=":junction-intersection_3" to="edge-west-EW" fromLane="0" toLane="0" dir="l" state="M"/>
<connection from=":junction-intersection_4" to="edge-south-NS" fromLane="0" toLane="0" dir="r" state="M"/>
<connection from=":junction-intersection_5" to="edge-east-WE" fromLane="0" toLane="0" dir="s" state="M"/>

</net>