• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python traci._sendExact函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中traci._sendExact函数的典型用法代码示例。如果您正苦于以下问题:Python _sendExact函数的具体用法?Python _sendExact怎么用?Python _sendExact使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_sendExact函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: add

def add(routeID, edges):
    traci._beginMessage(tc.CMD_SET_ROUTE_VARIABLE, tc.ADD, routeID,
                        1+4+sum(map(len, edges))+4*len(edges))
    traci._message.string += struct.pack("!Bi", tc.TYPE_STRINGLIST, len(edges))
    for e in edges:
        traci._message.string += struct.pack("!i", len(e)) + e
    traci._sendExact()
开发者ID:flemouel,项目名称:Social-Vehicular-Network,代码行数:7,代码来源:route.py


示例2: setCompleteRedYellowGreenDefinition

def setCompleteRedYellowGreenDefinition(tlsID, tls):
    """setCompleteRedYellowGreenDefinition(string, ) -> None

    .
    """
    length = 1 + 4 + 1 + 4 + \
        len(tls._subID) + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 4  # tls parameter
    itemNo = 1 + 1 + 1 + 1 + 1
    for p in tls._phases:
        length += 1 + 4 + 1 + 4 + 1 + 4 + 1 + 4 + len(p._phaseDef)
        itemNo += 4
    traci._beginMessage(
        tc.CMD_SET_TL_VARIABLE, tc.TL_COMPLETE_PROGRAM_RYG, tlsID, length)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, itemNo)
    # programID
    traci._message.string += struct.pack("!Bi",
                                         tc.TYPE_STRING, len(tls._subID)) + str(tls._subID)
    traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, 0)  # type
    # subitems
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 0)
    # index
    traci._message.string += struct.pack("!Bi",
                                         tc.TYPE_INTEGER, tls._currentPhaseIndex)
    # phaseNo
    traci._message.string += struct.pack("!Bi",
                                         tc.TYPE_INTEGER, len(tls._phases))
    for p in tls._phases:
        traci._message.string += struct.pack("!BiBiBi", tc.TYPE_INTEGER,
                                             p._duration, tc.TYPE_INTEGER, p._duration1, tc.TYPE_INTEGER, p._duration2)
        traci._message.string += struct.pack("!Bi",
                                             tc.TYPE_STRING, len(p._phaseDef)) + str(p._phaseDef)
    traci._sendExact()
开发者ID:sequielo,项目名称:sumo,代码行数:32,代码来源:trafficlights.py


示例3: moveTo

def moveTo(vehID, laneID, pos):
    traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE,
                        tc.VAR_MOVE_TO, vehID, 1 + 4 + 1 + 4 + len(laneID) + 1 + 8)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2)
    traci._message.packString(laneID)
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, pos)
    traci._sendExact()
开发者ID:aarongolliver,项目名称:sumo,代码行数:7,代码来源:vehicle.py


示例4: setBoundary

def setBoundary(viewID, xmin, ymin, xmax, ymax):
    """setBoundary(string, double, double, double, double) -> None
    
    Set the current boundary for the given view (see getBoundary()).
    """
    traci._beginMessage(tc.CMD_SET_GUI_VARIABLE, tc.VAR_VIEW_BOUNDARY, viewID, 1+8+8+8+8)
    traci._message.string += struct.pack("!Bdddd", tc.TYPE_BOUNDINGBOX, xmin, ymin, xmax, ymax)
    traci._sendExact()
开发者ID:cathyyul,项目名称:sumo-0.18,代码行数:8,代码来源:gui.py


示例5: setPosition

def setPosition(poiID, x, y):
    """setPosition(string, (double, double)) -> None
    
    Sets the position coordinates of the poi. 
    """
    traci._beginMessage(tc.CMD_SET_POI_VARIABLE, tc.VAR_POSITION, poiID, 1+8+8)
    traci._message.string += struct.pack("!Bdd", tc.POSITION_2D, x, y)
    traci._sendExact()
开发者ID:florianjomrich,项目名称:veinsSimConnectionToUnity,代码行数:8,代码来源:poi.py


示例6: setColor

def setColor(typeID, color):
    """setColor(string, (integer, integer, integer, integer)) -> None
    
    Sets the color of this type.
    """
    traci._beginMessage(tc.CMD_SET_VEHICLETYPE_VARIABLE, tc.VAR_COLOR, typeID, 1+1+1+1+1)
    traci._message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3]))
    traci._sendExact()
