Skip to content

8. RouteChoiceModel

smart-fm edited this page Nov 9, 2018 · 5 revisions

1. Mid-term route choice model

Vehicle's route choice is decided based on the choice model so called Path-size logit model. Detailed description is available from [MT - Route choice] (https://github.com/smart-fm/simmobility-prod/wiki/Mid-Term-Framework). To enable the route choice, we use following pathset_config.xml configuration file.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright Singapore-MIT Alliance for Research and Technology -->
<pathset enabled="true">
    <thread_pool size="7"/>
    <private_pathset enabled="true" mode="normal"> <!--"normal" and "generation" are supported modes -->
        <od_source table="routechoice.pvt_od"/>
        <bulk_generation_output_file name="pvt-pathset.csv" />
        <tables historical_traveltime="supply.link_travel_time" default_traveltime="supply.link_default_travel_time"/>
        <functions pathset_without_banned_area="get_path_set_woba"/>
        <recursive_pathset_generation value="false"/>
        <reroute enabled="false" />
        <utility_parameters>
            <highwayBias value="0.5"/>
        </utility_parameters>
        <path_generators max_segment_speed="26.39"> <!--in cm/s--> <!-- 2639cm/s = 95km/hr -->
            <k_shortest_path level="5" />
            <link_elimination types="default,highway" />    <!-- unused for now. only default and highway are used in the code-->
            <random_perturbation modes="time" iterations="100" uniform_range="1,100" /> <!-- for 'modes' attribute, only "time" is supported for now -->
        </path_generators>
    </private_pathset>

    <public_pathset enabled="true" mode="normal"> <!-- "normal" and "generation" modes are supported -->
        <od_source table="routechoice.pt_od"/>
        <bulk_generation_output_file name="pt-pathset.csv" />
        <pathset_generation_algorithms>
            <k_shortest_path level="10" />
            <simulation_approach iterations="100"/>
        </pathset_generation_algorithms>
    </public_pathset>
</pathset>

2. En-route choice

SimMobility ST updates position of vehicles by calculating distCovered.


In which, V_curr is current speed, A_curr is current acceleration, and Δt is elapsed second. The vehicles sometimes lose their turning path (usually near intersection) because of i) the failure of lane change and ii) network design, etc. This condition is captured by SimMobility command: catch(no_turning_path_exception &ex), then ST initiates new route choice by creating new path-set from his/her current position to their original destination.

//Get the path from the path-set manager if we're using route-choice
vector<WayPoint> path;
if (ConfigManager::GetInstance().FullConfig().PathSetMode())
{
set<const Link *> blackListLink;
bool useInSimulationTT = parentDriver->getParent()->usesInSimulationTravelTime();
isPathFound = PrivateTrafficRouteChoice::getInstance()->getBestPath(path, subtrip, true, blackListLink, false, false, false, nextLink, useInSimulationTT);
}

In the case when the route choice is deactivated, ST finds the shortest path through following implementation:

//else find the shortest path
if(!isPathFound || ConfigManager::GetInstance().FullConfig().PathSetMode())
{
const StreetDirectory& stdir = StreetDirectory::Instance();				
path = stdir.SearchShortestDrivingPath<sim_mob::Link, sim_mob::Node>(*nextLink, *(parentDriver->destination));
						
if(path.empty())
{
continue;
}	
}

Logical flow on en-route choice is briefly illustrated as:


Flow chart for en-route route choice

Clone this wiki locally