• 大小: 6KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: 其他
  • 标签: 美赛  

资源简介

2017美赛D题元胞自动机代码

资源截图

代码片段和文件信息

function [time]=additional_time(AreaSpecial_AreatimeB)
add_wait_time=0.5;%additional wait time for passengers behind passenger with contrabrand
add_check_time=2;%additional check time for passenger with contrabrand

f=find(Special_Area==2);
g=find(Area==1);
[LW]=size(Area);

for i=1:length(f)
    if ~isempty(find(f(i)==B))
        flag=1;
        for j=1:length(g)
            if isempty(find(f(i)-L==g(j)))
                flag=0;
            end
            if flag==1
                if g(j)>=97&&g(j)<117
                   for k=g(j):-1:97
                      time(k)=time(k)+add_wait_time;
                   end
                end
                if g(j)>=157&&g(j)<177
                   for k=g(j):-1:157
                      time(k)=time(k)+add_wait_time;
                   end
                end
                if g(j)>=217&&g(j)<237
                   for k=g(j):-1:217
                      time(k)=time(k)+add_wait_time;
                   end
                end
                if g(j)>=277&&g(j)<297
                   for k=g(j):-1:277
                      time(k)=time(k)+add_wait_time;
                   end
                end
            end
        end
        time(f(i))=time(f(i))+add_check_time;
    end
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        890  2017-01-24 04:10  clear_boundary.m

     文件       3885  2017-01-24 04:23  move_forward.m

     文件        565  2017-01-24 04:07  out_of_B.m

     文件       2240  2017-01-24 04:26  regular_passenger.m

     文件        609  2017-01-24 04:13  special_passenger.m

     文件       2908  2017-01-24 04:28  main.m

     文件       1035  2017-01-24 04:26  show_Area.m

     文件       1288  2017-01-24 04:11  additional_time.m

     文件       1548  2017-01-24 04:27  create_Area.m

----------- ---------  ---------- -----  ----

                14968                    9


评论

共有 条评论