Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROCCHMetrics.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// The CCH metric store of the router applications (duarouter, marouter):
19// thin static trampolines (CCHRouter's MetricProvider, PeriodEnd and reset
20// hooks are plain function pointers) over the shared CCHMetricFamily in
21// STATIC mode -- lazy per-(vehicle type, weight period) customization,
22// filled with the querying vehicle, with the restriction-params edges of a
23// type masked to inf_weight by a post-fill patch. marouter has no weight
24// periods but changes the travel times after every assignment iteration and
25// resets its router there: the reset flags every metric for
26// re-customization on the next query. See utils/router/CCHMetricFamily.h
27// for the semantics.
28/****************************************************************************/
29#pragma once
30#include <config.h>
31
36
37class ROEdge;
38class ROVehicle;
40
41
42// ===========================================================================
43// class definitions
44// ===========================================================================
50
51
57public:
60 static void init(const ROCCHGraph* graph, ROCCHGraph::EffortOperation effort,
61 SUMOTime begin, SUMOTime weightPeriod);
62
66 SUMOVehicleClass vClass, SUMOTime time, const ROVehicle* veh);
67
70 static SUMOTime periodEnd(SUMOTime time);
71
75 static void reset(const ROVehicle* veh);
76
77private:
80 static void patchRestrictions(const ROCCHGraph* graph, const ROVehicle* veh,
81 std::vector<unsigned>& weights);
82
84};
long long int SUMOTime
Definition GUI.h:36
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Metric-independent RoutingKit CCH topology over the PURE road graph.
Definition CCHGraph.h:86
double(* EffortOperation)(const E *const, const V *const, double)
effort callback signature, matching SUMOAbstractRouter::Operation
Definition CCHGraph.h:89
per-vehicle-type CCH metric store over a shared CCHGraph
function-pointer front end of the router applications' STATIC metric family
static SUMOTime periodEnd(SUMOTime time)
the end of the weight period containing the given time (SUMOTime_MAX when the weights are static); CC...
static void reset(const ROVehicle *veh)
the edge weights changed behind the metrics (marouter after an assignment iteration,...
static void patchRestrictions(const ROCCHGraph *graph, const ROVehicle *veh, std::vector< unsigned > &weights)
post-fill hook: mask the edges that restrict the querying vehicle's type to inf_weight (restriction-p...
static ROCCHMetricFamily * myFamily
static void init(const ROCCHGraph *graph, ROCCHGraph::EffortOperation effort, SUMOTime begin, SUMOTime weightPeriod)
install the shared graph, effort function and weight-period grid (call once, before routing); weightP...
static const RoutingKit::CustomizableContractionHierarchyMetric * get(SUMOVehicleClass vClass, SUMOTime time, const ROVehicle *veh)
the metric for the vehicle's type at a query time, built on first use; matches CCHRouter::MetricProvi...
A basic edge for routing applications.
Definition ROEdge.h:73
A vehicle as used by router.
Definition ROVehicle.h:51
Structure representing possible vehicle parameter.
const Graph * graph