Multiple waves programming problem (II) missile launch in

Foreword

In planning multiple waves missile launchers in (a) and network mapping data collation , we were edited out of the combat zone network diagrams, and time-consuming matrix of various models of traffic in the network. Next we come to study the issue of a problem-solving steps, which is the basis of several other asked, once the issue of problem-solving ideas and a model, ask a few other adjustments can be modified on this basis can easily get to.


problem analysis

Clear operational tasks Network Diagram

The multiple waves of missiles on combat missions established network charts, network diagrams equivalent to the map, is the fundamental basis of all combat missions scheduled. In planning multiple waves missile launchers in (a) and network mapping data collation , the preliminary finishing work has been completed. Here is to clear some of the information network diagram:

Combat regional road network map point number

In a total network diagram 130 points, wherein

  • Standby region D1 ~ D2 (Nos. 1 and 2)
  • Reproduced region Z01 ~ Z06 (Nos. 3-8)
  • Emitting region F01 ~ F60 (Nos. 9 to 68)
  • Road node J01 ~ J62 (Nos. 69 to 130)
    • J01 ~ J11 main road 1 (Nos. 69 to 79)
    • J12 ~ J20 main road 2 (Nos. 80 to 88)
    • J21 ~ J62 for other roads (numbered 89 to 130)


Clear combat mission launch vehicle attributes

In multiple waves missile launch tasks in this topic, perform the task of a total of three models, denoted A型车 B型车 C型车. These models and driving vehicles in accordance with the road, its running speed will be different:

Launch vehicle basic information
Quantity Main road speed (km / h) Other road speed (km / h)
Model A 6 70 45
Model B 6 60 35
C car 12 50 30


Clear strategy maneuvering combat missions

According topic related content description can be sorted out multiple waves Maneuvers missile launch combat missions:

Concealment in the standby region → projectile driving band to transmit a certain point (point can not be reused) → waiting → last car in place of the first wave volleys → → transfer area to driving arrangements loaded missile (not enough points, We will wait) → transmit traffic to a certain point (point can not be reused) → waiting → last vehicle position second wave volleys

Maneuvers can be more simply referred to as " DFZF ", i.e. in the standby region, the emitter region, the region between the reproduced walking.


Long exposure calculation clear combat mission

Refers to a long exposure time is subject to all vehicles from the standby region up to the sum of the second wave volleys completion time consuming task. among them

  • In the standby region, because it is hidden standby, so there is no longer the exposure time.
  • In the emission region, because you want to wait for all vehicles in place to volley, so the waiting time would count the region into long exposure.
  • In the transfer area, a transfer area as a single loading operation mode, and the area can only accommodate two launch vehicle, so when there is three or more, the region exposed outside of the case will this time be calculated exposure duration.
  • In all roads to calculate the average walking time consuming into long exposure.


Produce a clear conflict of travel

As the car up in the network map, traffic conflict situation may occur, which is the crash. So here we first have to define what is driving the conflict? Driving conflict can be understood as, at some time, on a certain road vehicles conflict in time and space.

According to the main road and traffic conflict to distinguish between non-trunk:

  • For the main road, the subject of the provisions of its traffic lane dual channel mode, which means you can launch simultaneously with two cars in the main road, regardless of the direction of travel are the same, there is no possibility of a collision.

  • For non-arterial, the title predetermined driving mode which is a single channel access, the car will be at a node, i.e., a reverse drive at a node can be interleaved by the node; But between the node and the node

    • May occur traveling the same direction, the slow speed of the car from the back and front speed car crash ( ie, rear-end )
    • May occur in a reverse drive, two cars directly meet head crash ( ie collision )

Therefore, in determining the route should be promptly verify the presence of the crash, the crash occurs if you need to be considered separately.


D - Analysis and Solution F stage combat missions

Combat Task Analysis

First, the transmitting station 24 in a uniform distribution of vehicles carrying the missile concealment in the standby region. I.e. regions D1 and D2, respectively, each of the three arrangements for Model A, B three each car, C 6 units each car. After receiving the combat mission, launch vehicle the two regions started to move, after having left the waiting area, to find the nearest launch point to reach the launch point, place on standby. When the command (this is my imaginary) receive a final launch vehicle has reached the launch point of the message, issue a command to perform the first wave volley tasks, all missile launchers immediately. This is the first wave salvo.


Exposure time calculation

Long exposure calculation foregoing analysis can know, there must be a possibility that faster driving speed launch vehicle after reaching the specified emission points, will be on standby, waiting for the arrival of other local emission point, when there is a long exposure during this period.

image

Long exposure when comparing the launch vehicle at different Maneuvers

