Ejemplo n.º 1
0
import os
import sys
import traci
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simlib import setUpSimulation

setUpSimulation("../maps/NormalIntersection/NormalIntersection.sumocfg",3)
step = 0
while step < 5000:
    traci.simulationStep()
    step += 1

traci.close()
Ejemplo n.º 2
0
import os
import sys
import traci
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simulationmanager import SimulationManager
from src.simlib import setUpSimulation

setUpSimulation(
    "../maps/BlackwellTunnelNorthApproach_no_TLS/BlackwellTunnelNorthApproach_no_TLS.sumocfg",
    1)
step = 0
manager = SimulationManager(True, True, False)
while step < 5000:
    manager.handleSimulationStep()
    traci.simulationStep()
    step += 1

traci.close()
import os
import sys
import traci
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simulationmanager import SimulationManager
from src.simlib import setUpSimulation

setUpSimulation("../maps/NormalIntersection_no_TLS/NormalIntersection_no_TLS.sumocfg",3)
step = 0
manager = SimulationManager()
while step < 5000:
    manager.handleSimulationStep()
    traci.simulationStep()
    step += 1

traci.close()
import os
import sys
import traci
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simlib import setUpSimulation

setUpSimulation(
    "../maps/BlackwellTunnelNorthApproach/BlackwellTunnelNorthApproach.sumocfg"
)
step = 0
while step < 5000:
    traci.simulationStep()
    step += 1

traci.close()
Ejemplo n.º 5
0
import sys
import traci
import traci.constants as tc
import sumolib
import logging

# recommend reading in this order:
# scenario file ----> simulation manager ---> vehicle ---> platoon ---> intersection controller

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simulationmanager import SimulationManager
from src.simlib import setUpSimulation
import src.BaseDefine as BaseDefine

platoonFlag = True
setUpSimulation("../maps/NormalIntersection_no_TLS_simple/NormalIntersection_no_TLS.sumocfg",1,platoonFlag)

step = 0
manager = SimulationManager(True, True, False)

# set junction listener
# junction in the map: gnej15
junctionID = 'gneJ15'
traci.junction.subscribeContext(junctionID, tc.CMD_GET_VEHICLE_VARIABLE, BaseDefine.JunctionDetectionRange,
                                [tc.VAR_SPEED, tc.VAR_WAITING_TIME])
print(traci.junction.getContextSubscriptionResults(junctionID))

while step < BaseDefine.MaxStep:
    manager.handleSimulationStep()
    traci.simulationStep()
    # monitor output
Ejemplo n.º 6
0
import os
import sys
import traci

sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from src.simulationmanager import SimulationManager
from src.simlib import setUpSimulation

setUpSimulation(
    "../maps/A13NorthCircularRoundabout_no_TLS/A13NorthCircularRoundabout_no_TLS.sumocfg",
    1)
step = 0
manager = SimulationManager()
while step < 5000:
    manager.handleSimulationStep()
    traci.simulationStep()
    step += 1

traci.close()