[SUMO Study] Loop Detector 만들어 교통량 측정하기
시뮬레이션을 수행하고 나면, 얼만큼의 차량이 해당 도로를 통과하였는지, 속도는 몇 km/h였는지 확인할 필요가 있다. 이를 측정하기 위해 가장 간단한 Loop detector(루프 검지기)를 설치하는 방법을 알아보고자 한다.
netedit로 Loop detector를 설치하는 방법이 있을 것(?)으로 생각되지만,
보다 더 간단하게 add.xml 파일을 만들어서 설치하도록 하자.
먼저 아래와 같이 길이가 3km인 2차로 고속도로가 있다고 가정하자.
(Edge 아이디: 상류부 100m: entry, 하류부 2900m: exit)
add.xml 파일을 만들어 아래 코드를 입력한다. (Loop detector를 "exit" 라는 Edge에 도입한다는 코드)
<additional>
<inductionLoop id="Lane 1" lane="exit_1" pos="1500" period="3600" file="Capacity_0422.xml"/>
<inductionLoop id="Lane 2" lane="exit_0" pos="1500" period="3600" file="Capacity_0422.xml"/>
</additional>
도입하고 나면, 아래 Loop detector가 해당 위치에 생기게 된다(아래 그림은 sumocfg 파일이다)
여기서 file="Capacity_0422.xml"은 output이 생성될 파일이다.
(xml 파일 말고, csv 파일을 해도 무방하다 - 그러나 파일 형식은 xml이므로 변환이 필요하다)
add.xml 파일을 만들고 나면, 이 파일을 sumocfg 코드에 추가시키기만 하면 된다.
시뮬레이션을 수행하고 나면 아래와 같이 결과를 얻게 된다.
각각 옵션에 대해서는 아래 SUMO Documentation을 참고하여 익히도록 하자.
https://sumo.dlr.de/docs/Simulation/Output/Induction_Loops_Detectors_%28E1%29.html
Induction Loops Detectors (E1) - SUMO Documentation
1.1.0 --> Induction Loops Detectors (E1) Induction Loops Detectors (E1) Instantiating within the Simulation An induction loop is defined this way within an additional-file like this: The "id" is any string by which you can name the detector. The attributes
sumo.dlr.de