开发者ID:harora,项目名称:ITS,代码行数:8,代码来源:vehicletype.py


示例7: setOffset

def setOffset(viewID, x, y):
    """setOffset(string, double, double) -> None
    
    Set the current offset for the given view.
    """
    traci._beginMessage(tc.CMD_SET_GUI_VARIABLE, tc.VAR_VIEW_OFFSET, viewID, 1+8+8)
    traci._message.string += struct.pack("!Bdd", tc.POSITION_2D, x, y)
    traci._sendExact()
开发者ID:cathyyul,项目名称:sumo-0.18,代码行数:8,代码来源:gui.py


示例8: setColor

def setColor(poiID, color):
    """setColor(string, (integer, integer, integer, integer)) -> None
    
    Sets the rgba color of the poi.
    """
    traci._beginMessage(tc.CMD_SET_POI_VARIABLE, tc.VAR_COLOR, poiID, 1+1+1+1+1)
    traci._message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3]))
    traci._sendExact()
开发者ID:florianjomrich,项目名称:veinsSimConnectionToUnity,代码行数:8,代码来源:poi.py


示例9: moveToVTD

def moveToVTD(vehID, edgeID, lane, x, y):
    traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_MOVE_TO_VTD, vehID, 1+4+1+4+len(edgeID)+1+4+1+8+1+8)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 4)
    traci._message.string += struct.pack("!Bi", tc.TYPE_STRING, len(edgeID)) + edgeID
    traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, lane)    
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, x)
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, y)
    traci._sendExact()
开发者ID:p1tt1,项目名称:sumo,代码行数:8,代码来源:vehicle.py


示例10: adaptTraveltime

def adaptTraveltime(edgeID, time):
    """adaptTraveltime(string, double) -> None

    Adapt the travel time value (in s) used for (re-)routing for the given edge.
    """
    traci._beginMessage(tc.CMD_SET_EDGE_VARIABLE, tc.VAR_EDGE_TRAVELTIME, edgeID, 1 + 4 + 1 + 8)
    traci._message.string += struct.pack("!BiBd", tc.TYPE_COMPOUND, 1, tc.TYPE_DOUBLE, time)
    traci._sendExact()
开发者ID:sequielo,项目名称:sumo,代码行数:8,代码来源:edge.py


示例11: setEffort

def setEffort(edgeID, effort):
    """setEffort(string, double) -> None

    Adapt the effort value used for (re-)routing for the given edge.
    """
    traci._beginMessage(tc.CMD_SET_EDGE_VARIABLE, tc.VAR_EDGE_EFFORT, edgeID, 1 + 4 + 1 + 8)
    traci._message.string += struct.pack("!BiBd", tc.TYPE_COMPOUND, 1, tc.TYPE_DOUBLE, effort)
    traci._sendExact()
开发者ID:sequielo,项目名称:sumo,代码行数:8,代码来源:edge.py


示例12: add

def add(poiID, x, y, color, poiType="", layer=0):
    traci._beginMessage(tc.CMD_SET_POI_VARIABLE, tc.ADD, poiID, 1+4 + 1+4+len(poiType) + 1+1+1+1+1 + 1+4 + 1+8+8)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 4)
    traci._message.string += struct.pack("!Bi", tc.TYPE_STRING, len(poiType)) + poiType
    traci._message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3]))
    traci._message.string += struct.pack("!Bi", tc.TYPE_INTEGER, layer)
    traci._message.string += struct.pack("!Bdd", tc.POSITION_2D, x, y)
    traci._sendExact()
开发者ID:nnaren1902,项目名称:Secure-Vehicle-Platoon,代码行数:8,代码来源:poi.py


示例13: setType

def setType(poiID, poiType):
    """setType(string, string) -> None
    
    Sets the (abstract) type of the poi.
    """
    traci._beginMessage(tc.CMD_SET_POI_VARIABLE, tc.VAR_TYPE, poiID, 1+4+len(poiType))
    traci._message.string += struct.pack("!Bi", tc.TYPE_STRING, len(poiType)) + poiType
    traci._sendExact()
开发者ID:florianjomrich,项目名称:veinsSimConnectionToUnity,代码行数:8,代码来源:poi.py


示例14: setColor

