Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
print(" initialAwareness = %s" % initialAwareness)
print(" mrmDecel = %s" % mrmDecel)
print("Dynamic parameters:")
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
print(" initialAwareness = %s" % initialAwareness)
print(" mrmDecel = %s" % mrmDecel)
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
print(" initialAwareness = %s" % initialAwareness)
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time step %s" % traci.simulation.getCurrentTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
print(" initialAwareness = %s" % initialAwareness)
print(" mrmDecel = %s" % mrmDecel)
new_initialAwareness = 0.06
traci.vehicle.setParameter(vehID, "device.driverstate.initialAwareness", str(new_initialAwareness))
initialAwareness = float(traci.vehicle.getParameter(vehID, "device.driverstate.initialAwareness"))
print("new initialAwareness:%s (diff=%s)" % (initialAwareness, initialAwareness - new_initialAwareness))
new_errorTimeScaleCoefficient = 0.11
traci.vehicle.setParameter(vehID, "device.driverstate.errorTimeScaleCoefficient",
str(new_errorTimeScaleCoefficient))
errorTimeScaleCoefficient = float(traci.vehicle.getParameter(vehID, "device.driverstate.errorTimeScaleCoefficient"))
print("new errorTimeScaleCoefficient:%s (diff=%s)" %
(errorTimeScaleCoefficient, errorTimeScaleCoefficient - new_errorTimeScaleCoefficient))
new_errorNoiseIntensityCoefficient = 0.22
traci.vehicle.setParameter(vehID, "device.driverstate.errorNoiseIntensityCoefficient",
str(new_errorNoiseIntensityCoefficient))
errorNoiseIntensityCoefficient = float(traci.vehicle.getParameter(
vehID, "device.driverstate.errorNoiseIntensityCoefficient"))
print("new errorNoiseIntensityCoefficient:%s (diff=%s)" %
(errorNoiseIntensityCoefficient, errorNoiseIntensityCoefficient - new_errorNoiseIntensityCoefficient))
new_speedDifferenceErrorCoefficient = 0.33
traci.vehicle.setParameter(vehID, "device.driverstate.speedDifferenceErrorCoefficient",
str(new_speedDifferenceErrorCoefficient))
speedDifferenceErrorCoefficient = float(traci.vehicle.getParameter(
vehID, "device.driverstate.speedDifferenceErrorCoefficient"))
print("new speedDifferenceErrorCoefficient:%s (diff=%s)" %
(speedDifferenceErrorCoefficient, speedDifferenceErrorCoefficient - new_speedDifferenceErrorCoefficient))
new_headwayErrorCoefficient = 0.44
traci.vehicle.setParameter(vehID, "device.driverstate.headwayErrorCoefficient", str(new_headwayErrorCoefficient))
headwayErrorCoefficient = float(traci.vehicle.getParameter(vehID, "device.driverstate.headwayErrorCoefficient"))
print("new headwayErrorCoefficient:%s (diff=%s)" %
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
def printToCParams(vehID, only_dynamic=False):
holder = traci.vehicle.getParameter(vehID, "device.toc.holder")
manualType = traci.vehicle.getParameter(vehID, "device.toc.manualType")
automatedType = traci.vehicle.getParameter(vehID, "device.toc.automatedType")
responseTime = traci.vehicle.getParameter(vehID, "device.toc.responseTime")
recoveryRate = traci.vehicle.getParameter(vehID, "device.toc.recoveryRate")
initialAwareness = traci.vehicle.getParameter(vehID, "device.toc.initialAwareness")
mrmDecel = traci.vehicle.getParameter(vehID, "device.toc.mrmDecel")
currentAwareness = traci.vehicle.getParameter(vehID, "device.toc.currentAwareness")
state = traci.vehicle.getParameter(vehID, "device.toc.state")
speed = traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("ToC device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")
print(" holder = %s" % holder)
print(" manualType = %s" % manualType)
print(" automatedType = %s" % automatedType)
print(" responseTime = %s" % responseTime)
print(" recoveryRate = %s" % recoveryRate)
print(" initialAwareness = %s" % initialAwareness)
print(" mrmDecel = %s" % mrmDecel)
print("Dynamic parameters:")
print(" currentAwareness = %s" % currentAwareness)
def printParams(vehID, only_dynamic=False):
awareness = traci.vehicle.getParameter(vehID, "device.driverstate.awareness")
errorState = traci.vehicle.getParameter(vehID, "device.driverstate.errorState")
errorTimeScale = traci.vehicle.getParameter(vehID, "device.driverstate.errorTimeScale")
errorNoiseIntensity = traci.vehicle.getParameter(vehID, "device.driverstate.errorNoiseIntensity")
minAwareness = traci.vehicle.getParameter(vehID, "device.driverstate.minAwareness")
initialAwareness = traci.vehicle.getParameter(vehID, "device.driverstate.initialAwareness")
errorTimeScaleCoefficient = traci.vehicle.getParameter(vehID, "device.driverstate.errorTimeScaleCoefficient")
errorNoiseIntensityCoefficient = traci.vehicle.getParameter(
vehID, "device.driverstate.errorNoiseIntensityCoefficient")
speedDifferenceErrorCoefficient = traci.vehicle.getParameter(
vehID, "device.driverstate.speedDifferenceErrorCoefficient")
headwayErrorCoefficient = traci.vehicle.getParameter(vehID, "device.driverstate.headwayErrorCoefficient")
speedDifferenceChangePerceptionThreshold = traci.vehicle.getParameter(
vehID, "device.driverstate.speedDifferenceChangePerceptionThreshold")
headwayChangePerceptionThreshold = traci.vehicle.getParameter(
vehID, "device.driverstate.headwayChangePerceptionThreshold")
maximalReactionTime = traci.vehicle.getParameter(
vehID, "device.driverstate.maximalReactionTime")
originalReactionTime = traci.vehicle.getParameter(
vehID, "device.driverstate.originalReactionTime")
actionStepLength = traci.vehicle.getParameter(
vehID, "device.driverstate.actionStepLength")
actionStepLengthVeh = traci.vehicle.getActionStepLength(vehID)
traci.vehicle.getSpeed(vehID)
print("time", traci.simulation.getTime())
print("Driver state device infos for vehicle '%s'" % vehID)
if not only_dynamic:
print("Static parameters:")