-
Notifications
You must be signed in to change notification settings - Fork 7
/
Run_Me.m
51 lines (38 loc) · 1.6 KB
/
Run_Me.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
% ==============================================================================
% MATLAB Source Codes for "Cooperative Lane Change Motion Planning of Connected and Automated Vehicles: A Stepwise Computational Framework".
% ==============================================================================
% Copyright (C) 2018 Bai Li
% Useers MUST cite the following article when utilizing these source codes to produce new contributions.
% Bai Li, Yue Zhang, Youmin Zhang, and Ning Jia, "Cooperative Lane Change Motion Planning of Connected
% and Automated Vehicles: A Stepwise Computational Framework", 2018 IEEE
% Intelligent Vehicles Symposium (IV'18), accepted.
% ==============================================================================
% If there are inquiries, feel free to contact libai@zju.edu.cn
% ==============================================================================
clear all
close all
clc
Nfe = 20; % This is a fixed parameter related to the number of finite elements in OCDT, should not change.
% Execution of Algorithm 1 (approximately takes 3000 seconds)
tic
CPU_time_recorder = zeros(1,(Nfe+1));
step_1;
CPU_time_recorder(1) = toc;
for iiiiii = [1 : 4 : (Nfe-1), Nfe]
delete('libai');
fid = fopen('libai', 'w');
fprintf(fid,'1 %g;', iiiiii);
fclose(fid);
step_2_to_21;
CPU_time_recorder(iiiiii+1) = toc;
end
figure (1)
video_generation
figure (2)
figure_generation
figure (3)
ind = find(CPU_time_recorder > 0);
plot(ind,CPU_time_recorder(ind),'-+')
axis tight
xlabel('Sub-problem Number');
ylabel('CPU Time / sec')