As shown above on the left, in order to shorten the exposure time, the last salvo time must be short, that is, the last time a launch vehicle to reach shorter. However, if all vehicles on the same flight, although unlikely long crash (running fast in front of the slower runners in the back), and the first to express to wait for the slow, there is exposure to the emitting region. At this time, a total length equal to the last time is multiplied by the launch vehicle 24 reaches the exposure.

As shown above on the right, under the change of thinking is still the same car, the last time a car arrives too short. On this basis, so that the first express train in standby waiting area, then sent in succession, so that the exposure time was owned by the stand-in area, but the long exposure time is not included. Driving time-consuming equal length of all vehicles and the total exposure at this time. Long necessarily the shortest exposure time in this case. The question then converted to require that all cars to the shortest length of time spent problems and launch point.


Driving conflict test

For the calculated results must be verified whether the traffic conflict exists. According to the definition of traffic conflict analysis, we can determine whether there is a conflict situation crash:

First, find any two driving directions, two select lines are each any two adjacent points, and the corresponding time. That is the starting point, arrival point, departure time, arrival time, four judgments based on comparison.

  • If the points on the main road, then there is no collision
  • If the point is not on the main road

    • If the point exists in the same direction relationship (starting at the same point and arrival point are the same), and there are circumstances after first starting (small departure time) to reach (achieve big time) or departure (departure time is greater) to reach (reach the small time) it is defined as a rear-end crash.
    • Inverse relationship (starting point and arrival point opposite) points, and crossing time overlap exists where (a departure time which is less than the arrival time of another, or one larger than the other arrival time departure time), then It is defined as the collision crash.
    • Other cases, there is no all crash


Applicable Model

According to the analysis, D - F stage combat missions can be classified as 任务指派问题. I.e., the emission point 60 is designated as a human, the transmitting station 24 as the task assigned car, a station transmits a car traveling from the standby region to the shortest driving time consuming emitting region to complete a task as someone when the required length. 24 such that the objective function is the arrival time of the vehicle launchers desired emission point and the shortest (i.e., the shortest time required to complete tasks). among them

  • Stage launch vehicle 24 need to follow the standby region and the models to calculate the length of time required to reach the emission point 60 (see below).
  • Launch vehicle from the waiting area to the launch point of the time-consuming need to calculate the traffic, this has been (a) network mapping and data consolidation planning missile launch in multiple waves are received.
  • The shortest driving time-consuming part of the shortest path problem in graph theory, generally can take Floyd方法or dijkstra方法solved.

image

Launch vehicle - emission dot matrix


Model

In general, the task of solving the assignment problem, commonly 0--1 integer programming model to solve. In this title may be solved as follows:

  • Step1 : Processed matrix driving various models of data entry, a given starting point for D1 and D2, the end 60 of the emission point F1 ~ F60, graph theory shortest path model (or the Floyd the Dijkstra) were determined points to two 60 points (in the order calculated) of the array consuming. 6 will produce a length of the array 60 is time-consuming.
  • Step2 : Processed array above, according to the number of models and the recombinant starting point for 0 - 1 with integer programming time consuming table, as shown above, will be a time-consuming TABLE 24 * 60.
  • step3 : the establishment of 0 - 1 integer programming model.
  • Step4 : finishing results.
  • STEP5 : Driving conflict test.


Wherein 0 - 1 integer programming model is as follows:
note $ c_ {ij} $ represents \ (I \) station dealers till the first \ (J \) time-consuming long emission point. Introduction 0--1 variables:
\ [X_ {ij of} = \ the begin {Cases}. 1 & \ text {first} i \ text {station dealers till the first} j \ text {TPs transmit} \\ 0 & \ text { The first} i \ text {not reach the first station dealers} j \ text {TPs transmit} \\ \ end {cases} \ ]

Establish the following 0--1 integer programming model:

\ [\ Min \ sum_ {i = 1} ^ {24} {\ sum_ {j = 1} ^ {60} {c_ {ij} x_ {ij}}} \]

\[ s.t.\begin{cases} \sum_{i=1}^{24}{x_{ij}\le 1}& j=1,2,\cdots ,60\\ \sum_{j=1}^{60}{x_{ij}=1}& i=1,2,\cdots ,24\\ x_{ij}=0\text{或}1& i=1,2,\cdots ,24;j=1,2,\cdots ,60\\ \end{cases} \]


Model code

  • Main program code
%% 准备存储空间
clc, clear, close all

%% 导入整理的数据
time_cost_A = xlsread('data','A型车耗时矩阵'); % 导入耗时矩阵
time_cost_B = xlsread('data','B型车耗时矩阵');
time_cost_C = xlsread('data','C型车耗时矩阵');

%% 点位序号编组
D = (1:2); % 待机区域点位
Z = (1:6) + 2; % 转载区域点位
F = (1:60) + 2 + 6; % 发射区域点位
J1 = (1:11) + 2 + 6 +60; % 主干道1点位
J2 = (12:20) + 2 + 6 +60; % 主干道2点位
J3 = (21:62) + 2 + 6 + 60; % 普通道路点位

