rodrigoqueiroz / geoscenarioserver

8 stars 1 forks source link

Btree locations parameter #51

Closed WAEliasmith closed 3 years ago

WAEliasmith commented 3 years ago

adds the --btree-locations parameter, which adds higher priority locations in which the different btypes of btree folders can be found. This means that to use the variable, you give the path to the folder than contains "sdv" and "sp" tree folders.

Merge this after: https://github.com/rodrigoqueiroz/geoscenarioserver/pull/50

Set the default root location in GSServer.py to "btreesbad" on line 25

$ python3.8 $HOME/anm_unreal_sim/submodules/geoscenarioserver/GSServer.py --scenario $HOME/anm_unreal_test_suite/scenarios/ring_road_ccw/geoscenarioserver/ring_road_ccw.osm --map-path $HOME/anm_unreal_test_suite/maps -b $HOME/anm_unreal_sim/submodules/geoscenarioserver/btrees
...
Btree search locations set (in order) as: ['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees', '/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btreesbad']
*print statement showing btrees has priority over btreesbad
*simulation runs using drive trees

Set the default root location in GSServer.py to "btreesbad"

$ python3.8 $HOME/anm_unreal_sim/submodules/geoscenarioserver/GSServer.py --scenario $HOME/anm_unreal_test_suite/scenarios/ring_road_ccw/geoscenarioserver/ring_road_ccw.osm --map-path $HOME/anm_unreal_test_suite/maps
...
Btree search locations set (in order) as: ['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btreesbad']
*shows that only the default is used
Btree file sdv/drive.btree not found in any provided location. Locations: (['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btreesbad'])

*simulation runs, but no vehicles drive, since they are not fed trees

Set the default root location in GSServer.py back to "btrees"

$ python3.8 $HOME/anm_unreal_sim/submodules/geoscenarioserver/GSServer.py --scenario $HOME/anm_unreal_test_suite/scenarios/ring_road_ccw/geoscenarioserver/ring_road_ccw.osm --map-path $HOME/anm_unreal_test_suite/maps
...
Btree search locations set (in order) as: ['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees']
Using /home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees/sdv/drive.btree

*simulation runs, and vehicles drive using the default trees

Testing multiple locations seperated by a colon:

$ python3.8 $HOME/anm_unreal_sim/submodules/geoscenarioserver/GSServer.py --scenario $HOME/anm_unreal_test_suite/scenarios/ring_road_ccw/geoscenarioserver/ring_road_ccw.osm --map-path $HOME/anm_unreal_test_suite/maps -b $HOME/anm_unreal_sim/submodules/geoscenarioserver/testlocation1:$HOME/anm_unreal_sim/submodules/geoscenarioserver/testlocation2
...
Btree search locations set (in order) as: ['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/testlocation1', '/home/ae/anm_unreal_sim/submodules/geoscenarioserver/testlocation2', '/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees']
Using /home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees/sdv/drive.btree
*this shows that the btree locations are fed in the correct order, and the used btrees are the defaults since there are no trees in the test locations

Add testlocation1/sdv/drive.btree as a copy of the default:

$ python3.8 $HOME/anm_unreal_sim/submodules/geoscenarioserver/GSServer.py --scenario $HOME/anm_unreal_test_suite/scenarios/ring_road_ccw/geoscenarioserver/ring_road_ccw.osm --map-path $HOME/anm_unreal_test_suite/maps -b $HOME/anm_unreal_sim/submodules/geoscenarioserver/testlocation1:$HOME/anm_unreal_sim/submodules/geoscenarioserver/testlocation2
...
Btree search locations set (in order) as: ['/home/ae/anm_unreal_sim/submodules/geoscenarioserver/testlocation1', '/home/ae/anm_unreal_sim/submodules/geoscenarioserver/testlocation2', '/home/ae/anm_unreal_sim/submodules/geoscenarioserver/btrees']
Using /home/ae/anm_unreal_sim/submodules/geoscenarioserver/testlocation1/sdv/drive.btree
*has all the locations, and uses the drive in testlocation1 since it is first on the list
*simulates successfully, even when btrees folder is renamed, since the default is no longer being used