traci._rerouter

 1# -*- coding: utf-8 -*-
 2# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
 3# Copyright (C) 2008-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
14# @file    _rerouter.py
15# @author  Yun-Pang Floetteroed
16# @author  Angelo Banse Bueno
17# @author  Michael Behrisch
18# @date    2020-08-18
19
20from __future__ import absolute_import
21from . import constants as tc
22from .domain import Domain
23
24
25class RerouterDomain(Domain):
26
27    def __init__(self):
28        Domain.__init__(self, "rerouter", tc.CMD_GET_REROUTER_VARIABLE, tc.CMD_SET_REROUTER_VARIABLE,
29                        tc.CMD_SUBSCRIBE_REROUTER_VARIABLE, tc.RESPONSE_SUBSCRIBE_REROUTER_VARIABLE,
30                        tc.CMD_SUBSCRIBE_REROUTER_CONTEXT, tc.RESPONSE_SUBSCRIBE_REROUTER_CONTEXT)
31
32    # def getEdges(self, routeID):
33    #     """getEdges(string) -> tuple(string)
34
35    #     Returns a tuple of all edges in the route.
36    #     """
37    #     return self._getUniversal(tc.VAR_EDGES, routeID)
38
39    # def add(self, routeID, edges):
40    #     """add(string, list(string)) -> None
41
42    #     Adds a new route with the given id consisting of the given list of edge IDs.
43    #     """
44    #     self._setCmd(tc.ADD, routeID, "l", edges)
class RerouterDomain(traci.domain.Domain):
26class RerouterDomain(Domain):
27
28    def __init__(self):
29        Domain.__init__(self, "rerouter", tc.CMD_GET_REROUTER_VARIABLE, tc.CMD_SET_REROUTER_VARIABLE,
30                        tc.CMD_SUBSCRIBE_REROUTER_VARIABLE, tc.RESPONSE_SUBSCRIBE_REROUTER_VARIABLE,
31                        tc.CMD_SUBSCRIBE_REROUTER_CONTEXT, tc.RESPONSE_SUBSCRIBE_REROUTER_CONTEXT)
32
33    # def getEdges(self, routeID):
34    #     """getEdges(string) -> tuple(string)
35
36    #     Returns a tuple of all edges in the route.
37    #     """
38    #     return self._getUniversal(tc.VAR_EDGES, routeID)
39
40    # def add(self, routeID, edges):
41    #     """add(string, list(string)) -> None
42
43    #     Adds a new route with the given id consisting of the given list of edge IDs.
44    #     """
45    #     self._setCmd(tc.ADD, routeID, "l", edges)