%% 车型编号
A1 = (1:3);     A2 = (4:6);   % A型车
B1 = (7:9);     B2 = (10:12); % B型车
C1 = (13:18);   C2 = (19:24); % C型车

%% 所有车 从 D 开往 F 的所有情况
A_D_F = calRoute(time_cost_A,D,F,{'A'});
B_D_F = calRoute(time_cost_B,D,F,{'B'});
C_D_F = calRoute(time_cost_C,D,F,{'C'});

%% 整合出24辆车分别到60个发射点的耗时矩阵
DF(A1,:) = repmat(([A_D_F{1,1}.cost]),length(A1),1);
DF(A2,:) = repmat(([A_D_F{2,1}.cost]),length(A2),1);
DF(B1,:) = repmat(([B_D_F{1,1}.cost]),length(B1),1);
DF(B2,:) = repmat(([B_D_F{2,1}.cost]),length(B2),1);
DF(C1,:) = repmat(([C_D_F{1,1}.cost]),length(C1),1);
DF(C2,:) = repmat(([C_D_F{2,1}.cost]),length(C2),1);

%% 0 - 1 整数规划模型
[DF_go,DF_time]= myintlinprog(DF);

%% 整理计算结果
DF_result = struct('car',{},'start',{},'end',{},'cost',{},'path',{},'time',{});
for i = A1
    DF_result(i) = A_D_F{1,1}(DF_go(i,:)~=0);
    DF_result(i).car = sprintf('A0%d',i);
end
for i = A2
    DF_result(i) = A_D_F{2,1}(DF_go(i,:)~=0);
    DF_result(i).car = sprintf('A0%d',i);
end
for i = B1
    DF_result(i) = B_D_F{1,1}(DF_go(i,:)~=0);
    DF_result(i).car = sprintf('B0%d',i-6);
end
for i = B2
    DF_result(i) = B_D_F{2,1}(DF_go(i,:)~=0);
    DF_result(i).car = sprintf('B0%d',i-6);
end
for i = C1
    DF_result(i) = C_D_F{1,1}(DF_go(i,:)~=0);
    if i-12<10
    DF_result(i).car = sprintf('C0%d',i-12);
    else
    DF_result(i).car = sprintf('C%d',i-12);
    end
end
for i = C2
    DF_result(i) = C_D_F{2,1}(DF_go(i,:)~=0);
    if i-12<10
    DF_result(i).car = sprintf('C0%d',i-12);
    else
    DF_result(i).car = sprintf('C%d',i-12);
    end
end
%% 计算第一波发射时间
launch1_time = max([DF_result.cost]);
%% 重新调整发车时间
delta_time = launch1_time - [DF_result.cost];
for i = 1:24
    DF_result(i).time = DF_result(i).time + delta_time(i);
end
fprintf('第一波齐射时间为第%.2f小时,总暴露时间为%.2f小时\n',launch1_time,DF_time);

%% 检测是否冲突
isCrack(DF_result)
%% 冲突线路调整
move_time = DF_result(2).time(1) - DF_result(17).time(1);
DF_result(2).time =  DF_result(2).time - move_time;
fprintf('第一波齐射时间为第%.2f小时,总暴露时间为%.2f小时\n',launch1_time,DF_time + move_time);
%% 再次检查是否冲突
isCrack(DF_result)
%% 结果输出保存
[DF_result.leave] = deal(launch1_time);
[DF_result.exposed] = deal(DF_result.cost);
DF_result(2).exposed = DF_result(2).exposed + move_time;


  • The shortest path calculation routine and time-consuming certain models
function RA = calRoute(time_cost,Start,End,car)
% 给定起点和终点,计算最优路径和耗时
% time_cost     input 网络耗时矩阵(根据车型计算得出)
% Stat          input 起点
% End           input 终点
% car           input 当前车型
% RA            output 保存计算结果:车型、起止点、耗时、路径、节点时间的结构体
m = length(Start); % 起点个数
n = length(End); % 终点个数
% 记录一对起点到终点的最优路径情况
R_A = struct('car',{},'start',{},'end',{},'cost',{},'path',{},'time',{});
% 记录总的最优路径
RA = cell(m,1);
for i = 1:m
    for j = 1:n
        R_A(j).car = car; % 记录当前车型
        R_A(j).start = Start(i); % 记录车辆出发点
        R_A(j).end = End(j); % 记录车辆终到点
        % 从出发点到终到点之间最短路径的计算
        [R_A(j).cost ,R_A(j).path] = mydijkstra(time_cost,Start(i),End(j)); 
        % 求到达各个节点的时间
        time = 0;
        R_A(j).time(1) = time;
        path = [R_A(j).path];
        for k = 1:length(path)-1
            time_temp = time_cost(R_A(j).path(k),R_A(j).path(k+1));
            time = time + time_temp;
            R_A(j).time(k+1) = time ;
        end
    end
    % 将一对起止点最短路径存到元胞中
    RA{i,1} = R_A;
    % 清除临时存储的结构体
    clear R_A
