⛄一、合同网协议简介
合同网协议(CNP算法),用于具有时间窗口和优先级约束的网络上多智能体多任务分配问题。
⛄二、部分源代码
close all
clc
clear
num_of_UAVs = 4; % Num of UAVs
time = 1300;
sample_arena = Arena; % Arena , If you want to change the position of static
% Obstacals, see the Arena.m file
tic
for i = 1:1:num_of_UAVs
% Initialising the Aircrafts
UAVs(i) = AirCraft(i);
end
sample_mission_planner = mission_planner(UAVs, sample_arena );
% Initialising the mission planner
N = time/sample_arena.dt;
%% Loop run
for i = 1:1:N
for k = 1:1:numel(UAVs)
sample_mission_planner.plan_mission(k);
% Plan mission i,e get the new command for the k-th UAV
end
for k = 1:1:numel(UAVs)
UAVs(k).move(sample_arena);
% move the K-th UAV
end
end
toc
%% Figure plo