traci.domain
index
/home/delphi/gcc/sumo/tools/traci/domain.py

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
# Copyright (C) 2008-2024 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
https://www.eclipse.org/legal/epl-2.0/
# This Source Code may also be made available under the following Secondary
# Licenses when the conditions for such availability set forth in the Eclipse
# Public License 2.0 are satisfied: GNU General Public License, version 2
# or later which is available at
https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later

 
Modules
       
copy
traci.constants
warnings

 
Classes
       
builtins.object
Domain
SubscriptionResults

 
class Domain(builtins.object)
    Domain(name, cmdGetID, cmdSetID, subscribeID, subscribeResponseID, contextID, contextResponseID, retValFunc=None, deprecatedFor=None, subscriptionDefault=(0,))
 

 
  Methods defined here:
__init__(self, name, cmdGetID, cmdSetID, subscribeID, subscribeResponseID, contextID, contextResponseID, retValFunc=None, deprecatedFor=None, subscriptionDefault=(0,))
Initialize self.  See help(type(self)) for accurate signature.
getAllContextSubscriptionResults(self)
getAllSubscriptionResults(self)
getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))
 
Returns the subscription results for the last time step and all objects of the domain.
It is not possible to retrieve older subscription results than the ones
from the last time step.
getContextSubscriptionResults(self, objectID)
getIDCount(self)
getIDCount() -> integer
 
Returns the number of currently loaded objects.
getIDList(self)
getIDList() -> list(string)
 
Returns a list of all objects in the network.
getParameter(self, objectID, key)
getParameter(string, string) -> string
 
Returns the value of the given parameter for the given objectID
getParameterWithKey(self, objectID, key)
getParameterWithKey(string, string) -> (string, string)
 
Returns the (key, value) tuple of the given parameter for the given objectID
getSubscriptionResults(self, objectID)
getSubscriptionResults(string) -> dict(integer: <value_type>)
 
Returns the subscription results for the last time step and the given object.
If the object id is unknown or the subscription did for any reason return no data,
'None' is returned.
It is not possible to retrieve older subscription results than the ones
from the last time step.
setParameter(self, objectID, key, value)
setParameter(string, string, string) -> None
 
Sets the value of the given parameter to value for the given objectID
subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0, parameters=None)
subscribe(string, list(integer), double, double, map(string->tuple)) -> None
 
Subscribe to one or more object values for the given interval.
subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0, parameters=None)
subscribeContext(string, int, double, list(integer), double, double) -> None
 
Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
which are closer than dist to the object specified by objectID.
subscribeParameterWithKey(self, objectID, key, begin=-1073741824.0, end=-1073741824.0)
subscribeParameterWithKey(string, string) -> None
 
Subscribe for a generic parameter with the given key.
unsubscribe(self, objectID)
unsubscribe(string) -> None
 
Unsubscribe from receiving object values.
unsubscribeContext(self, objectID, domain, dist)

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class SubscriptionResults(builtins.object)
    SubscriptionResults(valueFunc)
 

 
  Methods defined here:
__init__(self, valueFunc)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).
add(self, refID, varID, data)
addContext(self, refID, objectID=None, varID=None, data=None)
get(self, refID=None)
getContext(self, refID=None)
reset(self)

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
Data
        DOMAINS = [<traci._busstop.BusStopDomain object>, <traci._calibrator.CalibratorDomain object>, <traci._chargingstation.ChargingStationDomain object>, <traci._edge.EdgeDomain object>, <traci._gui.GuiDomain object>, <traci._inductionloop.InductionLoopDomain object>, <traci._junction.JunctionDomain object>, <traci._lane.LaneDomain object>, <traci._lanearea.LaneAreaDomain object>, <traci._meandata.MeanDataDomain object>, <traci._multientryexit.MultiEntryExitDomain object>, <traci._overheadwire.OverheadWireDomain object>, <traci._parkingarea.ParkingAreaDomain object>, <traci._person.PersonDomain object>, <traci._poi.PoiDomain object>, <traci._polygon.PolygonDomain object>, <traci._rerouter.RerouterDomain object>, <traci._route.RouteDomain object>, <traci._routeprobe.RouteProbeDomain object>, <traci._simulation.SimulationDomain object>, ...]
DOMAIN_BY_ID = {36: <traci._parkingarea.ParkingAreaDomain object>, 37: <traci._chargingstation.ChargingStationDomain object>, 38: <traci._routeprobe.RouteProbeDomain object>, 39: <traci._calibrator.CalibratorDomain object>, 40: <traci._rerouter.RerouterDomain object>, 41: <traci._variablespeedsign.VariableSpeedSignDomain object>, 42: <traci._meandata.MeanDataDomain object>, 43: <traci._overheadwire.OverheadWireDomain object>, 160: <traci._inductionloop.InductionLoopDomain object>, 161: <traci._multientryexit.MultiEntryExitDomain object>, ...}