天天看点

基于企鹅优化算法的航空调度问题(Matlab代码实现)

目录

​​1 概述​​

​​2 企鹅优化算法​​

​​3 运行结果​​

​​4 Matlab代码及文章讲解​​

​​5 参考文献 ​​

​​6 写在最后​​

1 概述

针对舰载机航空作业调度问题的特性进行了分析,指出舰载机出动回收能力等影响水面舰船作战能力的重要因素。通过阐述目前常用的机群保障流程,决定将其抽象为混合作业车间调度问

题,并着重分析和研究了车间调度的相关常用算法,如分支定界法、遗传算法、模拟退火算法、群智能算法和启发式算法等。在结合了实际的舰面调度作业之后,决定选择群智能算法和构造型启发式算法进行求解。然后,将航空作业调度问题中的各方面因素,按照车间调度中的各个元素以及车间环境进行抽象建模,并且评估其调度任务的优先级顺序和约束条件之后,建立了舰载机航空作业调度模型,并以此为据进行了算法设计。

2 企鹅优化算法

帝企鹅优化算法(emperor penguin optimizer,EPO)是Gaurav 等提出的一种新型群智能优化算法,其思想是模拟帝企鹅群体冬天拥挤在一起取暖的行为进行寻优。Baliarsingh 等进一步将EPO算法用于求解多目标优化问题。Kumar 等将EPO算法用于处理图像分割问题。Jia等通过结合多项式变异、levy飞行及热交换操作策略改进帝企鹅优化算法。

3 运行结果

基于企鹅优化算法的航空调度问题(Matlab代码实现)
基于企鹅优化算法的航空调度问题(Matlab代码实现)

 4 Matlab代码及文章讲解

