-
Notifications
You must be signed in to change notification settings - Fork 1
/
dywd.m
93 lines (93 loc) · 6.04 KB
/
dywd.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
%%´ňÓĄÎÄľľ
load sch1.mat
[m,n] = size(sch1);
i =1;
for a = 1:m
if find(sch1(a)>0)~=0
temp_a = sch1(a,:);
if length(find(temp_a>0)) == 2
fprintf('t%04d, p%04du, p%04d \n',i,temp_a(1),temp_a(2));
elseif length(find(temp_a>0)) == 4
if temp_a(1) == temp_a(2)
fprintf('t%04d, p%04du, p%04dd, p%04du, p%04dd \n',i,temp_a(1),temp_a(1),temp_a(2),temp_a(2));
elseif temp_a(1) == temp_a(3)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(1),temp_a(2));
else
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(2),temp_a(1));
end
else
if temp_a(1) == temp_a(2) && temp_a(3)==temp_a(4) && temp_a(5)==temp_a(6)
fprintf('t%04d, p%04du, p%04dd, p%04du, p%04dd ,p%04du, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(2) && temp_a(3) == temp_a(5) && temp_a(4) == temp_a(6)
fprintf('t%04d, p%04du, p%04dd, p%04du, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(2) && temp_a(3) == temp_a(6) && temp_a(4) == temp_a(5)
fprintf('t%04d, p%04du, p%04dd, p%04du, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(3) && temp_a(2) == temp_a(4) && temp_a(5) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04dd, p%04du, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(3) && temp_a(2) == temp_a(5) && temp_a(4) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(3) && temp_a(2) == temp_a(6) && temp_a(4) == temp_a(5)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(4) && temp_a(2) == temp_a(3) && temp_a(5) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04dd, p%04du, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(4) && temp_a(2) == temp_a(5) && temp_a(3) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(4) && temp_a(2) == temp_a(6) && temp_a(3) == temp_a(5)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(5) && temp_a(2) == temp_a(3) && temp_a(4) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(5) && temp_a(2) == temp_a(4) && temp_a(3) == temp_a(6)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(5) && temp_a(2) == temp_a(6) && temp_a(3) == temp_a(4)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(6) && temp_a(2) == temp_a(3) && temp_a(4) == temp_a(5)
fprintf('t%04d, p%04du, p%04du, p%04dd, p%04du, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(6) && temp_a(2) == temp_a(4) && temp_a(3) == temp_a(5)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
elseif temp_a(1) == temp_a(6) && temp_a(2) == temp_a(5) && temp_a(3) == temp_a(4)
fprintf('t%04d, p%04du, p%04du, p%04du, p%04dd, p%04dd, p%04dd \n',i,temp_a(1),temp_a(2),temp_a(3),temp_a(4),temp_a(5),temp_a(6));
end
end
i = i+1;
end
end
% b = b3;
% pc = zeros(size(b,2),18);
% for i = 1:size(b,2)
% path = zylj(P,Car{b(i)});
% pc(i,1) = b(i);
% pc(i,2) = Car{b(i)}.seat(path(2));
% pc(i,3) = Car{b(i)}.seat(path(3));
% pc(i,4) = Car{b(i)}.seat(path(4));
% pc(i,5) = Car{b(i)}.site(1);
% pc(i,6) = Car{b(i)}.site(2);
% pc(i,7) = P{Car{b(i)}.seat(path(2))}.site(1);
% pc(i,8) = P{Car{b(i)}.seat(path(2))}.site(2);
% pc(i,9) = P{Car{b(i)}.seat(path(2))}.destination(1);
% pc(i,10) = P{Car{b(i)}.seat(path(2))}.destination(2);
% pc(i,11) = P{Car{b(i)}.seat(path(3))}.site(1);
% pc(i,12) = P{Car{b(i)}.seat(path(3))}.site(2);
% pc(i,13) = P{Car{b(i)}.seat(path(3))}.destination(1);
% pc(i,14) = P{Car{b(i)}.seat(path(3))}.destination(2);
% pc(i,15) = P{Car{b(i)}.seat(path(4))}.site(1);
% pc(i,16) = P{Car{b(i)}.seat(path(4))}.site(2);
% pc(i,17) = P{Car{b(i)}.seat(path(4))}.destination(1);
% pc(i,18) = P{Car{b(i)}.seat(path(4))}.destination(2);
% end
% pc = zeros(size(b,2),13);
% for i = 1:size(b,2)
% path = zylj(P,Car{b(i)});
% pc(i,1) = b(i);
% pc(i,2) = Car{b(i)}.seat(path(2));
% pc(i,3) = Car{b(i)}.seat(path(3));
% pc(i,4) = Car{b(i)}.site(1);
% pc(i,5) = Car{b(i)}.site(2);
% pc(i,6) = P{Car{b(i)}.seat(path(2))}.site(1);
% pc(i,7) = P{Car{b(i)}.seat(path(2))}.site(2);
% pc(i,8) = P{Car{b(i)}.seat(path(2))}.destination(1);
% pc(i,9) = P{Car{b(i)}.seat(path(2))}.destination(2);
% pc(i,10) = P{Car{b(i)}.seat(path(3))}.site(1);
% pc(i,11) = P{Car{b(i)}.seat(path(3))}.site(2);
% pc(i,12) = P{Car{b(i)}.seat(path(3))}.destination(1);
% pc(i,13) = P{Car{b(i)}.seat(path(3))}.destination(2);
% end