PlatMOEA

PlatMOEA(未完)

使用

1. 不用GUI,用命令行启动的

举例: main(‘-algorithm’, @KnEA, ’-problem’, @DTLZ2, ’-N’, 200, ’-M’, 10);

这里写图片描述

2. 用GUI启动

找到main文件,启动运行它

public文件夹下的文件

GLOBAL 类(handle类型的类)
内容

one GLOBAL object is maintained to store all the parameter setting and the result data,
including

  1. the function handles of the executed MOEA
  2. MOP
  3. operator
  4. the population size
  5. the number of objectives
  6. the number of decision variables
  7. the maximum number of fitness evaluations
  8. the number of evaluated fitness,
  9. and so on.
变量:

这里写图片描述

方法:
  • 构造函数 GLOBAL

    • 函数接口function obj = GLOBAL(varargin)

    • 初始化全局变量,命令行使用方法:

    GLOBAL('-algorithm',@NSGAII,'-problem',@DTLZ2,'-N',100,'-M',2,'-D',10)
  • Start

    • 作用: 运行算法并评估它
    • obj.Start() 运行算法(只能运行一次)
  • Initialization

    • 作用: 随机生成初始种群
    • 函数接口Population = INDIVIDUAL(obj.problem('init',obj,N));
    • 命令行使用方法
    • P = obj.Initialization(),使用obj的N
    • P = obj.Initialization(N)传入population的个数
  • NotTermination

    • 作用: Stop the running if the number of evaluations has exceeded
    • 函数接口function notermination = NotTermination(obj,Population)
  • Variation

    • 作用: 生成子代种群
    • 函数接口function Offspring = Variation(obj,Parent,nOffspring,operator,para)
    • 使用方法:
      1. O = obj.Variation(P)使用默认的operator对种群P操作,TODO
      2. O = obj.Variation(P,N)只返回(最多)前N个子代
      3. O = obj.Variation(P,N,Fcn)使用Fcn operator,只返回前N个子代
      4. O = obj.Variation(P,N,Fcn,Para)TODO
  • VariationDec

    • 作用: 生成子代种群的 decision变量矩阵
    • 函数接口function OffspringDec = VariationDec(obj,varargin)
  • ParameterSet

    • 使用者修改变量
  • ParameterFile

    • 从文件中修改变量
INDIVIDUAL类
使用注意事项
  • 四个变量都是以行向量形式返回
  • P 是 an array of INDIVIDUAL objects,P 是 INDIVIDUAL类的对象, P 的每一行是一个个体
  • 使用 P.decs, P.objs, P.cons ,P.adds可以获得对应的变量矩阵.
变量
  • dec
    • 个体的决定变量
  • obj
    • 个体的目标变量
  • con
  • add
方法
  • 构造函数

    • 作用: dec和add由构造函数赋值,con和obj由dec和add计算出
    • 函数接口function obj = INDIVIDUAL(Decs,addValue)
    • 使用:

      1. H = INDIVIDUAL(Dec)传入矩阵形式的decision 变量,返回an array of individuals
      2. H = INDIVIDUAL(Dec,AddProper)
  • decs
    • 作用: get the matrix of decision variables of the population
    • 函数接口function value = decs(obj)
  • objs
    • 作用: Get the matrix of objective values of the population
    • 函数接口function value = objs(obj)
  • cons
    • 作用: Get the matrix of constraint values of the population
  • adds
    • 作用: Get the matrix of additional property of the population
UniformPoint函数

UniformPoint() is a utility function in the folder Public for generating about Global.N uniformly distributed points with Global.M objectives on the unit hyperplane.

扩展

扩展算法
NSGA2举例
 function NSGAII(Global) %用GLOBAL类的对象作为参数
 % 初始化种群
 Population = Global.Initialization();
 % 非支配前沿
 FrontNo = NDSort(Population.objs, inf);
 % 拥挤密度
 CrowdDis = CrowdingDistance(Population.objs, FrontNo);
 % 检测适应值函数是否超出取值范围
 while Global.NotTermination(Population)
    MatingPool = TournamentSelection(2, Global.N, FrontNo, -CrowdDis);
    Offspring = Global.Variation(Population(MatingPool));
    [Population, FrontNo, CrowdDis] = …
    EnvironmentalSelection([Population, Offspring], Global.N);
 end
 end
扩展MOPs
扩展Operators
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值