function [fit,result]=aimFcn_1(x,option,data)
    x=reshape(x,data.num_flight,3);
    x(x<0.01)=0.01;
    T=min(data.flight(:,3));
    recording.node=zeros(data.num_flight,data.num_node);  %记录每架飞机通过该节点的时间
    recording.flight=zeros(data.num_flight,20);     %记录每一家航班的状态   
    recording.route=cell(data.num_Route,1);        %记录该航线最后一架 飞机的位置
    for i=1:data.num_Route
        recording.route{i}=cell(length(data.Route_type{i,2}),1);
    end
    recording.Section=zeros(1,option.num_Section);  %记录扇区内飞机数量
    priority_flihgt=x(:,1);
    while 1
        %% 查找可调度飞机
        position=find(data.flight(:,3)<=T & recording.flight(:,8)==0);
        [~,position1]=sort(priority_flihgt(position));
        position=position(position1);
        for i=1:length(position)
            % 航班编号
            no_flight=position(i);
            % 航班类型
            type_flight=data.flight(no_flight,5);
            % 航班速度
            v_flight=(data.vehicle(type_flight,2)-data.vehicle(type_flight,3))*x(no_flight,2)+data.vehicle(type_flight,3);
            % 航线编号
            no_route=data.flight(no_flight,2);
            % 航班高度
            height_type=ceil(length(data.Route_type{no_route,2})*x(no_flight,3));
            height_flight=data.Route_type{no_route,2}(height_type);
            temp_route=data.Route_num{no_route}(3:end);
            temp_T0=T;
            biaoji=0;
            total_distance=0;
            % 检查该航线运行飞机状态
            if ~isempty(recording.route{no_route})
                if ~isempty(recording.route{no_route}{height_type})
                    if recording.route{no_route}{height_type}(1)<=option.gap_D
                        continue;
                    end
                end
            end
            % 计算每个节点的抵达时间
            temp_no=[];
            temp_time=[];
            for ii=1:length(temp_route)
                no_node=temp_route(ii);
                no_Section=data.Point(no_node,4);
                if ii==1
                    if temp_T0-max(recording.node(:,no_node))<option.min_gap(no_node)
                        biaoji=1;
                        break;
                    else
                       % recording.node(no_flight,no_node)=temp_T0;
                    end 
                else
                    no_node0=temp_route(ii-1);
                    temp_distance=norm(data.Point(no_node,:)-data.Point(no_node0,:),2);
                    total_distance=total_distance+temp_distance;
                    temp_T=temp_distance/v_flight;
                    temp_T0=temp_T0+temp_T;
                    if temp_T0-max(recording.node(:,no_node))<option.min_gap(no_node)
                        biaoji=1;
                        break;
                    else
                      %  recording.node(no_flight,no_node)=temp_T0;
                    end
                end
                temp_no=[temp_no,no_node];
                temp_time=[temp_time,temp_T0];
            end
            if no_Section~=0
                if recording.Section(no_Section)>option.total_flight(no_Section)
                    continue;
                end
            end
            if biaoji==1
                continue;
            end
            recording.node(no_flight,temp_no)=temp_time;
            % 记录航班状态
            recording.flight(no_flight,1)=type_flight; %航班类型
            recording.flight(no_flight,2)=v_flight;    %航班速度
            recording.flight(no_flight,3)=no_route;     %航班路线
            recording.flight(no_flight,4)=height_flight;%航班高度
            recording.flight(no_flight,5)=no_route;     %航班路线
            recording.flight(no_flight,6)=0;            %当前位置
            recording.flight(no_flight,7)=total_distance;%终点位置
            recording.flight(no_flight,8)=1;            %飞行状态 1 完成状态2
            recording.flight(no_flight,9)=T;            %进入时间
            recording.flight(no_flight,10)=data.flight(no_flight,3); %航班预定时间
            recording.flight(no_flight,11)=T+total_distance/v_flight; %离开航线时间
            recording.route{no_route}{height_type}(1)=0;
            recording.route{no_route}{height_type}(2)=no_flight;
        end
        %% 查找飞行状态的飞机
        recording.Section=zeros(1,option.num_Section);  %记录扇区内飞机数量
        position=find(recording.flight(:,8)==1);
        for i=1:length(position)
            % 航班编号
            no_flight=position(i);
            % 航班类型
            type_flight=data.flight(no_flight,5);
            % 航班速度
            v_flight=(data.vehicle(type_flight,2)-data.vehicle(type_flight,1))*x(no_flight,2)+data.vehicle(type_flight,1);
            % 航线编号
            no_route=data.flight(no_flight,2);
            % 航班高度
            height_type=ceil(length(data.Route_type{no_route,2})*x(no_flight,3));
            height_flight=data.Route_type{no_route,2}(height_type);
            temp_route=data.Route_num{no_route}(3:end);
            % 航班位置
            temp_distance0=recording.flight(no_flight,6)+v_flight*option.T_step;
            recording.flight(no_flight,6)=temp_distance0;
            total_distance=recording.flight(no_flight,7);%终点位置
            if temp_distance0>total_distance %飞机 完成飞行
                recording.flight(no_flight,8)=2;
                continue;
            end
            temp_D=0;
            node_flight=temp_route(1); 
            % 查找当前飞机所在节点位置
            for ii=2:length(temp_route)
                no_node=temp_route(ii);
                no_node0=temp_route(ii-1);
                temp_distance=norm(data.Point(no_node,2:3)-data.Point(no_node0,2:3),2);
                if temp_D+temp_distance>=temp_distance0
                    node_flight=temp_route(ii); 
                end
            end
            % 飞机所在扇区
            no_Section=data.Point(node_flight,4);
            if no_Section~=0
                recording.Section(no_Section)=recording.Section(no_Section)+1;
            end
            if recording.route{no_route}{height_type}(2)==no_flight
                recording.route{no_route}{height_type}(1)=temp_distance0;
            end
        end
        T=T+option.T_step;
        position=find(recording.flight(:,8)~=2);
        if isempty(position)
            break;
        end
    end
    %% 
    fit1=sum(recording.flight(:,9)-recording.flight(:,10));
    fit2=max(recording.flight(:,11));
    fit=sum(data.w.*[fit1,fit2]);
    if nargout>1
        result.recording=recording;
    end
end      

5 参考文献 

6 写在最后

继续阅读