Origin and Destination ====================== MetroSim takes as input the origin zone and destination zone of each agent. The origin / destination zones can either be: - x/y coordinates representing the center of the zone, - a polygon representing the boundaries of the zone. If the zones are defined by x/y coordinates, we can simulate the boundaries of the zones by using Voronoi diagrams. Alternatively, the boundaries could be set to a circle centered on the given x / y coordinates, with a given zone-specific radius. If the zones are defined by a polygon, we can compute the geometric center (or centroid) of this polygon. Origins and Destinations for Car -------------------------------- For car trips, all vehicles are assumed to be leaving from (arriving at) the center point of the origin (destination) zone. To do so, a new node is added to the road-network graph, for each zone center point. These nodes are connected to the road-network graph using new edges, called "connectors". The connectors are either: - an input of the simulator (i.e., we know to which nodes the center points are connected and we know the characteristics of the edges connecting them), - automatically created for the :math:`n` closest nodes to the center point, where :math:`n` is an input parameter. .. note:: If the boundaries of the zones are given and if the simulator detects that one of the :math:`n` closest nodes to the center point is not in the zone, the simulator will warn the user. If the boundaries of the zones are not given and if the simulator detects that a node is one of the :math:`n` closest nodes for two or more center points, the simulator will warn the user. If the connectors are automatically created, their travel time is set to a constant travel time, given as input. .. note:: Alternatively, the travel time of the connectors could depend on their length. However, this would require computing a distance in meters between the center points and the connected nodes, which is not feasible without knowing the projection of the coordinates. .. note:: If the zones are so large that it is unrealistic to assume that all agents are leaving from the same point, the users can always divide each zone in :math:`k` subzones so that the agents in the same zone are now leaving from :math:`k` different points. .. note:: The running time of the simulator is roughly proportional to the number of unique destination points. Therefore, an alternative way to model the origin / destination zones, without increasing the running time, would be to assume that the agents are leaving from a random node in the origin zone and are arriving at the center point of the destination zone. This alternative model being asymmetric, it could produce strange results when simulating both the morning and evening commute. Origins and Destinations for Public-Transit ------------------------------------------- In the public-transit network, there can be multiple main stations in each zone. With the same center point assumption as with cars, some main stations might never be taken as they are two far away from the center of the zone so agents will always board and alight from a closer station. Additionally, the running time of the simulator for public transit is proportional to the number of agents, independently of the number of unique origin / destination points, allowing for more fine-tuned assumptions. For each agent, the simulator needs only to know the constant travel-time between their origin / destination and the closest main stations. This can be done in multiple ways. The walking network is known ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When the walking network is known, the simulator can affect each agent randomly to one of the node of the walking network inside the origin / destination zone and compute travel times to the closest main stations, using mixed walking and secondary public-transit routing. Only walking travel-times are known ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When the walking network is not known, an alternative input is to tell the constant walking travel-time (or, similarly, secondary public-transit network travel-time) from :math:`k` points in the origin / destination zone to the closest main stations. Then, agents are randomly affected to one of the :math:`k` point in their origin and destination zone. The probability to be affected to one point in a zone is either uniform or proportional to a given value. Walking travel-times are unknown ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ When neither the walking network nor the walking travel-times are known, the agents are randomly affected to one of the main stations in their origin and destination zone. Then, agents can only start their trip from their origin station and end their trip at their destination station, i.e., they cannot start their trip by walking to another station. The probability to be affected to one of the stations is either uniform or proportional to a given value. If a zone has no main station in it, then no public-transit trip can start / arrive at this zone. Intra-Zone Trips ---------------- Intra-zone trips are trips of agents whose destination is the same as their origin. For car trips, intra-zone trips would have a null travel-time so they are not simulated. For public-transit trips, intra-zone trips could be simulated as the actual origin point can be different from the actual destination point. However, the mode choice would be difficult to simulate in this case (what would be the utility of traveling by car?). Therefore, intra-zone trips are excluded from the simulator but the users can send as input the mode choice and travel times of agents with intra-zone trips so that these trips are included in the aggregated results.