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

Monaco SUMO Traffic Scenario for Artery #355

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

awillecke
Copy link
Contributor

Hi Raphael,

we used the MoST scenario in the past for some evaluations. However, using it is not as straightforward as other scenarios and Artery has to be extended for it to function properly. I'm not sure, whether this is something you would like to integrate into Artery. However, I think it could be helpful for others who are interested in the MoST scenario as well.

This pull request contains three parts:

  • The MoST scenario configuration in scenarios/most, including a configuration for the envmod and gemv2
  • MultiVClassMultiTypeModuleMapper: This extends the known MultiTypeModuleMapper by allowing different types of vehicles to be treated differently, in case other market penetration rates for passenger cars and mopeds are desired for example.
  • The OverlappingVehiclePolicy: this policy removes vehicles that are parked in an overlapping manner. In MoST, parking lots are modeled in a kind of odd way as the attached picture shows. The areas are geographically small but have a large capacity. This leads to many vehicles in a small area, which has a particularly interesting effect on the envmod as hundreds of objects are detected almost simultaneously. Hence, the OverlappingVehiclePolicy checks whether parking vehicles are overlapping each other and removes them while they are parked.

All features are squashed to single commits for the PR's conciseness. However, I want to highlight that @hagau mostly wrote the implementations.

Pasted image 20241219151703

hagau and others added 3 commits December 19, 2024 16:13
vehicles whose position overlap

In SUMO, vehicles sometimes park on roughly the same
position, leading to a cluster of obstacles with very small distances
between them when calculating non-line-of-sight path loss for vehicles
in GEMV2. Thus, when multiplying those distances to calculate
attenuation, a floating point underflow occurs.
`OverlappingVehiclesPolicy` tries to solve this by removing all but one
of the overlapping vehicles.

Fix OverlappingVehiclesPolicy to actually work properly

Remove some debug code

Extend granularity of the position grid in OverlappingVehiclesPolicy to
1m

Rewrite OverlappingVehiclesPolicy to use the parking start/end vehicle
handler of VehiclePolicy

Remove some debug code from OverlappingVehiclesPolicy

Add an initial removal step in OverlappingVehiclesPolicy to remove
vehicles that have been parked before the simulation start

Use the initial removal procedure to also remove newly parked vehicles

Fix overlapping vehicle removal implementation

Before, some overlapping vehicles were not removed.

Remove debug code from OverlappingVehiclesPolicy

Improve r-tree perfomance by bulk loading entries

Add subscription variables for parked vehicles

Extend BasicNodeManager to handle parking vehicles

Add vehicle parking start/end handler to VehicleLifecycle

Add parking vehicles handling to ExtensibleNodeManager

Add vehicle parking start/end handler to VehiclePolicy

Cleanup
The MultiVClassMultiTypeModuleMapper allows for equipping different SUMO vehicle classes separately
@riebl
Copy link
Owner

riebl commented Dec 23, 2024

Thanks for this awesome PR!
I still have some trouble understanding why OverlappingVehiclesPolicy operates the way you have implemented it (see my comments).
Do you have a hint for me how to check if it still working correctly? Any nice spot on the map to look at?

@awillecke
Copy link
Contributor Author

Sorry, maybe I should have added more explanations on the policy. Unfortunately, I cannot see your comments on the commits.

Generally, the goal is to remove vehicles that park in the same spot geographically as a previously parked vehicle and insert them again, if they enter the traffic again. This policy's implementation is not as straightforward as SUMO does not provide functions to query the list of vehicles that are currently parked, but rather only lists of vehicles that are currently start or end parking. Furthermore, parking already starts when a vehicle is approaching the parking lot. Hence, the policy must track the vehicles that are parked (and the ones that are removed due to overlap) itself. m_check_ids saves the vehicles that must be evaluated for overlaps and m_removed_vehicles tracks vehicles that were removed due to overlaps.

I've added the most_overlap config to the scenario that focuses on a single parking lot. This configuration also triggers the bug in #305.

namespace traci
{

class MultiVClassMultiTypeModuleMapper : public MultiTypeModuleMapper
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature but the name is not catchy at all ;-)
What do you think about VehicleClassModuleMapper? (No need to change it in this PR, I can do this afterwards)

m_rtree.clear();
// after the initial removal step, only upon a vehicle starting to
// park the r-tree is fully rebuild, otherwise it is not used
m_initial_run_is_done = true;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can also unsubscribe the signal listener now?


traci::VehiclePolicy::Decision OverlappingVehiclesPolicy::addVehicle(const std::string& id)
{
bool is_overlapping = checkIfOverlapping(id);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overlap check is only useful during initialization, isn't it? After the initialization phase (m_initial_run_is_done == true), the r-tree is only valid when a vehicle starts parking and thus this check here does not work at all if my understanding is correct.

bool is_overlapping = checkIfOverlapping(id);
if (is_overlapping) {
auto position = getPosition(id);
m_removed_vehicles.erase(id);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

insert?


// using 2D points only for now
if (std::fpclassify(position.z) != FP_ZERO) {
throw cRuntimeError("z position is not 0");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does a non-zero z-coordinate hurt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants