资源简介
此示例代码是多代理系统(MAS)的服务器,用于处理多代理问题。每个代理Agent都可协调运行
代码片段和文件信息
%This sampmle code is server of multi agents system (MAS) for work on multi
%agents problem .
% Published by Masoud Nadi
% Email : nadimasoud.90@gmail.com
% Copy Write 2015
%% This code make server matrix for serverMat
clc;
clear all;
close all;
AgentNum=10; % Number of Agents
AgentSize=100; % Size of agents in plot
Dimension=3; % Select Dim
SizeOfEnvironmet=[15 15 15 ;-4 -4 -4]; % Size of Environmet (MAX(X Y Z);MIN(X Y Z))
if Dimension==2
Dim=‘2‘;
else
Dim=‘3‘;
end
sMat=ServerMat(AgentNumDimensionSizeOfEnvironmet); % Make 1st position of agents
whitebg(‘black‘)
%% Make 1st Plot of agents using scatter plot
switch Dim
case ‘2‘
scatter(sMat(:1)sMat(:2)AgentSizesMat(:3)‘filled‘)
case ‘3‘
scatter3(sMat(:1)sMat(:2)sMat(:3)AgentSizesMat(:4)‘filled‘)
otherwise
error(‘myApp:argChk‘ ‘Wrong number of input Dim‘)
end
%% Update agents position
% This codes update the position of agents and using the sample changing
% position like ‘UpdatePos‘ function .
Step=.5; % Step make the Step of agent position in each iteration
Max_It=100; % Max iteration of agents work
pause(0.5);
for it=1:Max_It
switch Dim
case ‘2‘
sMat=UpdatePos(sMatStepAgentSizeDimensionAgentNum);
scatter(sMat(:1)sMat(:2)AgentSizesMat(:3)‘filled‘)
case ‘3‘
sMat=UpdatePos(sMatStepAgentSizeDimensionAgentNum);
scatter3(sMat(:1)sMat(:2)sMat(:3)AgentSizesMat(:4)‘filled‘)
end
disp([‘Iteration :‘ num2str(it) ]);
pause(0.05);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1615 2016-06-24 20:28 Server\server.m
文件 756 2016-06-24 20:30 Server\ServerMat.m
文件 9871 2016-06-24 20:30 Server\UpdatePos.m
文件 1311 2016-06-24 08:51 license.txt
相关资源
- 四旋翼MATLAB仿真文件+实验报告
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
川公网安备 51152502000135号
评论
共有 条评论