def setColor(vehID, color):
    """setColor(string, (integer, integer, integer, integer))
    sets color for vehicle with the given ID.
    i.e. (255,0,0,0) for the color red. 
    The fourth integer (alpha) is currently ignored
    """
    traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_COLOR, vehID, 1+1+1+1+1)
    traci._message.string += struct.pack("!BBBBB", tc.TYPE_COLOR, int(color[0]), int(color[1]), int(color[2]), int(color[3]))
    traci._sendExact()
开发者ID:p1tt1,项目名称:sumo,代码行数:9,代码来源:vehicle.py


示例15: setType

def setType(poiID, poiType):
    """setType(string, string) -> None

    Sets the (abstract) type of the poi.
    """
    traci._beginMessage(
        tc.CMD_SET_POI_VARIABLE, tc.VAR_TYPE, poiID, 1 + 4 + len(poiType))
    traci._message.packString(poiType)
    traci._sendExact()
开发者ID:aarongolliver,项目名称:sumo,代码行数:9,代码来源:poi.py


示例16: add

def add(routeID, edges):
    """add(string, list(string)) -> None

    Adds a new route with the given id consisting of the given list of edge IDs.
    """
    traci._beginMessage(tc.CMD_SET_ROUTE_VARIABLE, tc.ADD, routeID,
                        1 + 4 + sum(map(len, edges)) + 4 * len(edges))
    traci._message.packStringList(edges)
    traci._sendExact()
开发者ID:aarongolliver,项目名称:sumo,代码行数:9,代码来源:route.py


示例17: resume

def resume(vehID):
    """resume(string) -> None

    Resumes the vehicle from the current stop (throws an error if the vehicle is not stopped).
    """
    traci._beginMessage(
        tc.CMD_SET_VEHICLE_VARIABLE, tc.CMD_RESUME, vehID, 1 + 4)
    traci._message.string += struct.pack("!Bi", tc.TYPE_COMPOUND, 0)
    traci._sendExact()
开发者ID:aarongolliver,项目名称:sumo,代码行数:9,代码来源:vehicle.py


示例18: setEffort

def setEffort(vehID, begTime, endTime, edgeID, effort):
    """setEffort(string, double, string, double) -> None
    
    .
    """
    traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_EDGE_EFFORT, vehID, 1+4+1+4+1+4+1+4+len(edgeID)+1+4)
    traci._message.string += struct.pack("!BiBiBiBi", tc.TYPE_COMPOUND, 4, tc.TYPE_INTEGER, begTime,
                                         tc.TYPE_INTEGER, endTime, tc.TYPE_STRING, len(edgeID)) + edgeID
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, effort)
    traci._sendExact()
开发者ID:p1tt1,项目名称:sumo,代码行数:10,代码来源:vehicle.py


示例19: setAdaptedTraveltime

def setAdaptedTraveltime(vehID, begTime, endTime, edgeID, time):
    """setAdaptedTraveltime(string, double, string, double) -> None
    
    .
    """
    traci._beginMessage(tc.CMD_SET_VEHICLE_VARIABLE, tc.VAR_EDGE_TRAVELTIME, vehID, 1+4+1+4+1+4+1+4+len(edgeID)+1+8)
    traci._message.string += struct.pack("!BiBiBiBi", tc.TYPE_COMPOUND, 4, tc.TYPE_INTEGER, begTime,
                                         tc.TYPE_INTEGER, endTime, tc.TYPE_STRING, len(edgeID)) + edgeID
    traci._message.string += struct.pack("!Bd", tc.TYPE_DOUBLE, time)
    traci._sendExact()
开发者ID:p1tt1,项目名称:sumo,代码行数:10,代码来源:vehicle.py


示例20: setShape

def setShape(polygonID, shape):
    """setShape(string, list((double, double))) -> None
    
    Sets the shape (list of 2D-positions) of this polygon.
    """
    traci._beginMessage(tc.CMD_SET_POLYGON_VARIABLE, tc.VAR_SHAPE, polygonID, 1 + 1 + len(shape) * (8 + 8))
    traci._message.string += struct.pack("!BB", tc.TYPE_POLYGON, len(shape))
    for p in shape:
        traci._message.string += struct.pack("!dd", p)
    traci._sendExact()
开发者ID:harora,项目名称:ITS,代码行数:10,代码来源:polygon.py



注:本文中的traci._sendExact函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python traci._sendReadOneStringCmd函数代码示例发布时间:2022-05-27
下一篇:
Python traci._sendDoubleCmd函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap