• 沒有找到結果。

6.1 結論

在過去的跟車理論文獻中只將對象鎖定為前車,本文跟車模式是參考 Sheu(2011) 所提出的量子力學流跟車模式,考慮駕駛者視覺對心智的負荷,將對象增加為前車和 旁車,並且考慮車量對於駕駛視線內所佔的面積,以實際攝影跟車資料進行參數校估,

並撰寫模式對模擬結果進行分析。本研究模擬以微觀觀點,採用單位時間掃描方式,

處理高速公路上以量子視覺流跟車模式進行車流行為之模擬。模擬範圍為直線高速公 路路段,可模擬大型車與小型車混合車流。在程式和模式驗證的部分,和實際資料比 較下,可發現模擬結果和實際的資料是在一個穩定的誤差範為內。而由情境模擬結果 發現,確實可以對於旁車對於駕駛所造成的分心影響進行解釋,且可發現對於整體車 流速度有明顯的影響。對於改變車流大型車和小型車的組成比例,來觀察車流模擬結 果是否會受到影響,結果顯示當車種比例差異夠大時,的確會對於駕駛的行為改變影 響車輛的速度和車間距有顯著的差異。由於只是初步的模擬車輛跟車模式的前進,沒 有考慮到其他容易改變車輛行為的因素,以利於觀察模式所帶來的影響,因此模擬數 據如行車平均速度大都是在首車的行車速率附近變動。

6.2 建議

1. 本研究模式進行之參數校估的資料收集,只針對本車和前車,仍有鄰近車道之車 流進行干擾,並且資料收集地點是位於市區,車速和模擬時所設定得期望速度有所差 距,若能夠選擇在較少車輛的高速公路路段進行資料收集的話,也許會產生不同的結 果。

2. 因考量到同一車道之間車輛會互相阻擋,本研究假設每個車道最多只會有一輛車 在駕駛的視野內,但實際上車輛可能只會有部分遭到阻擋,仍有部分面積出現在駕駛 的視線範圍內,期望將來研究者可探討當車輛受到部份遮掩時,對於駕駛者感受的影

56

響。

3. 模式中並未考量到車道變換的情形,當前方車輛變換車道或是本車變換車道時對 於駕駛這會造成何種影響,期望將來研究者能對變換車道時產生的影響進行研究。

4. 模式中所假設之心理質量是以和車輛背面面積成正比和車輛相對距離成反比,可 能實際上並不是以這種關係存在,並且如第 2 點所示,並不一定是車的背面映入駕駛 者的視野,期望能夠對於駕駛的心理質量能夠有更精確的定義。

5. 本研究假設模式中駕駛的驚覺心為一固定值,然而實際上警覺心會因為駕駛的各 種生理心理條件而改變,若能夠配合生理心理測量儀器,得到更多得精密的心理研究 資料,代表影響警覺心之因素,使得模式更為準確。

57

參考文獻

[1]Jiuh-Biing Sheu, Characterisation of driver behavior during car following using quantum optical flow theory,Transportmetrica, DOI:10.1080/18128602.2011.572571

[2]Robert G.V. Baker, On the quantum mechanics of optic flow and its application to driving in uncertain environment” Transportation research part F, 1999.

[3]Hoefs, D.H., Undersuchung des Fahrverhaltens in FahrzeugKolonnen,

Forchungsberichte des Institute fur Verkehrswesen, Heft 140,Universitate Karlsruhe,1972.

[4]Wiedemann, R., Modelling of RTI-elements on multi-lane roads. In the Commission of the European Community, Advanced Telematics in Road Transport, Vol. DG XIII.1991.

[5]Russel L.M. and M.L. Harold, “Simulation of Traffic Flow to Obtain Volume Warrants for Intersection Control”, HRR15, pp.1-43, 1963.

[6]Brackstone, M. and McDonald, M., Car-following: a historical review. Transportation Research Part F, 2, 181–196.1999

[7]邱明峰,高速公路事故發生時非事故車道上駕駛人感受與駕駛行為之研究,國立交 通大學交通運輸研究所碩士論文,民國96年6月

[8]陳俊鴻,以視覺模擬方式研究機車駕駛人於路段中之駕駛行為,台大土木 工程學研究所碩士論文,民國92 年6 月。

58

[9]張鈞華,模擬一般市區道路事故發生之微觀車流行為,台大土木工程學研究所碩 士論文,民國90年6月。

[10]鐘爵旭,駕駛者心智負荷模式之發展及驗證,國立交通大學交通運輸研究所碩士 論文,民國97年6月。

[11]周義華、陳天賜,「公車站對道路交通影響之研究-公車站對車流延滯之影響」,

運輸計畫季刊,11卷3期,pp.303~340,民國71年9月。

59

附錄 程式碼(turbo c)

#include<graphics.h>

#include<stdio.h>

#include<stdlib.h>

#include<time.h>

#include<math.h>

#define TOTALSECONDS 180

#define TIMESLICE 0.1

#define TOTALSTEPS (int)(TOTALSECONDS/TIMESLICE)

#define ROADLEN 1000.0

#define MAX_ACC 3.6

#define MAX_DEACC 7.2

#define MAX_SPEED 32

FILE *o;

struct node {

float x;

float y;

int car_seq;

float length;

float width;

float tall;

float car_type;

float v;

float a;

float ab;

struct node *head;

struct node *tail;

};

float normal(float ave,float dev);

struct node *c=NULL;

struct node *l=NULL;

60 struct node *r=NULL;

struct node *headc=NULL;

struct node *headl=NULL;

struct node *headr=NULL;

int C_laneGenerator(float,float,float);

int L_laneGenerator(float,float,float);

int R_laneGenerator(float,float,float);

int C_laneTransition();

int L_laneTransition();

int R_laneTransition();

float v_acc_car(float v0,float a,float t);

float x_acc_car(float x0,float v0,float a,float t);

float watchtime();

int hittime(float);

int STEPS;

int checkvision(struct node *car);

int check_car(struct node *car);

int check_carl(struct node *car);

int check_carr(struct node *car);

float visionx(float dxx, float dyy, float yy, float hyy);

float GauProb(float avex, float avey,

float devx,float devy, float carx, float cary);

void drawlane() {

int x;

struct node *current;

current = headl;

while(current!=NULL){

if(current->car_type==0){

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,27,x+3,29);

}

else if(current->car_type==1){

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,27,x+8,29);

61 }

else{

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,27,x+11,29);

}

current = current -> tail;

}

current = headc;

while(current!=NULL){

if(current->car_type==0){

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,35,x+3,37);

}

else if(current->car_type==1){

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,35,x+8,37);

} else{

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,35,x+11,37);

}

current = current -> tail;

}

current = headr;

while(current!=NULL){

if(current->car_type==0){

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,43,x+3,45);

}

else if(current->car_type==1){

setfillstyle(1,YELLOW);

62 x=(int)current->x/ROADLEN*1000;

bar(x,43,x+8,45);

} else{

setfillstyle(1,YELLOW);

x=(int)current->x/ROADLEN*1000;

bar(x,43,x+11,45);

}

current = current -> tail;

}

}

void drawRoad(void) {

float x;

setlinestyle(0,0,1);

line(0,24,1000,24);

line(0,48,1000,48);

setlinestyle(3,0,1);

line(0,32,1000,32);

line(0,40,1000,40);

setfillstyle(4,63);

}

void show() {

struct node *temp;

temp=headc;

fprintf(o,"C-lane:\n");

fprintf(o,"Car\tx\tv\ta\tdx\tdy\thv\ttype\n");

while(temp){

fprintf(o,"%03d:\t%.3f\t %.3f\t%.3f\t%.3f\t%.3f\t",

temp->car_seq,temp->x,temp->v,temp->a,temp->head->v);

fprintf(o,"\n");

temp=temp->tail;

63 }

temp=headl;

fprintf(o,"L-lane:\n");

fprintf(o,"Car\tx\tv\ta\tdx\tdy\thv\n");

while(temp){

fprintf(o,"%03d:\t%.3f\t %.3f\t%.3f\t%.3f\t%.3f\t",

temp->car_seq,temp->x,temp->v,temp->a,temp->head->v);

fprintf(o,"\n");

temp=temp->tail;

}

temp=headr;

fprintf(o,"R-lane:\n");

fprintf(o,"Car\tx\tv\ta\thv\n");

while(temp){

fprintf(o,"%03d:\t%.3f\t %.3f\t%.3f\t%.3f\t",

temp->car_seq,temp->x,temp->v,temp->a,temp->head->v);

fprintf(o,"\n");

temp=temp->tail;

}

fprintf(o,"---\n");

}

int main() {

// randomize();

float smallcar,bus;

float flow;

struct node *temp;

int k,l;

int graphdriver=DETECT,graphmode=DETECT;

initgraph(&graphdriver,&graphmode,"E:\\TC\\BGI");

if((o=fopen("file01.xls","w"))==NULL){

fprintf(o,"Open file file01.txt for writing error\n");

return -1;

}

64 printf("Flow is:");

scanf("%f",&flow);

flow/=60;

printf("car percent is:");

scanf("%f",&smallcar);

printf("bus percent is:");

scanf("%f",&bus);

for(STEPS=0;STEPS<TOTALSTEPS;STEPS++) {

drawRoad();

C_laneGenerator(flow,smallcar,bus);

L_laneGenerator(flow,smallcar,bus);

R_laneGenerator(flow,smallcar,bus);

drawlane();

C_laneTransition();

L_laneTransition();

R_laneTransition();

fprintf(o,"\t\t\t\t\t\t%.2f\n",watchtime());

show();

for(k=0;k<30000;k++) for(l=0;l<1000;l++);

cleardevice();

}

closegraph();

getchar();

return 0;

}

int C_laneGenerator(float flow,float smallcar,float bus) {

static float next_car_time=0;

static int carseq=0;

struct node *temp;

65 float aa,tt;

if(c&&((c->x<5)<0)){

next_car_time+=0.1;

return 1;

}

if(hittime(next_car_time)){

temp=(struct node *)malloc(sizeof(struct node));

temp->head=c;

temp->tail=NULL;

if(c!=NULL)c->tail=temp;

else headc=temp;

aa=random(100);

c=temp;

temp->bu=bus;

temp->sma=smallcar;

temp->x=0;

temp->y=10;

temp->v=normal(22.22,2.5);

temp->a=0;

temp->dx=0;

temp->dy=0;

temp->ab=aa;

if((temp->sma>temp->ab)){

temp->car_type=0;

temp->length=4;

temp->width=2;

temp->tall=1.3;

}

else if(aa<(temp->sma+temp->bu)){

temp->car_type=1;

temp->length=10;

temp->width=2.5;

temp->tall=4.1;

}

else if(100>=aa){

temp->car_type=2;

temp->length=9;

66 temp->width=2.5;

temp->tall=4.1;

}

temp->car_seq=++carseq;

if(temp->car_seq==1) temp->v=22.22;

tt=normal(60/flow,1);

if(tt>0.1)

next_car_time+=tt;

else

next_car_time+=0.1;

fprintf(o,"C:%03d is born\n",carseq);

} }

int L_laneGenerator(float flow,float smallcar,float bus) {

static float next_car_time=0;

static int carseq=0;

struct node *temp;

int aa;

float tt;

if(l&&(l->x<5)){

next_car_time+=0.1;

return 1;

}

if(hittime(next_car_time)){

temp=(struct node *)malloc(sizeof(struct node));

temp->head=l;

temp->tail=NULL;

if(l!=NULL)l->tail=temp;

else headl=temp;

aa=random(100);

l=temp;

temp->x=0;

temp->y=6.25;

67 temp->v=normal(22.22,2.5);

temp->a=0;

temp->dx=0;

temp->dy=0;

temp->ab=aa;

if(aa<smallcar){

temp->car_type=0;

temp->length=4;

temp->width=2;

temp->tall=1.3;

}

else if(aa<(smallcar+bus)){

temp->car_type=1;

temp->length=10;

temp->width=2.5;

temp->tall=4.1;

}

else if(aa<100){

temp->car_type=2;

temp->length=9;

temp->width=2.5;

temp->tall=4.1;

}

temp->car_seq=++carseq;

if(temp->car_seq==1) temp->v=22.22;

tt=normal(60/flow,1);

if(tt>0.1)

next_car_time+=tt;

else

next_car_time+=0.1;

fprintf(o,"L:%03d is born\n",carseq);

} }

int R_laneGenerator(float flow,float smallcar,float bus) {

68

69 temp->width=2.5;

temp->tall=4.1;

}

temp->car_seq=++carseq;

if(temp->car_seq==1) temp->v=22.22;

tt=normal(60/flow,1);

if(tt>0.1)

next_car_time+=tt;

else

next_car_time+=0.1;

fprintf(o,"R:%03d is born\n",carseq);

} }

int C_laneTransition() {

struct node *current;

current=headc;

while(current!=NULL){

checkvision(current);

check_car(current);

current->x=x_acc_car(current->x,current->v,current->a,TIMESLICE);

current->v=v_acc_car(current->v,current->a,TIMESLICE);

current=current->tail;

} }

int L_laneTransition() {

struct node *current;

current=headl;

while(current!=NULL){

70 checkvision(current);

check_carl(current);

current->x=x_acc_car(current->x,current->v,current->a,TIMESLICE);

current->v=v_acc_car(current->v,current->a,TIMESLICE);

current=current->tail;

} }

int R_laneTransition() {

struct node *current;

current=headr;

while(current!=NULL){

checkvision(current);

check_carr(current);

current->x=x_acc_car(current->x,current->v,current->a,TIMESLICE);

current->v=v_acc_car(current->v,current->a,TIMESLICE);

current=current->tail;

} }

int hittime(float i) {

float j;

j=watchtime();

if((i>(j-TIMESLICE/2))&&(i<=(j+TIMESLICE/2))) return 1;

return 0;

}

float watchtime() {

return STEPS*TIMESLICE;

}

float x_acc_car(float x0,float v0,float a,float t) {

float x=0.0,v,t1;

71 v=v0+a*t;

x=v0*t+0.5*a*t*t;

if(v0>(MAX_SPEED-0.2)) x=v0*t;

else if(v>MAX_SPEED){

t1=(MAX_SPEED-v0)/a;

x=0.5*(2*t-t1)*(MAX_SPEED-v0)+v0*t;

}

else if(v<0) x=v0*v0/(2*a);

return x+x0;

}

float v_acc_car(float v0,float a,float t) {

float v;

v=v0+a*t;

if(v>MAX_SPEED) return MAX_SPEED;

else if(v<0) return 0.0;

return v;

}

int checkvision(struct node *car){

if(car->head!=NULL)

car->dx=(car->head->x-car->head->length-car->x+1);

else{

return 0;

}

if((car->v<(700.0/36))){

car->dy= tan((-7/12.0*car->v*3.6+220/3)*3.14/180)*(car->dx);

}

else if (car->v>=(700.0/36)){

car->dy= tan((-5/12.0*car->v*3.6+185/3)*3.14/180)*(car->dx);

} }

72 int check_car(struct node *car)

{

struct node *temp=NULL;

struct node *temp1=NULL;

float leh=0,eh,reh=0,acc=0;

temp=headl;

temp1=headr;

eh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,car->head->x-car->head->length+1,car->head->y);

while(temp!=NULL){

if(((temp->x-temp->length-car->head->x+1)*(temp->x-temp->length-car->head->x+1) <visionx(car->dx,car->dy,temp->y,car->head->y))

&&((temp->tail->x-temp->tail->length-car->head->x+car->head->length) *(temp->tail->x-temp->tail->length-car->head->x+car->head->length) >visionx(car->dx,car->dy,temp->y,car->head->y))){

leh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,temp->x-temp->length+1,temp->y);

break;

}

temp=temp->tail;

}

while(temp1!=NULL){

if((temp1->x-temp1->length-car->head->x+1)*(temp1->x-temp1->length-car->head->x+1) <visionx(car->dx,car->dy,temp1->y,car->head->y)

&&((temp1->tail->x-temp1->tail->length-car->head->x+car->head->length) *(temp1->tail->x-temp1->tail->length-car->head->x+car->head->length) >visionx(car->dx,car->dy,temp1->y,car->head->y))){

reh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,temp1->x-temp1->length+1,temp1->y);

break;

}

temp1=temp1->tail;

}

73

acc=7.235*(leh/(leh+eh+reh)*(temp->width*temp->tall/(temp->x-car->x-temp->length+1))*(temp ->v-car->v)

+eh/(leh+eh+reh)*(car->head->width*car->head->tall/(car->dx))*(car->head->v-car->v)

+reh/(leh+eh+reh)*(temp1->width*temp1->tall/(temp1->x-car->x-temp1->length+1))*(temp1->v-car->v));

if(car->head==NULL) car->a=0;

else if((-car->head->v*car->head->v+car->v*car->v)/(2*7.2)>(car->head->x-car->x)) car->a=-7.2;

else if(acc>3.6) car->a=3.6;

else if(acc<-7.2) car->a=-7.2;

else

car->a=acc;

}

int check_carl(struct node *car) {

struct node *temp=NULL;

float leh=0,ceh=0,acc=0;

temp=headc;

leh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,car->head->x-car->head->length+1,car->head->y);

while(temp!=NULL){

if((temp->x-temp->length-car->head->x+1)*(temp->x-temp->length-car->head->x+1) <visionx(car->dx,car->dy,temp->y,car->head->y)

&&((temp->tail->x-temp->tail->length-car->head->x+car->head->length) *(temp->tail->x-temp->tail->length-car->head->x+car->head->length) >visionx(car->dx,car->dy,temp->y,car->head->y))){

ceh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,temp->x-temp->length+1,temp->y);

break;

}

74 temp=temp->tail;

}

acc=7.235*(leh/(leh+ceh)*(car->head->width*car->head->tall/(car->dx))*(car->head->v-car->v)

+ceh/(leh+ceh)*(temp->width*temp->tall/(temp->x-car->x-temp->length+1))*(temp->v-car->v));

if(car->head==NULL) car->a=0;

else if((-car->head->v*car->head->v+car->v*car->v)/(2*7.2) > (car->head->x-car->x) ) car->a=-7.2;

else if(acc>3.6) car->a=3.6;

else if(acc<-7.2) car->a=-7.2;

else

car->a=acc;

}

int check_carr(struct node *car) {

struct node *temp=NULL;

float ceh=0,reh=0,acc=0;

temp=headc;

reh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,car->head->x-car->head->length+1,car->head->y);

while(temp!=NULL){

if((temp->x-temp->length-car->head->x+1)*(temp->x-temp->length-car->head->x+1) <visionx(car->dx,car->dy,temp->y,car->head->y)

&&((temp->tail->x-temp->tail->length-car->head->x+car->head->length) *(temp->tail->x-temp->tail->length-car->head->x+car->head->length) >visionx(car->dx,car->dy,temp->y,car->head->y))){

ceh=GauProb(car->head->x-car->head->length+1,car->head->y,car->dx,car->dy ,temp->x-temp->length+1,temp->y);

break;

75 }

temp=temp->tail;

}

acc=7.235*(reh/(reh+ceh)*(car->head->width*car->head->tall/(car->dx))*(car->head->v-car->v)

+ceh/(reh+ceh)*(temp->width*temp->tall/(temp->x-car->x-temp->length+1))*(temp->v-car->v));

if(car->head==NULL) car->a=0;

else if((-car->head->v*car->head->v+car->v*car->v)/(2*7.2)>(car->head->x-car->x)) car->a=-7.2;

else if(acc>3.6) car->a=3.6;

else if(acc<-7.2) car->a=-7.2;

else

car->a=acc;

}

float car_safe(struct node *car) {

float dmin;

struct node*temp;

dmin=(-temp->v*temp->v+car->v*car->v)/(2*7.2);

return dmin;

}

float visionx(float dxx, float dyy, float yy, float hyy) {

return (1-(yy-hyy)*(yy-hyy)/(dyy*dyy))*dxx*dxx;

}

76 float normal(float mean,float stddev)

{

static double V2,fac;

static int phase =0;

double S, Z, U1, U2, V1;

if(phase) Z=V2*fac;

else{

do{

U1=(double)rand()/RAND_MAX;

U2=(double)rand()/RAND_MAX;

V1=2*U1-1;

V2=2*U2-1;

S=V1*V1+V2*V2;

}while(S>=1);

fac = sqrt(-2*log(S)/S);

Z= V1*fac;

}

phase =1- phase;

return((float)Z)*stddev+mean;

}

float GauProb(float meanx, float meany,

float sttdevx,float sttdevy, float carx, float cary) {

double AA;

double BB;

AA=-1/2*((carx-meanx)*(carx-meanx)/(sttdevx*sttdevx)+

(cary-meany)*(cary-meany)/(sttdevy*sttdevy));

BB=exp(AA);

return BB/(2*3.14*sttdevx*sttdevy);

}

相關文件