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

# -*- coding: utf-8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
# Copyright (C) 2011-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
       
traci.constants

 
Classes
       
traci.domain.Domain(builtins.object)
PolygonDomain

 
class PolygonDomain(traci.domain.Domain)
    
Method resolution order:
PolygonDomain
traci.domain.Domain
builtins.object

Methods defined here:
__init__(self)
Initialize self.  See help(type(self)) for accurate signature.
add(self, polygonID, shape, color, fill=False, polygonType='', layer=0, lineWidth=1)
add(string,  list((double, double)), (integer, integer, integer, integer), bool, string, integer, double) -> None
Adds a new polygon.
addDynamics(self, polygonID, trackedObjectID='', timeSpan=(), alphaSpan=(), looped=False, rotate=True)
addDynamics(string, string, list(float), list(float), bool) -> void
polygonID - ID of the polygon, upon which the specified dynamics shall act
trackedObjectID - ID of a SUMO traffic object, which shall be tracked by the polygon
timeSpan - list of time points for timing the animation keyframes (must start with element zero)
           If it has length zero, no animation is taken into account.
alphaSpan - list of alpha values to be attained at keyframes intermediate values are
            obtained by linear interpolation. Must have length equal to timeSpan, or zero
            if no alpha animation is desired.
looped - Whether the animation should restart when the last keyframe is reached. In that case
         the animation jumps to the first keyframe as soon as the last is reached.
         If looped==false, the controlled polygon is removed as soon as the timeSpan elapses.
rotate - Whether, the polygon should be rotated with the tracked object (only applies when such is given)
         The center of rotation is the object's position.
getColor(self, polygonID)
getColor(string) -> (integer, integer, integer, integer)
 
Returns the rgba color of this polygon.
getFilled(self, polygonID)
getFilled(string) -> bool
Returns whether the polygon is filled
getLineWidth(self, polygonID)
getLineWidth(string) -> double
Returns drawing width of unfilled polygon
getShape(self, polygonID)
getShape(string) -> list((double, double))
 
Returns the shape (list of 2D-positions) of this polygon.
getType(self, polygonID)
getType(string) -> string
 
Returns the (abstract) type of the polygon.
remove(self, polygonID, layer=0)
remove(string, integer) -> None
Removes a polygon with the given ID
setColor(self, polygonID, color)
setColor(string, (integer, integer, integer, integer)) -> None
 
Sets the rgba color of this polygon, i.e. (255,0,0) for the color red.
The fourth component (alpha) is optional.
setFilled(self, polygonID, filled)
setFilled(string, bool) -> None
Sets the filled status of the polygon
setLineWidth(self, polygonID, lineWidth)
setLineWidth(string, double) -> None
Sets the line width for drawing unfilled polygon
setShape(self, polygonID, shape)
setShape(string, list((double, double))) -> None
 
Sets the shape (list of 2D-positions) of this polygon.
setType(self, polygonID, polygonType)
setType(string, string) -> None
 
Sets the (abstract) type of the polygon.

Methods inherited from traci.domain.Domain:
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 inherited from traci.domain.Domain:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 262144)