end
end


  • The shortest path selection routine
function [mydistance,mypath]=mydijkstra(a,sb,db)
%寻找i,j两点最短路径
% 输入:a—邻接矩阵,a(i,j)是指i到j之间的距离,可以是有向的
% sb—起点的标号, db—终点的标号
% 输出:mydistance—最短路的距离, mypath—最短路的路径
n=size(a,1); visited(1:n) = 0;
distance(1:n) = inf; distance(sb) = 0; %起点到各顶点距离的初始化
visited(sb)=1; u=sb;  %u为最新的P标号顶点
parent(1:n) = 0; %前驱顶点的初始化
for i = 1: n-1
    id=find(visited==0); %查找未标号的顶点
    for v = id
        if  a(u, v) + distance(u) < distance(v)
            distance(v) = distance(u) + a(u, v);  %修改标号值
            parent(v) = u;
        end
    end
    temp=distance;
    temp(visited==1)=inf;  %已标号点的距离换成无穷
    [t, u] = min(temp);  %找标号值最小的顶点
    visited(u) = 1;       %标记已经标号的顶点
end
mypath = [];
if parent(db) ~= 0   %如果存在路!
    t = db; mypath = [db];
    while t ~= sb
        p = parent(t);
        mypath = [p mypath];
        t = p;
    end
end
mydistance = distance(db);
end


  • 0 - 1 integer programming model subroutine
function [DF_go,DF_time] = myintlinprog(DF)
c = DF;
[m,n] = size(c);% m个任务,n个委派人员
c = c(:);
a = zeros(n,n*m);

for j = 1:n
    a(j,((j-1)*m+1:j*m)) = 1;
end

b = ones(n,1);
Aeq = zeros(m,m*n);

for i = 1:m
    Aeq(i,(i:m:m*n)) = 1;
end

Beq = ones(m,1);
intcon = 1:m*n;
lb = zeros(m*n,1); ub = ones(m*n,1);
[x,y] = intlinprog(c,intcon,a,b,Aeq,Beq,lb,ub);
DF_go = reshape(x,[m,n]);
DF_time = y;
end


  • Whether conflict detection subroutine
function isCrack(DF_result)
 flag = 0;
J1 = (1:11) + 2 + 6 +60; % 主干道1点位
J2 = (12:20) + 2 + 6 +60; % 主干道2点位
n1 = 1:length(DF_result);
for i = n1
    for j = n1(n1~=i)
        path1 = [DF_result(i).path]; time1 = [DF_result(i).time];
        path2 = [DF_result(j).path]; time2 = [DF_result(j).time];
        n1 = 1:length(path1)-1;
        n2 = 1:length(path2)-1;
        for k = n1
            for r =  n2
                s1 = path1(k); e1 = path1(k+1);
                st1 = time1(k); et1 = time1(k+1);
                s2 = path2(r); e2 = path2(r+1);
                st2 = time2(r); et2 = time2(r+1);
                % 主干道不存在撞车
                if (ismember(s1,J1) || ismember(s1,J2)) && (ismember(e1,J1) || ismember(e1,J2)) && ...
                        (ismember(s2,J1) || ismember(s2,J2)) && (ismember(e2,J1) || ismember(e2,J2))
                    flag = 0;
                % 非主干道同向追尾撞车
                elseif s1 == s2 && e1 == e2 && ((st1 < st2 && et1 > et2) ||(st1 > st2 && et1 < et2))
                    flag = 1; fprintf('%s与%s在%d-%d与%d-%d存在同向撞车,请做出调整!\n',DF_result(i).car,DF_result(j).car,s1,e1,s2,e2);
                % 非主干道反向对撞撞车
                elseif s1 == e2 && s2 == e1 && ((st1 < et2)||(st2 < et1))
                    flag = 1; fprintf('%s与%s在%d-%d与%d-%d存在反向撞车,请做出调整!\n',DF_result(i).car,DF_result(j).car,s1,e1,s2,e2);
                else
                    flag = 0;
                end
            end
        end
    end
end
end


Model results

image

Which experienced an adjustment, in order to avoid a collision, the crash of the A02 forward adjustment, that is ahead of departure, but brought exposure time, therefore, again, the final result is calculated as follows:
the first wave salvo 3.33 hours for the first time, total exposure time was 51.76 hours.


Vehicle assigned schedule:

image


Guess you like

Origin www.cnblogs.com/ctgu/p/11519874.html