精华内容
下载资源
问答
  • 基于距离转换的栅格地图路径规划方法,栅格法以栅格为单位记录环境信息,环境被量化成具有一定分辨率的栅格,能较好处理障碍物边界,避免了复杂的运算。
  • 利用遗传算法处理栅格地图的机器人路径规划的难点主要包括:1保证路径不间断,2保证路径不穿过障碍。 用遗传算法解决优化问题时的步骤是固定的,就是种群初始化,选择,交叉,变异,适应度计算这样,那么下面我就说...

    一、简介

    采用栅格对机器人的工作空间进行划分,再利用优化算法对机器人路径优化,是采用智能算法求最优路径的一个经典问题。目前,采用蚁群算法在栅格地图上进行路径优化取得比较好的效果,而利用遗传算法在栅格地图上进行路径优化在算法显得更加难以实现。
    利用遗传算法处理栅格地图的机器人路径规划的难点主要包括:1保证路径不间断,2保证路径不穿过障碍。
    用遗传算法解决优化问题时的步骤是固定的,就是种群初始化,选择,交叉,变异,适应度计算这样,那么下面我就说一下遗传算法求栅格地图中机器人路径规划在每个步骤的问题、难点以及解决办法。

    1、种群初始化

    首先要知道遗传算法种群初始化的定义。遗传算法种群初始化是生成一定种群数量的个体,每个个体是一个可行解。这里要注意是可行解,对于该问题也就是说是一个可行路径,也就是说应该是一个从路径起点到路径终点的,且不经过障碍的路径。怎样进行初始化种群得到可行路径是遗传算法求栅格路径的第一个难点也是最大难点。

    方法

    路径初始化可以分为两步:第一步生成必经节点路径,什么是必经节点路径?举个例子,比如对于10*10的栅格,从左下角编号1到右上角编号100的路径必经过第2行的一个点,第3行一个点……第9行的一个点,这是很显然的,那么我们在第二行的自由栅格中随机取一个节点、第3行的自由栅格中取一个节点……第9行自由栅格取一个节点,那么这就行程了一个必经点路径,当然这个路径也是间断的。所以需要第二步,第二步就是连接这些间断节点,而这个问题是该算法中最难的问题,因为在连接路径中,太难绕开障碍了,而且如果你绕开了障碍物,会发现失去了方向连不回来了。因此,在连接节点中采用中点连接法,但是中点,要取得有技巧,可在中点处取4或3个栅格,然后在这些栅格中找到自由栅格,等概率选择,如果有最坏得情形,这些中点处栅格全都是障碍,则在这些栅格中等概率选择一个作为路径一点,因此该方法保证了路径的连续性,但也有可能存在经过障碍的路径,而这种障碍的路径可以在适应度函数中进行惩罚。

    上述初始化路径的两步结束后,进行简化路径操作,即如果路径中有两个相同的节点,则去掉相同节点之间的一段,这个很容易理解。

    至此初始化路径结束,你已经成功了一大步!

    2、选择

    选择和遗传算法的选择是一样的,无需特殊改动,就是根据适应度进行选择。

    3、交叉

    交叉采用重复点交叉,这个也比较好理解,比如一条路径为[1 12 13 24 25 36 45 56 ],另一条路径为[ 1 14 25 35 46 56],这两条路径有一个公共节点25,进行交叉变成[1 12 13 24 25 35 46 56]和[1 14 25 36 45 56].

    4、变异

    变异的方法使用随机生成选择两个节点,并去掉这两个节点之间的路径,之后采用上述的中带你插入方法生成连续路径。

    5、适应度计算

    适应度计算路径长度和穿过障碍的个数,求和即可,这个比较间断不多说,下面展示一下我写的程序的效果。

    二、源代码

    % 基于遗传算法的栅格法机器人路径规划
    clc;
    clear all
    close all;
    % 输入数据,即栅格地图
    G=  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
       0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0;
       0 1 1 0 0 0 0 0 0 0 1 1 1 1 0 1 1 0 0 0;
       0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 0 0 0 0;
       0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 0 0 0 0;
       0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
       0 1 1 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0;
       0 0 0 0 0 0 1 1 1 0 1 0 1 1 0 0 0 0 0 0;
       0 1 1 1 0 0 1 1 0 0 1 0 1 1 0 0 0 0 0 0;
       0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
       0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0;
       0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0;
       0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 0;
       0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0;
       0 0 1 1 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0;
       0 0 1 1 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0;
       0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0;
       0 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 1 0;
       0 0 1 1 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 0;
       0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];
    ​
    p_start = 0;    % 起始序号
    p_end =399;    % 终止序号
    NP = 200;      % 种群数量
    max_gen = 2000;  % 最大进化代数
    pc = 0.5;      % 交叉概率
    pm = 0.5;      % 变异概率
    a = 1;         % 路径长度比重
    b = 7;         % 路径顺滑度比重
    %init_path = [];
    z = 1;
    new_pop1 = {}; % 元包类型路径
    [y, x] = size(G);
    % 起点所在列(从左到右编号1.2.3...)
    xs = mod(p_start, x) + 1;
    % 起点所在行(从上到下编号行1.2.3...)
    ys = fix(p_start / x) + 1;
    % 终点所在列、行
    xe = mod(p_end, x) + 1;
    ye = fix(p_end / x) + 1;% 种群初始化step1,必经节点,从起始点所在行开始往上,在每行中挑选一个自由栅格,构成必经节点
    pass_num = ye - ys + 1;
    pop = zeros(NP, pass_num);
    min_value=1000;
    for i = 1 : NP
        pop(i, 1) = p_start;
        j = 1;
        % 除去起点和终点
        for yk = ys+1 : ye-1
            j = j + 1;
            % 每一行的可行点
            can = [];
            for xk = 1 : x
                % 栅格序号
                no = (xk - 1) + (yk - 1) * x;
                if G(yk, xk) == 0
                    % 把点加入can矩阵中
                    can = [can no];
                end
            end
            can_num = length(can);
            % 产生随机整数
            index = randi(can_num);
            % 为每一行加一个可行点
            pop(i, j) = can(index);
        end
        pop(i, end) = p_end;
        %pop
        % 种群初始化step2将上述必经节点联结成无间断路径
        single_new_pop = generate_continuous_path(pop(i, :), G, x);
        %init_path = [init_path, single_new_pop];
        if ~isempty(single_new_pop)
            new_pop1(z, 1) = {single_new_pop};
            z = z + 1;
        end
    end
    ​
    % 计算初始化种群的适应度
    % 计算路径长度
    path_value = cal_path_value(new_pop1, x);
    % 计算路径平滑度
    path_smooth = cal_path_smooth(new_pop1, x);
    fit_value = a .* path_value .^ -1 + b .* path_smooth .^ -1;
    ​
    mean_path_value = zeros(1, max_gen);
    min_path_value = zeros(1, max_gen);
    % 循环迭代操作
    for i = 1 : max_gen
        % 选择操作
        new_pop2 = selection(new_pop1, fit_value);
        % 交叉操作
        new_pop2 = crossover(new_pop2, pc);
        % 变异操作
        new_pop2 = mutation(new_pop2, pm, G, x);
        % 更新种群
        new_pop1 = new_pop2;
        % 计算适应度值
        % 计算路径长度
        path_value = cal_path_value(new_pop1, x);
        % 计算路径平滑度
        path_smooth = cal_path_smooth(new_pop1, x);
        fit_value = a .* path_value .^ -1 + b .* path_smooth .^ -1;
        mean_path_value(1, i) = mean(path_value);
        [~, m] = max(fit_value);
        if  min(path_value)<min_value
            min_value=min(path_value);
        min_path_value(1, i) = min(path_value);
        else 
            min_path_value(1, i) = min_value;
        end
    end
    % 画每次迭代平均路径长度和最优路径长度图
    figure(1)
    plot(1:max_gen,  mean_path_value, 'r')
    hold on;
    title(['a = ', num2str(a)', ',b = ',num2str(b)','的优化曲线图']);
    xlabel('迭代次数');
    ylabel('路径长度');
    plot(1:max_gen, min_path_value, 'b')
    legend('平均路径长度', '最优路径长度');
    min_path_value(1, end)
    % 在地图上画路径
    [~, min_index] = max(fit_value);
    min_path = new_pop1{min_index, 1};
    figure(2)
    hold on;
    title(['a = ', num2str(a)', ',b = ',num2str(b)','遗传算法机器人运动轨迹']);
    xlabel('坐标x');
    ylabel('坐标y');
    DrawMap(G);
    [~, min_path_num] = size(min_path);
    for i = 1:min_path_num
        % 路径点所在列(从左到右编号1.2.3...x_min_path(1, i) = mod(min_path(1, i), x) + 1;
        % 路径点所在行(从上到下编号行1.2.3...y_min_path(1, i) = fix(min_path(1, i) / x) + 1;
    end
    hold on;
    plot(x_min_path, y_min_path, 'r')
    

    三、运行结果

    在这里插入图片描述

    四、备注

    版本:2014a

    展开全文
  • 路径规划是实现移动机器人自主导航的关键技术,是指在有障碍物的环境中,按照一定的评价标准(如距离、时间、能耗等),寻找到一条从起始点到目标点的无碰撞路径,这里选取最短距离路径规划的评价标准,即最短路径...

    一、简介

    假设有人想从A点移动到一墙之隔的B点,如下图,绿色的是起点A,红色是终点B,蓝色方块是中间的墙。
    在这里插入图片描述
    你首先注意到,搜索区域被我们划分成了方形网格。像这样,简化搜索区域,是寻路的第一步。这一方法把搜索区域简化成了一个二维数组。数组的每一个元素是网格的一个方块,方块被标记为可通过的和不可通过的。路径被描述为从A到B我们经过的方块的集合。一旦路径被找到,我们的人就从一个方格的中心走向另一个,直到到达目的地。

    这些中点被称为“节点”。当你阅读其他的寻路资料时,你将经常会看到人们讨论节点。为什么不把他们描述为方格呢?因为有可能你的路径被分割成其他不是方格的结构。他们完全可以是矩形,六角形,或者其他任意形状。节点能够被放置在形状的任意位置-可以在中心,或者沿着边界,或其他什么地方。我们使用这种系统,无论如何,因为它是最简单的。

    开始搜索
    正如我们处理上图网格的方法,一旦搜索区域被转化为容易处理的节点,下一步就是去引导一次找到最短路径的搜索。在A*寻路算法中,我们通过从点A开始,检查相邻方格的方式,向外扩展直到找到目标。

    我们做如下操作开始搜索:
    1,从点A开始,并且把它作为待处理点存入一个“开启列表”。开启列表就像一张购物清单。尽管现在列表里只有一个元素,但以后就会多起来。你的路径可能会通过它包含的方格,也可能不会。基本上,这是一个待检查方格的列表。

    2,寻找起点周围所有可到达或者可通过的方格,跳过有墙,水,或其他无法通过地形的方格。可到达或者可通过的方格加入开启列表。为所有这些方格保存点A作为“父方格”。当我们想描述路径的时候,父方格的资料是十分重要的。后面会解释它的具体用途。

    3,从开启列表中删除点A,把它加入到一个“关闭列表”,列表中保存所有不需要再次检查的方格。

    在这一点,你应该形成如图的结构。在图中,暗绿色方格是你起始方格的中心。它被用浅蓝色描边,以表示它被加入到关闭列表中了。所有的相邻格现在都在开启列表中,它们被用浅绿色描边。每个方格都有一个灰色指针反指他们的父方格,也就是开始的方格。

    在这里插入图片描述
    接着,我们选择开启列表中的临近方格,大致重复前面的过程,如下。但是,哪个方格是我们要选择的呢?是那个F值最低的。

    路径评分
    选择路径中经过哪个方格的关键是下面这个等式:

    F = G + H

    这里:

    • G = 从起点A,沿着产生的路径,移动到网格上指定方格的移动耗费。
    • H = 从网格上那个方格移动到终点B的预估移动耗费。这经常被称为启发式的,可能会让你有点迷惑。这样叫的原因是因为它只是个猜测。我们没办法事先知道路径的长度,因为路上可能存在各种障碍(墙,水,等等)。虽然本文只提供了一种计算H的方法,但是你可以在网上找到很多其他的方法。

    我们的路径是通过反复遍历开启列表并且选择具有最低F值的方格来生成的。文章将对这个过程做更详细的描述。首先,我们更深入的看看如何计算这个方程。

    正如上面所说,G表示沿路径从起点到当前点的移动耗费。在这个例子里,我们令水平或者垂直移动的耗费为10,对角线方向耗费为14。我们取这些值是因为沿对角线的距离是沿水平或垂直移动耗费的的根号2(别怕),或者约1.414倍。为了简化,我们用10和14近似。比例基本正确,同时我们避免了求根运算和小数。这不是只因为我们怕麻烦或者不喜欢数学。使用这样的整数对计算机来说也更快捷。你不久就会发现,如果你不使用这些简化方法,寻路会变得很慢。

    既然我们在计算沿特定路径通往某个方格的G值,求值的方法就是取它父节点的G值,然后依照它相对父节点是对角线方向或者直角方向(非对角线),分别增加14和10。(某个方格的G值=父节点的G值+10或者+14)例子中这个方法的需求会变得更多,因为我们从起点方格以外获取了不止一个方格。

    H值可以用不同的方法估算。我们这里使用的方法被称为曼哈顿方法,它计算从当前格到目的格之间水平和垂直的方格的数量总和,忽略对角线方向。然后把结果乘以10。这被成为曼哈顿方法是因为它看起来像计算城市中从一个地方到另外一个地方的街区数,在那里你不能沿对角线方向穿过街区。很重要的一点,我们忽略了一切障碍物。这是对剩余距离的一个估算,而非实际值,这也是这一方法被称为启发式的原因。

    F的值是G和H的和。第一步搜索的结果可以在下面的图表中看到。F,G和H的评分被写在每个方格里。正如在紧挨起始格右侧的方格所表示的,F被打印在左上角,G在左下角,H则在右下角。
    在这里插入图片描述
    现在我们来看看这些方格。写字母的方格里,G = 10。这是因为它只在水平方向偏离起始格一个格距。紧邻起始格的上方,下方和左边的方格的G值都等于10。对角线方向的方格的G值是14。

    H值通过求解到红色目标格的曼哈顿距离(|x2-x1|+|y2-y1|)*10得到,其中只在水平和垂直方向移动,并且忽略中间的墙。用这种方法,起点右侧紧邻的方格离红色方格有3格距离,H值就是30。这块方格上方的方格有4格距离(记住,只能在水平和垂直方向移动),H值是40。你大致应该知道如何计算其他方格的H值了~。

    每个格子的F值,还是简单的由G和H相加得到。

    继续搜索

    为了继续搜索,我们简单的从开启列表中选择F值最低的方格。然后,对选中的方格做如下处理:

    4,把它从开启列表中删除,然后添加到关闭列表中。

    5,检查所有相邻格子。跳过那些已经在关闭列表中的或者不可通过的(有墙,水的地形,或者其他无法通过的地形),把他们添加进开启列表,如果他们还不在里面的话。把选中的方格作为新的方格的父节点。

    6,如果某个相邻格已经在开启列表里了,检查现在的这条路径是否更好。换句话说,检查如果我们用新的路径到达它的话,G值是否会更低一些。如果不是,那就什么都不做。

    另一方面,如果新的G值更低,那就把相邻方格的父节点改为目前选中的方格(在上面的图表中,把箭头的方向改为指向这个方格)。最后,重新计算F和G的值。如果这看起来不够清晰,你可以看下面的图示。

    好了,让我们看看它是怎么运作的。我们最初的9格方格中,在起点被切换到关闭列表中后,还剩8格留在开启列表中。这里面,F值最低的那个是起始格右侧紧邻的格子,它的F值是40。因此我们选择这一格作为下一个要处理的方格。在紧随的图中,它被用蓝色突出显示。
    在这里插入图片描述
    首先,我们把它从开启列表中取出,放入关闭列表(这就是他被蓝色突出显示的原因)。然后我们检查相邻的格子。哦,右侧的三个格子是墙,所以我们略过。左侧的一个格子是起始格。它在关闭列表里,所以我们也跳过它。

    其他4格已经在开启列表里了,于是我们检查G值来判定,如果通过这一格到达那里,路径是否更好。我们来看选中格子下面的方格。它的G值是14。如果我们从当前格移动到那里,G值就会等于20(到达当前格的G值是10,移动到上面的格子将使得G值增加10)。因为G值20大于14,所以这不是更好的路径。如果你看图,就能理解。与其通过先水平移动一格,再垂直移动一格,还不如直接沿对角线方向移动一格来得简单。

    当我们对已经存在于开启列表中的4个临近格重复这一过程的时候,我们发现没有一条路径可以通过使用当前格子得到改善,所以我们不做任何改变。既然我们已经检查过了所有邻近格,那么就可以移动到下一格了。

    于是我们检索开启列表,现在里面只有7格了,我们仍然选择其中F值最低的。有趣的是,这次,有两个格子的数值都是54。我们如何选择?这并不麻烦。从速度上考虑,选择最后添加进列表的格子会更快捷。这种导致了寻路过程中,在靠近目标的时候,优先使用新找到的格子的偏好。但这无关紧要。(对相同数值的不同对待,导致不同版本的A*算法找到等长的不同路径。)

    那我们就选择起始格右下方的格子,如图。
    在这里插入图片描述
    这次,当我们检查相邻格的时候,发现右侧是墙,于是略过。上面一格也被略过。我们也略过了墙下面的格子。为什么呢?因为你不能在不穿越墙角的情况下直接到达那个格子。你的确需要先往下走然后到达那一格,按部就班的走过那个拐角。(注解:穿越拐角的规则是可选的。它取决于你的节点是如何放置的。)

    这样一来,就剩下了其他5格。当前格下面的另外两个格子目前不在开启列表中,于是我们添加他们,并且把当前格指定为他们的父节点。其余3格,两个已经在关闭列表中(起始格,和当前格上方的格子,在表格中蓝色高亮显示),于是我们略过它们。最后一格,在当前格的左侧,将被检查通过这条路径,G值是否更低。不必担心,我们已经准备好检查开启列表中的下一格了。

    我们重复这个过程,直到目标格被添加进关闭列表(注解),就如在下面的图中所看到的。
    在这里插入图片描述
    注意,起始格下方格子的父节点已经和前面不同的。之前它的G值是28,并且指向右上方的格子。现在它的G值是20,指向它上方的格子。这在寻路过程中的某处发生,当应用新路径时,G值经过检查变得低了-于是父节点被重新指定,G和F值被重新计算。尽管这一变化在这个例子中并不重要,在很多场合,这种变化会导致寻路结果的巨大变化。

    那么,我们怎么确定这条路径呢?很简单,从红色的目标格开始,按箭头的方向朝父节点移动。这最终会引导你回到起始格,这就是你的路径!看起来应该像图中那样。从起始格A移动到目标格B只是简单的从每个格子(节点)的中点沿路径移动到下一个,直到你到达目标点。就这么简单。

    在这里插入图片描述
    这里先给出下一个JAVA版的代码:

    A星算法步骤:
    1.起点先添加到开启列表中

    2.开启列表中有节点的话,取出第一个节点,即最小F值的节点,
    判断此节点是否是目标点,是则找到了,跳出;
    根据此节点取得八个方向的节点,求出G,H,F值;
    判断每个节点在地图中是否能通过,不能通过则加入关闭列表中,跳出;
    判断每个节点是否在关闭列表中,在则跳出;
    判断每个节点是否在开启列表中,在则更新G值,F值,还更新其父节点;不在则将其添加到开启列表中,计算G值,H值,F值,添加其节点。

    3.把此节点从开启列表中删除,再添加到关闭列表中;

    4.把开启列表中按照F值最小的节点进行排序,最小的F值在第一个;

    5.重复2,3,4步骤,直到目标点在开启列表中,即找到了;目标点不在开启列表中,开启列表为空,即没找到

    二、源代码

    %% A* demo
     
    clc;
    clear;
    % pause(3); 
    %% init
    n=30;
    starNum=1;
    % starNum = randi(n*n,[1,1]);
    goalNum=172;
    goalNum = randi(n*n,[1,1]);
    banper=0.25;
    %% map init
    figure('name','A*','NumberTitle','off','MenuBar','none');
    global point 
    for ii=1:n*n
        point(ii).num = ii;
        point(ii).father=[];
        point(ii).Gcost=[];
        point(ii).Hcost=[];
    end
    %% banper
    banList=[randi(n*n,[1,floor(banper*n*n)])];
    load banList
    banList(find(banList==goalNum))=[];
    for jj = 1:length(banList)
        if banList(jj)~=goalNum || banList(jj)~=starNum
            point(banList(jj)).Gcost = Inf;
        end
    end
    point(starNum).Gcost=0;
    point(starNum).father = point(starNum).num;
    point(starNum).Hcost=getHcost(point(starNum),point(goalNum),n);
     
    %% A*core
    openList = [];
    closeList = [];
    closeListNum=[];
    openListNum=[];
    openList = [openList,point(starNum)];
    while length(openList)
        % opneList
        costList = getCost(openList,point(goalNum),n);
        currentPoint = openList(find(costList==min(costList),1));
        openList(find(min(costList)==costList,1))=[];
        closeList = [closeList,currentPoint];
        neighbourNum = getNeighbour(currentPoint,n);
        closeListNum = cat(1,closeList.num);
        openListNum = cat(1,openList.num);
        for ii = 1:length(neighbourNum)
            if neighbourNum(ii)==point(goalNum).num
                point(neighbourNum(ii)).father = currentPoint.num;
                point(goalNum).father = currentPoint.num;
                disp('ok')
                routPlot(goalNum,n);
                return;
            end
                log1=0;
                try
                    tmp=point(neighbourNum(ii)).Gcost;
                    if tmp ==inf
                        log1 = 1;
                    end
                catch
                    log1=0;
                end
                if log1 || ismember(neighbourNum(ii),closeListNum)
                    continue;
                elseif (ismember(neighbourNum(ii),openListNum))
                oldGcost = getGcost(point(neighbourNum(ii)),n);
                father = point(neighbourNum(ii)).father;
                point(neighbourNum(ii)).father = currentPoint.num;
                newGcost = getGcost(point(neighbourNum(ii)),n);
                if newGcost>oldGcost
                    point(neighbourNum(ii)).father = father;
                else
                    point(neighbourNum(ii)).Gcost = newGcost;
                end
                continue;
            elseif ~ismember(neighbourNum(ii),closeListNum)
                point(neighbourNum(ii)).father = currentPoint.num;
                point(neighbourNum(ii)).Gcost = getGcost(point(neighbourNum(ii)),n);
                point(neighbourNum(ii)).Hcost = getHcost(point(neighbourNum(ii)),point(goalNum),n);
                openList = [openList,point(neighbourNum(ii))];
                end
        end
        closeListNum = cat(1,closeList.num);
        openListNum = cat(1,openList.num);
        pause(0.1);
        mydrawnow(starNum,goalNum,banList,closeListNum,openListNum,n);
    end
     
    
    ## ```三、运行结果
    
    ![在这里插入图片描述](https://img-blog.csdnimg.cn/2021011309440483.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70)
    ## 三、备注
    版本:2014a
    
    
    
    展开全文
  • 基于蚁群算法的机器人路径规划算法。使用网格离散化的方法对带有障碍物的环境建模,使用邻接矩阵存储该环境,使得问题转化为蚁群算法寻找最短路径。蚁群算法最早是由Marco Dorigo等人在1991年提出,他们在研究新型...

    一、简介

    路径规划是实现移动机器人自主导航的关键技术,是指在有障碍物的环境中,按照一定的评价标准(如距离、时间、能耗等),寻找到一条从起始点到目标点的无碰撞路径,这里选取最短距离路径规划的评价标准,即最短路径规划问题。

    1.路径规划数学模型的建立
    将移动机器人周围环境用一组数据进行抽象表达,建立二维或三维的环境模型,得到移动机器人能够理解分析的环境数据,是机器人路径规划的基本前提。我这里用的是栅格法,其原理是将周围环境看成一个二维平面,将平面分成一个个等面积大小的具有二值信息的栅格,每个栅格中存储着周围环境信息量,下图我给出了一个栅格法地图,方便大家更好的理解栅格地图。这里设计的栅格地图为一个20×20的地形矩阵,黑色的地方表示有障碍,白色的地方表示没有障碍。
    在这里插入图片描述
    图1 栅格法地图
    在用栅格法建立环境模型时,为了将环境信息转换成移动机器人可以识别的数据,一般采用序号法标记环境地图信息,即将栅格地图中一个个栅格从序号1依次累加直到标记到最后一个栅格。如图2所示。
    在这里插入图片描述
    在这里插入图片描述
    图3 八叉树搜索策略
    那么,怎么判断一个栅格点是否为另一个栅格点的相邻栅格点呢,另外,又怎么判断是否为有障碍栅格呢。这就需建立矩阵D,记录每个栅格点至其相邻栅格点的代价值。本例中栅格地图有20×20个栅格点,则D的大小为400×400,其中列是起点栅格,行是局部终点栅格,各栅格点至其各相邻无障碍栅格点的代价值非零,而有障碍栅格及非相邻栅格设为0。
    这里需要说明的是,我的MATLAB程序来自于:
    版权声明:本文为CSDN博主「qq_40443076」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_40443076/article/details/88179836
    这里主要介绍基于蚁群算法的机器人最短路径规划的思路,以及我在运行MALTLAB程序的时候,学到的内容。

    2.机器人最短路径规划的实现步骤
    蚁周模型实现机器人最短路径规划的流程图

    为了方便大家更好地理解蚁群算法的原理及实现过程,其流程图如图4所示。(流程图较长,我截图了两段。)
    在这里插入图片描述
    在这里插入图片描述
    图4 基于蚁群算法的机器人最小路径规划流程图
    图中公式(3)(4)的具体表达在下边的具体步骤里。

    蚁周模型实现机器人最短路径规划的具体步骤

    **步骤1:**给出栅格地图的地形矩阵;初始化信息素矩阵 Tau(记录每个栅格至其他栅格的信息素量),最大迭代次数K,蚂蚁个数M,表征信息素重要程度的参数 、表征启发式信息重要程度的参数 ,信息素蒸发系数 ,信息素增加强度系数Q及启发式信息矩阵
    **步骤2:**构建启发式信息矩阵。按式(1)和式(2)计算每个栅格至目标点的距离,启发式信息素取为至目标点距离的倒数,距离越短,启发式因子越大,障碍物处的启发式信息为0。建立矩阵D,用以存储每个栅格点至各自相邻无障碍栅格点的代价值。
    **步骤3:**对于每一只蚂蚁,初始化蚂蚁爬行的路径及路径长度,将禁忌列表全部初始化为1;蚂蚁从起始点出发开始搜索路径,找出当前栅格点的所有无障碍相邻栅格点(即矩阵D中相应元素不为0的栅格点),再根据禁忌列表筛选出当前可选择的栅格点。
    **步骤4:**如果起始点是目标点,且可选栅格点个数大于等于1,则根据式(3)计算蚂蚁从当前栅格点转移到各相邻栅格点的概率,
    在这里插入图片描述

    二、源代码

    function varargout = main_GUI_xu(varargin)
    % MAIN_GUI_XU MATLAB code for main_GUI_xu.fig
    %      MAIN_GUI_XU, by itself, creates a new MAIN_GUI_XU or raises the existing
    %      singleton*.
    %
    %      H = MAIN_GUI_XU returns the handle to a new MAIN_GUI_XU or the handle to
    %      the existing singleton*.
    %
    %      MAIN_GUI_XU('CALLBACK',hObject,eventData,handles,...) calls the local
    %      function named CALLBACK in MAIN_GUI_XU.M with the given input arguments.
    %
    %      MAIN_GUI_XU('Property','Value',...) creates a new MAIN_GUI_XU or raises the
    %      existing singleton*.  Starting from the left, property value pairs are
    %      applied to the GUI before main_GUI_xu_OpeningFcn gets called.  An
    %      unrecognized property name or invalid value makes property application
    %      stop.  All inputs are passed to main_GUI_xu_OpeningFcn via varargin.
    %
    %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    %      instance to run (singleton)".
    %
    % See also: GUIDE, GUIDATA, GUIHANDLES
     
    % Edit the above text to modify the response to help main_GUI_xu
     
    % Last Modified by GUIDE v2.5 22-Mar-2017 15:58:57
     
    % Begin initialization code - DO NOT EDIT
    gui_Singleton = 1;
    gui_State = struct('gui_Name',       mfilename, ...
                       'gui_Singleton',  gui_Singleton, ...
                       'gui_OpeningFcn', @main_GUI_xu_OpeningFcn, ...
                       'gui_OutputFcn',  @main_GUI_xu_OutputFcn, ...
                       'gui_LayoutFcn',  [] , ...
                       'gui_Callback',   []);
    if nargin && ischar(varargin{1})
        gui_State.gui_Callback = str2func(varargin{1});
    end
     
    if nargout
        [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    else
        gui_mainfcn(gui_State, varargin{:});
    end
    % End initialization code - DO NOT EDIT
     
     
    % --- Executes just before main_GUI_xu is made visible.
    function main_GUI_xu_OpeningFcn(hObject, eventdata, handles, varargin)
    % This function has no output args, see OutputFcn.
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % varargin   command line arguments to main_GUI_xu (see VARARGIN)
    % Choose default command line output for main_GUI_xu
    handles.output = hObject;
     
    % Update handles structure
    guidata(hObject, handles);
     
    % UIWAIT makes main_GUI_xu wait for user response (see UIRESUME)
    % uiwait(handles.figure1);
    init_all(handles)
    set(handles.edit38,'string','先选择实验目的,默认选择目的一,即运行一种算法');
     
    % --- Outputs from this function are returned to the command line.
    function varargout = main_GUI_xu_OutputFcn(hObject, eventdata, handles) 
    % varargout  cell array for returning output args (see VARARGOUT);
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Get default command line output from handles structure
    varargout{1} = handles.output;
     
     
    % --- Executes on selection change in listbox1.
    function listbox1_Callback(hObject, eventdata, handles)
    % hObject    handle to listbox1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
    %        contents{get(hObject,'Value')} returns selected item from listbox1
     
     
    % --- Executes during object creation, after setting all properties.
    function listbox1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to listbox1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: listbox controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton1.
    function pushbutton1_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % 绘制栅格线和调用figure的屏幕回调函数
    global barrier pushbutton1_userdata
    pushbutton1_userdata = 1; % 控制设计障碍物按钮是否能够使用
    set(handles.edit38,'string','障碍物设计完成后,请点击输出障碍物按钮,否则容易出错');
    axes(handles.axes1)
    cla reset
    n_barrier = str2double(get(handles.edit1,'string'));
    barrier = zeros(n_barrier,n_barrier);
    axes(handles.axes1);
    s.hf = get(handles.axes1,'parent');
    % 绘制栅格边线
    for i=0:1:n_barrier
        plot([0,n_barrier],[i,i],'color','k');
        hold on
        axis([0,n_barrier,0,n_barrier])
        for j=0:1:n_barrier
            plot([i,i],[0,n_barrier],'color','k') ;
            hold on
            axis([0,n_barrier,0,n_barrier])
        end
    end
    % 设置figure的WindowButtonDownFcn属性
    set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn)
     
     
    % --- Executes on selection change in popupmenu1.
    function popupmenu1_Callback(hObject, eventdata, handles)
    % hObject    handle to popupmenu1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
    %        contents{get(hObject,'Value')} returns selected item from popupmenu1
    global barrier_select start_select goal_select pushbutton1_userdata barrier start goal
    barrier_value = get(handles.popupmenu1,'value');
    cd('barrier')
    if barrier_value==2
        barrier_select = xlsread('e_barrier');
        start_select = 20;
        goal_select = 295;
        pushbutton1_userdata = 0;
    elseif barrier_value==3
        barrier_select = xlsread('simple_e');
        start_select = 20;
        goal_select = 295;
        pushbutton1_userdata = 0;
    elseif barrier_value==4
        barrier_select = xlsread('u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==5
        barrier_select = xlsread('light_u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==6
        barrier_select = xlsread('right_u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==7
        barrier_select = xlsread('z_barrier');
        start_select = 49;
        goal_select = 369;
        pushbutton1_userdata = 0;
    elseif barrier_value==8
        barrier_select = xlsread('complex_z');
        start_select = 47;
        goal_select = 367;
        pushbutton1_userdata = 0;
    elseif barrier_value==9
        barrier_select = xlsread('complex_1');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==10
        barrier_select = xlsread('complex_2');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==11
        barrier_select = xlsread('complex_30');
        start_select = 1;
        goal_select = 890;
        pushbutton1_userdata = 0;
    elseif barrier_value==12
        barrier_select = xlsread('complex_50_1');
        start_select = 1;
        goal_select = 2500;
    elseif barrier_value==13
        barrier_select = xlsread('complex_50_2');
        start_select = 1;
        goal_select = 2500;
        pushbutton1_userdata = 0;
    elseif barrier_value==14
        barrier_select = xlsread('complex_50_3');
        start_select = 1;
        goal_select = 2500;
        pushbutton1_userdata = 0;
    elseif barrier_value==15
        barrier_select = xlsread('barrier_tmp');
        set(handles.edit18,'string','请选择起点和终点')
        pushbutton1_userdata = 0;
        start = 0;
        goal = 0;
    end
    cd ..
    X = size(barrier_select,1);
    Y = size(barrier_select,2);
    axes(handles.axes1);
    barrier = barrier_select;
    figure_barrier(barrier,handles);
    start = start_select;
    goal = goal_select;
     
    set(handles.edit2,'string',num2str(start) );
    set(handles.edit3,'string',num2str(goal) );
    % 画起点
        x_goal_new = ( mod(start-1,X) +1-0.5);
        y_goal_new = ( Y- ceil(start/Y) +1-0.5);
        x_start_floor = floor(x_goal_new);
        x_start_ceil = ceil(x_goal_new);
        y_start_floor = floor(y_goal_new);
        y_start_ceil = ceil(y_goal_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[0,1,0]);
    % 画终点
    x_goal_new = ( mod(goal-1,X) +1-0.5);
    y_goal_new = ( Y- ceil(goal/Y) +1-0.5);
    x_start_floor = floor(x_goal_new);
    x_start_ceil = ceil(x_goal_new);
    y_start_floor = floor(y_goal_new);
    y_start_ceil = ceil(y_goal_new);
    x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
    y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
    fill(x_data,y_data,[1,0,0]);
    % 设置通用参数
    num_ant = 2*X;
    set(handles.edit9,'string',num_ant);
    set(handles.edit10,'string',250);
    set(handles.edit18,'string',10)
    set(handles.axes2,'visible','on')
     
     
    % --- Executes during object creation, after setting all properties.
    function popupmenu1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to popupmenu1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: popupmenu controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton1.
    function radiobutton1_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton1
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','on')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton2.
    function radiobutton2_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton2
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','on')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton3.
    function radiobutton3_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton3
     
     
     
    function edit1_Callback(hObject, eventdata, handles)
    % hObject    handle to edit1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit1 as text
    %        str2double(get(hObject,'String')) returns contents of edit1 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit2_Callback(hObject, eventdata, handles)
    % hObject    handle to edit2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit2 as text
    %        str2double(get(hObject,'String')) returns contents of edit2 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit2_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit3_Callback(hObject, eventdata, handles)
    % hObject    handle to edit3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit3 as text
    %        str2double(get(hObject,'String')) returns contents of edit3 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit3_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton2.
    function pushbutton2_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 鼠标取起点
    global permission_start
    permission_start = 1;
    set(handles.edit2,'string',[]);
    set(handles.edit3,'string',[]);
    axes(handles.axes1);
    if permission_start==1
        set(handles.edit38,'string','选择起点结束后请点击结束按钮,否则易出错');
        s.hf = get(handles.axes1,'parent');
        set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn_point_start);
    end
    global start
    figure_start(start)
     
      
    function figure1_windowbuttondownfcn_point_start(hobj,event)
    global barrier
    X = size(barrier,1);
    Y = size(barrier,2);
    global permission_start
    if permission_start==1
        if strcmp(get(hobj,'SelectionType'),'normal')
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标;
                x_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y_ceil = ceil(y(1));
                point_start = [x_ceil,y_ceil];
                start_tmp =  point_start(1) + ( Y-point_start(2) )*X;
                figure_start(start_tmp);
        end
    end
     
     
    % 画出起点函数
    function figure_start(start_new)
    global barrier start 
    if start_new~=start
        X = size(barrier,1);
        Y = size(barrier,2);
        % 清除以前的点的消息
        x_start = ( mod(start-1,X) +1-0.5);
        y_start = ( Y- ceil(start/Y) +1-0.5);
        x_start_floor = floor(x_start);
        x_start_ceil = ceil(x_start);
        y_start_floor = floor(y_start);
        y_start_ceil = ceil(y_start);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,1,1]);
        %% 画新的点
        x_start_new = ( mod(start_new-1,X) +1-0.5);
        y_start_new = ( Y- ceil(start_new/Y) +1-0.5);
        x_start_floor = floor(x_start_new);
        x_start_ceil = ceil(x_start_new);
        y_start_floor = floor(y_start_new);
        y_start_ceil = ceil(y_start_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[0,1,0]);
        start = start_new;
        data = '起点是%4.0f\n';
        fprintf(data,start)
    %     set(handles.edit2,'string',start)
    end
     
    % function test(hObject, eventdata, handles)
    % global start start_new
    % if start~=start_new
    %     set(hanles.edit2,'value',start_new)
    % end
     
    % 画终点的函数
    function figure_goal(goal_new)
    global barrier goal
    if goal_new~=goal
        X = size(barrier,1);
        Y = size(barrier,2);
        % 清除以前的点的消息
        x_goal = ( mod(goal-1,X) +1-0.5);
        y_goal = ( Y- ceil(goal/Y) +1-0.5);
        x_start_floor = floor(x_goal);
        x_start_ceil = ceil(x_goal);
        y_start_floor = floor(y_goal);
        y_start_ceil = ceil(y_goal);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,1,1]);
        %% 画新的点
        x_goal_new = ( mod(goal_new-1,X) +1-0.5);
        y_goal_new = ( Y- ceil(goal_new/Y) +1-0.5);
        x_start_floor = floor(x_goal_new);
        x_start_ceil = ceil(x_goal_new);
        y_start_floor = floor(y_goal_new);
        y_start_ceil = ceil(y_goal_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,0,0]);
        goal = goal_new;
    end
     
     
    % --- Executes on button press in pushbutton3.
    function pushbutton3_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 画终点
    global permission_goal
    permission_goal = 1;
    set(handles.edit2,'string',[])
    set(handles.edit3,'string',[])
    axes(handles.axes1);
    if permission_goal==1
        set(handles.edit38,'string','选择起点结束后请点击结束按钮,否则易出错');
        s.hf = get(handles.axes1,'parent');
        set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn_point_goal);
    end
    global goal
    figure_goal(goal);
     
     
    function figure1_windowbuttondownfcn_point_goal(hobj,event)
    global barrier
    X = size(barrier,1);
    Y = size(barrier,2);
    global permission_goal
    if permission_goal==1
        if strcmp(get(hobj,'SelectionType'),'normal')
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标;
                x_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y_ceil = ceil(y(1));
                point_goal = [x_ceil,y_ceil];
                goal =  point_goal(1) + ( Y-point_goal(2) )*X;
                figure_goal(goal);
                data = '终点是%4.0f\n';
                fprintf(data,goal)
        end
    end
     
     
    function edit5_Callback(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit201 as text
    %        str2double(get(hObject,'String')) returns contents of edit201 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit5_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit6_Callback(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit202 as text
    %        str2double(get(hObject,'String')) returns contents of edit202 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit6_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit7_Callback(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit203 as text
    %        str2double(get(hObject,'String')) returns contents of edit203 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit7_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit8_Callback(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit204 as text
    %        str2double(get(hObject,'String')) returns contents of edit204 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit8_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit9_Callback(hObject, eventdata, handles)
    % hObject    handle to edit9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit9 as text
    %        str2double(get(hObject,'String')) returns contents of edit9 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit9_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit10_Callback(hObject, eventdata, handles)
    % hObject    handle to edit10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit10 as text
    %        str2double(get(hObject,'String')) returns contents of edit10 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit10_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton4.
    function radiobutton4_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton4 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton4
     
     
    % --- Executes on button press in pushbutton4.
    function pushbutton4_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton4 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason start goal 
    global h_waitbar
    set(handles.edit57,'string',1);set(handles.edit58,'string',1);set(handles.edit59,'string',1);
    set(handles.edit60,'string',1);set(handles.edit61,'string',1);
    set(handles.edit2,'string',start);
    set(handles.edit3,'string',goal);
    set(handles.edit38,'string','正在运行');
    set(handles.text60,'visible','off')
    tic;
    h_waitbar = waitbar(0,'正在运行,请稍后...');
    if reason == 1 % 如果是第一个目的,即选择一种算法进行分析,则选择一种算法运行
        prime_only_one_algorithm(hObject, eventdata, handles)
    elseif reason==2 % 如果是第二个目的,即选择多种算法进行分析
        prime_multi_algorithm(hObject, eventdata, handles)
    end
    delete(h_waitbar);
    time_algorithm = round(toc);
    tip_time = ['运行结束,已运行',num2str(time_algorithm),'秒'];
    set(handles.edit38,'string',tip_time);
     
     
    function edit91_Callback(hObject, eventdata, handles)
    % hObject    handle to edit91 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit91 as text
    %        str2double(get(hObject,'String')) returns contents of edit91 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit91_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit91 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit12_Callback(hObject, eventdata, handles)
    % hObject    handle to edit12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit12 as text
    %        str2double(get(hObject,'String')) returns contents of edit12 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit12_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit13_Callback(hObject, eventdata, handles)
    % hObject    handle to edit13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit13 as text
    %        str2double(get(hObject,'String')) returns contents of edit13 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit13_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit14_Callback(hObject, eventdata, handles)
    % hObject    handle to edit14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit14 as text
    %        str2double(get(hObject,'String')) returns contents of edit14 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit14_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit92_Callback(hObject, eventdata, handles)
    % hObject    handle to edit92 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit92 as text
    %        str2double(get(hObject,'String')) returns contents of edit92 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit92_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit92 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit16_Callback(hObject, eventdata, handles)
    % hObject    handle to edit16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit16 as text
    %        str2double(get(hObject,'String')) returns contents of edit16 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit16_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit94_Callback(hObject, eventdata, handles)
    % hObject    handle to edit94 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit94 as text
    %        str2double(get(hObject,'String')) returns contents of edit94 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit94_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit94 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit18_Callback(hObject, eventdata, handles)
    % hObject    handle to edit18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit18 as text
    %        str2double(get(hObject,'String')) returns contents of edit18 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit18_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton5.
    function radiobutton5_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton5
    set(handles.uipanel200,'visible','on')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton6.
    function radiobutton6_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton6 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton6
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','on')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton7.
    function radiobutton7_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton7 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton7
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','on')
     
    % --- Executes when figure1 is resized.
    function figure1_ResizeFcn(hObject, eventdata, handles)
    % hObject    handle to figure1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit93_Callback(hObject, eventdata, handles)
    % hObject    handle to edit93 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit93 as text
    %        str2double(get(hObject,'String')) returns contents of edit93 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit93_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit93 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit24_Callback(hObject, eventdata, handles)
    % hObject    handle to edit24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit24 as text
    %        str2double(get(hObject,'String')) returns contents of edit24 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit24_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit25_Callback(hObject, eventdata, handles)
    % hObject    handle to edit25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit25 as text
    %        str2double(get(hObject,'String')) returns contents of edit25 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit25_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit26_Callback(hObject, eventdata, handles)
    % hObject    handle to edit26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit26 as text
    %        str2double(get(hObject,'String')) returns contents of edit26 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit26_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit27_Callback(hObject, eventdata, handles)
    % hObject    handle to edit27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit27 as text
    %        str2double(get(hObject,'String')) returns contents of edit27 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit27_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit28_Callback(hObject, eventdata, handles)
    % hObject    handle to edit28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit28 as text
    %        str2double(get(hObject,'String')) returns contents of edit28 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit28_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit101_Callback(hObject, eventdata, handles)
    % hObject    handle to edit101 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit101 as text
    %        str2double(get(hObject,'String')) returns contents of edit101 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit101_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit101 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit102_Callback(hObject, eventdata, handles)
    % hObject    handle to edit102 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit102 as text
    %        str2double(get(hObject,'String')) returns contents of edit102 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit102_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit102 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit104_Callback(hObject, eventdata, handles)
    % hObject    handle to edit104 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit104 as text
    %        str2double(get(hObject,'String')) returns contents of edit104 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit104_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit104 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit105_Callback(hObject, eventdata, handles)
    % hObject    handle to edit105 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit105 as text
    %        str2double(get(hObject,'String')) returns contents of edit105 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit105_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit105 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit106_Callback(hObject, eventdata, handles)
    % hObject    handle to edit106 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit106 as text
    %        str2double(get(hObject,'String')) returns contents of edit106 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit106_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit106 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton5.
    function pushbutton5_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton6.
    function pushbutton6_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton6 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton7.
    function pushbutton7_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton7 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton8.
    function pushbutton8_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton8 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in radiobutton9.
    function radiobutton9_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton9
     
     
    % --- Executes on button press in radiobutton10.
    function radiobutton10_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton10
     
     
    % --- Executes on button press in pushbutton9.
    function pushbutton9_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton10.
    function pushbutton10_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton11.
    function pushbutton11_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton11 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit34_Callback(hObject, eventdata, handles)
    % hObject    handle to edit34 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit34 as text
    %        str2double(get(hObject,'String')) returns contents of edit34 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit34_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit34 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit35_Callback(hObject, eventdata, handles)
    % hObject    handle to edit35 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit35 as text
    %        str2double(get(hObject,'String')) returns contents of edit35 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit35_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit35 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton11.
    function radiobutton11_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton11 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton11
     
     
    % --- Executes on button press in radiobutton12.
    function radiobutton12_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton12
     
     
    % --- Executes on button press in pushbutton12.
    function pushbutton12_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % --------------------------------------------------------------------
    function Untitled_1_Callback(hObject, eventdata, handles)
    % hObject    handle to Untitled_1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    function figure1_windowbuttondownfcn(hobj,event)
    % point_data 输出,输出当前的一个点
    % 定义figure的回调函数
    global draw_enable x y data barrier pushbutton1_userdata
    % if pushbutton1_userdata == 0
    %     set(handles.edit38,'string','如果需要设计障碍物图形,请先点击设计障碍物按钮');
    % disp('如果需要设计障碍物图形,请先点击设计障碍物按钮')
    if pushbutton1_userdata ==1
        n_barrier = size(barrier,1);
        % 若figure的selectiontype属性值为normal,则表示单击鼠标左键
        if strcmp(get(hobj,'SelectionType'),'normal')
            draw_enable = 1;
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标
                x1_floor = floor(x(1));
                x1_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y1_floor = floor(y(1));
                y1_ceil = ceil(y(1));
            data = [x1_floor,y1_floor;...
                    x1_ceil,y1_floor;...
                    x1_ceil,y1_ceil;...
                    x1_floor,y1_ceil]; % 依次取该点的周围四个顶点
            x_data = [x1_floor,x1_ceil,x1_ceil,x1_floor];
            y_data = [y1_floor,y1_floor,y1_ceil,y1_ceil];
            fill(x_data,y_data,[0,0,0]); % 填充这个方格为黑色
            % 设置这个方格不可用,即设置barrier中对应方格为1(表示该方格是障碍)
            y1_ceil_temp = n_barrier - y1_ceil + 1;
            barrier(y1_ceil_temp,x1_ceil) = 1;
        end
        % 如果figure的selectiontype属性值为alt,则表示双击鼠标,使方格为白色,可以安全行走
        if strcmp(get(hobj,'selectiontype'),'open')
            draw_enable = 0;
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标
                x1_floor = floor(x(1));
                x1_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y1_floor = floor(y(1));
                y1_ceil = ceil(y(1));
            data = [x1_floor,y1_floor;...
                    x1_ceil,y1_floor;...
                    x1_ceil,y1_ceil;...
                    x1_floor,y1_ceil]; % 依次取该点的周围四个顶点
            x_data = [x1_floor,x1_ceil,x1_ceil,x1_floor];
            y_data = [y1_floor,y1_floor,y1_ceil,y1_ceil];
            fill(x_data,y_data,[1,1,1]); % 填充这个方格为白色
            % 设置这个方格可用,即设置barrier中对应方格为0(表示该方格是障碍)
            y1_ceil_temp = n_barrier - y1_ceil + 1;
            barrier(y1_ceil_temp,x1_ceil) = 0;
        end
    %     % 如果是鼠标右键,则输出并保存当前设置的障碍物信息
    %     if strcmp(get(hobj,'selectiontype'),'alt')
    %         disp(barrier)
    %     end
    end
     
     
    % --- Executes on button press in pushbutton13.
    function pushbutton13_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global barrier pushbutton1_userdata
    % disp(barrier);
    cd('barrier')
    delete barrier_tmp.xls
    xlswrite('barrier_tmp.xls',barrier)
    pushbutton1_userdata = 0;
    cd ..
     
     
    % --- Executes on button press in pushbutton14.
    function pushbutton14_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.edit38,'string','请选择一种算法分析,默认选择ACO,并请继续实验设置');
    init_reason1(handles);
    reason = 1;% 实验目标模式,用在后面判断表格和图形的设计,以及采用何种算法设置框
     
     
    function edit36_Callback(hObject, eventdata, handles)
    % hObject    handle to edit36 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit36 as text
    %        str2double(get(hObject,'String')) returns contents of edit36 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit36_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit36 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton15.
    function pushbutton15_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton15 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.edit38,'string','请选择几类算法分析,默认选择全部算法进行比较');
    init_reason2(handles);
    reason = 2; % 实验目标模式,用在后面判断画图
     
    function edit37_Callback(hObject, eventdata, handles)
    % hObject    handle to edit37 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit37 as text
    %        str2double(get(hObject,'String')) returns contents of edit37 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit37_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit37 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton16.
    function pushbutton16_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','on')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','off')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
     
    % --- Executes on button press in pushbutton17.
    function pushbutton17_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton17 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','on')
    set(handles.uipanel7,'visible','off')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
    % --- Executes on button press in pushbutton18.
    function pushbutton18_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','off')
    if reason == 1
        set(handles.uipanel5,'visible','off')
        set(handles.uipanel15,'visible','on')
    end
    if reason == 2
        set(handles.uipanel5,'visible','on')
        set(handles.uipanel15,'visible','off')
    end
     
    % --- Executes on button press in pushbutton19.
    function pushbutton19_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton19 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','on')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
    % --- Executes during object creation, after setting all properties.
    function uipanel5_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to uipanel5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
    % --- Executes during object deletion, before destroying properties.
    function text25_DeleteFcn(hObject, eventdata, handles)
    % hObject    handle to text25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes during object creation, after setting all properties.
    function text25_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to text25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
    % --- Executes during object creation, after setting all properties.
    function pushbutton14_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to pushbutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
     
    function edit38_Callback(hObject, eventdata, handles)
    % hObject    handle to edit38 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit38 as text
    %        str2double(get(hObject,'String')) returns contents of edit38 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit38_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit38 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
     
    % --- Executes during object creation, after setting all properties.
    function slider1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to slider1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: slider controls usually have a light gray background.
    if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor',[.9 .9 .9]);
    end
     
     
     
    function edit39_Callback(hObject, eventdata, handles)
    % hObject    handle to edit39 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit39 as text
    %        str2double(get(hObject,'String')) returns contents of edit39 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit39_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit39 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit201_Callback(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit201 as text
    %        str2double(get(hObject,'String')) returns contents of edit201 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit201_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit202_Callback(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit202 as text
    %        str2double(get(hObject,'String')) returns contents of edit202 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit202_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit84_Callback(hObject, eventdata, handles)
    % hObject    handle to edit84 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit84 as text
    %        str2double(get(hObject,'String')) returns contents of edit84 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit84_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit84 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit203_Callback(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit203 as text
    %        str2double(get(hObject,'String')) returns contents of edit203 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit203_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit111_Callback(hObject, eventdata, handles)
    % hObject    handle to edit111 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit111 as text
    %        str2double(get(hObject,'String')) returns contents of edit111 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit111_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit111 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit112_Callback(hObject, eventdata, handles)
    % hObject    handle to edit112 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit112 as text
    %        str2double(get(hObject,'String')) returns contents of edit112 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit112_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit112 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit114_Callback(hObject, eventdata, handles)
    % hObject    handle to edit114 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit114 as text
    %        str2double(get(hObject,'String')) returns contents of edit114 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit114_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit114 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit113_Callback(hObject, eventdata, handles)
    % hObject    handle to edit113 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit113 as text
    %        str2double(get(hObject,'String')) returns contents of edit113 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit113_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit113 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit115_Callback(hObject, eventdata, handles)
    % hObject    handle to edit115 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit115 as text
    %        str2double(get(hObject,'String')) returns contents of edit115 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit115_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit115 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit204_Callback(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit204 as text
    %        str2double(get(hObject,'String')) returns contents of edit204 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit204_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit103_Callback(hObject, eventdata, handles)
    % hObject    handle to edit103 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit103 as text
    %        str2double(get(hObject,'String')) returns contents of edit103 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit103_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit103 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton16.
    function radiobutton16_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton16
    set(handles.uipanel200,'visible','on')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton15.
    function radiobutton15_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton15 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton15
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','on')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton14.
    function radiobutton14_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton14
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','on')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton17.
    function radiobutton17_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton17 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton17
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','on')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton18.
    function radiobutton18_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton18
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','on')
     
     
     
    function edit51_Callback(hObject, eventdata, handles)
    % hObject    handle to edit51 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit51 as text
    %        str2double(get(hObject,'String')) returns contents of edit51 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit51_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit51 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit85_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit85 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit83_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit83 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit82_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit82 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit81_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit81 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
    % --- Executes on button press in pushbutton20.
    function pushbutton20_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton20 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global path_node diversity_line convergence_curve_global convergence_curve_iter
    display_exercise = str2double( get(handles.edit39,'string') );
    exercise_num = str2double( get(handles.edit18,'string') );
    if display_exercise>exercise_num
    %     disp()
        set(handles.edit38,'string','您设置的显示次数已超过最大值');
    else
        set(handles.edit38,'string','马上显示');
    end
    routes = path_node{1,display_exercise};
    diversity = diversity_line{display_exercise,1};
    convergence_global = convergence_curve_global{display_exercise,1};
    convergence_iter = convergence_curve_iter{display_exercise,1};
    [marker_algorithm] = marker_algorithm_function(hObject, eventdata, handles);
    figure_path(routes,marker_algorithm,hObject, eventdata, handles);
    figure_diversity_line(diversity,handles);
    figure_convergence (convergence_global,convergence_iter,handles)
    set(handles.radiobutton310,'value',1);
     
    % --- Executes when selected object is changed in uipanel18.
    function uipanel18_SelectionChangeFcn(hObject, eventdata, handles)
    % hObject    handle to the selected object in uipanel18 
    % eventdata  structure with the following fields (see UIBUTTONGROUP)
    %	EventName: string 'SelectionChanged' (read only)
    %	OldValue: handle of the previously selected object or empty if none was selected
    %	NewValue: handle of the currently selected object
    % handles    structure with handles and user data (see GUIDATA)
    global convergence_curve_global convergence_curve_iter
    times_displace = str2double( get(handles.edit39,'string') );
    convergence_global = convergence_curve_global{times_displace,1};
    convergence_iter = convergence_curve_iter{times_displace,1};
    switch get(handles.uipanel18,'SelectedObject')
        case handles.radiobutton11
            figure_convergence_iter (convergence_iter,handles)
        case handles.radiobutton12
            figure_convergence_global (convergence_global,handles)
        case handles.radiobutton310
            figure_convergence (convergence_global,convergence_iter,handles)
    end
     
     
     
    function edit52_Callback(hObject, eventdata, handles)
    % hObject    handle to edit52 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit52 as text
    %        str2double(get(hObject,'String')) returns contents of edit52 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit52_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit52 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton21.
    function radiobutton21_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton21 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton21
     
     
     
    function edit53_Callback(hObject, eventdata, handles)
    % hObject    handle to edit53 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit53 as text
    %        str2double(get(hObject,'String')) returns contents of edit53 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit53_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit53 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton22.
    function radiobutton22_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton22 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton22
     
     
     
    function edit54_Callback(hObject, eventdata, handles)
    % hObject    handle to edit54 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit54 as text
    %        str2double(get(hObject,'String')) returns contents of edit54 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit54_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit54 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton23.
    function radiobutton23_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton23 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton23
     
     
     
    function edit55_Callback(hObject, eventdata, handles)
    % hObject    handle to edit55 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit55 as text
    %        str2double(get(hObject,'String')) returns contents of edit55 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit55_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit55 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton24.
    function radiobutton24_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton24
     
     
     
    function edit56_Callback(hObject, eventdata, handles)
    % hObject    handle to edit56 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit56 as text
    %        str2double(get(hObject,'String')) returns contents of edit56 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit56_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit56 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton25.
    function radiobutton25_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton25
     
     
    % --- Executes on button press in pushbutton22.
    function pushbutton22_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton22 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit57_Callback(hObject, eventdata, handles)
    % hObject    handle to edit57 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit57 as text
    %        str2double(get(hObject,'String')) returns contents of edit57 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit57_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit57 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton26.
    function radiobutton26_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton26
     
     
     
    function edit58_Callback(hObject, eventdata, handles)
    % hObject    handle to edit58 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit58 as text
    %        str2double(get(hObject,'String')) returns contents of edit58 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit58_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit58 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton27.
    function radiobutton27_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton27
     
     
     
    function edit59_Callback(hObject, eventdata, handles)
    % hObject    handle to edit59 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit59 as text
    %        str2double(get(hObject,'String')) returns contents of edit59 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit59_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit59 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton28.
    function radiobutton28_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton28
     
     
     
    function edit60_Callback(hObject, eventdata, handles)
    % hObject    handle to edit60 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit60 as text
    %        str2double(get(hObject,'String')) returns contents of edit60 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit60_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit60 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton29.
    function radiobutton29_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton29 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton29
     
     
     
    function edit61_Callback(hObject, eventdata, handles)
    % hObject    handle to edit61 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit61 as text
    %        str2double(get(hObject,'String')) returns contents of edit61 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit61_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit61 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton30.
    function radiobutton30_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton30 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton30
     
     
    % --- Executes on button press in pushbutton23.
    function pushbutton23_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton23 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 判断需要进行哪几种算法
    axes(handles.axes2)
    cla reset
    set(handles.axes2,'visible','off')
    reason2_ACO = get(handles.radiobutton5,'value'); % ACS
    if reason2_ACO==0
        set(handles.edit57,'string',0)
    end
    reason2_AS = get(handles.radiobutton2,'value');  % AS
    if reason2_AS==0
        set(handles.edit58,'string',0)
    end
    reason2_ACS = get(handles.radiobutton1,'value'); % ACO
    if reason2_ACS==0
        set(handles.edit59,'string',0)
    end
    reason2_RAS = get(handles.radiobutton6,'value'); % RAS
    if reason2_RAS==0
        set(handles.edit60,'string',0)
    end
    reason2_EAS = get(handles.radiobutton7,'value'); % EAS
    if reason2_EAS==0
        set(handles.edit61,'string',0)
    end
    figure_multi_algorithm(hObject, eventdata, handles)
     
    % --- Executes on button press in pushbutton24.
    function pushbutton24_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    init_all(handles);
     
     
    % --- Executes on button press in pushbutton27.
    function pushbutton27_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % [f,p]=uiputfile({'*.jpg'},'保存文件');
    % str=strcat(p,f);
    % axes(handles.axes1);
    % pix=getframe(handles.axes1);
    % save file1 pix
    % saveas(pix,'路径规划图','emf')
    % imwrite(pix.cdata,'路径规划图','jpg')
    % set(gcf,'CurrentAxes',handles.axes1);
    % pix=getimage(gcf);
    % imwrite(pix,'路径规划图')
    wait_me = waitbar(0,'正在保存');
    for i=1:100
        pause(0.0001);
        waitbar(i/110,wait_me);
    end
    name = '路径规划图';
    if exist(name)==0
        mkdir(name);
    end
    cd('路径规划图')
    new_f_handle=figure('visible','off');
    new_axes=copyobj(handles.axes1,new_f_handle);
    pix=getframe(gcf);
    set(new_axes,'units','default','position','default');
    myfile_time = datestr(now,30);
    saveas(gca,['路径规划图',char(myfile_time)],'fig')
    saveas(gca,['路径规划图',char(myfile_time)],'emf')
    close(gcf)
    cd ..
    waitbar(0.99,wait_me);
    delete(wait_me);
    % delete(new_axes)
    % imwrite(pix.cdata,'路径规划图','fig')
    % [filename,pathname fileindex]=uiputfile({'*.jpg';'*.bmp'},'save picture as');
     
    % --- Executes on button press in pushbutton28.
    function pushbutton28_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.edit38,'string','正在保存,请稍后');
    wait_me = waitbar(0,'正在保存');
    for i=1:100
        pause(0.0001);
        waitbar(i/110,wait_me);
    end
    global legend_end
    name = '迭代曲线图';
    if exist(name)==0
        mkdir(name);
    end
    cd('迭代曲线图')
    new_f_handle = figure('visible','off');
    set(gcf, 'PaperPositionMode', 'auto'); 
    new_axes = copyobj(handles.axes3,new_f_handle);
    legend(legend_end);
    pix = getframe(gcf);
    set(new_axes,'units','default','position','default');
    myfile_time = datestr(now,30);
    saveas(gca,['迭代曲线图',char(myfile_time)],'fig')
    saveas(gca,['迭代曲线图',char(myfile_time)],'emf')
    close(gcf)
    cd ..
    set(handles.edit38,'string','保存成功');
    waitbar(0.99,wait_me);
    delete(wait_me);
     
    % --- Executes on button press in pushbutton29.
    function pushbutton29_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton29 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.edit38,'string','正在保存,请稍后');
    wait_me = waitbar(0,'正在保存');
    for i=1:100
        pause(0.001);
        waitbar(i/110,wait_me);
    end
    global reason
    if reason==1
        name = '同一算法的统计结果';
        if exist(name)==0
            mkdir(name);
        end
        cd('同一算法的统计结果')
        handles_tmp = handles.uitable1;
        data = get(handles_tmp,'data');
        column_name = get(handles_tmp,'columnname');
        row_name = get(handles_tmp,'rowname');
        myfile_time = datestr(now,30);
        filename = ['同一算法的统计结果',char(myfile_time)];
        xlswrite(filename,column_name','sheet1','B1:D1');
        xlswrite(filename,row_name,'sheet1','A2');
        xlswrite(filename,data,'sheet1','B2');
        cd ..
    end
    if reason==2
        name = '不同算法的比较';
        if exist(name)==0
            mkdir(name);
        end
        cd('不同算法的比较')
        handles_tmp = handles.uitable2;
        data = get(handles_tmp,'data');
        column_name = get(handles_tmp,'columnname');
        row_name = get(handles_tmp,'rowname');
        myfile_time = datestr(now,30);
        filename = ['不同算法的统计结果',char(myfile_time)];
        xlswrite(filename,column_name','sheet1','B1:F1');
        xlswrite(filename,row_name,'sheet1','A2');
        xlswrite(filename,data,'sheet1','B2');
        cd ..
        
        cd('不同算法的比较')
        handles_tmp = handles.uitable3;
        data = get(handles_tmp,'data');
        column_name = get(handles_tmp,'columnname');
        row_name = get(handles_tmp,'rowname');
        myfile_time = datestr(now,30);
        filename = ['不同算法的收敛值',char(myfile_time)];
        xlswrite(filename,column_name','sheet1','B1:F1');
        xlswrite(filename,row_name,'sheet1','A2');
        xlswrite(filename,data,'sheet1','B2');
        cd ..
        
        cd('不同算法的比较')
        handles_tmp = handles.uitable4;
        data = get(handles_tmp,'data');
        column_name = get(handles_tmp,'columnname');
        row_name = get(handles_tmp,'rowname');
        myfile_time = datestr(now,30);
        filename = ['不同算法的收敛次数',char(myfile_time)];
        xlswrite(filename,column_name','sheet1','B1:F1');
        xlswrite(filename,row_name,'sheet1','A2');
        xlswrite(filename,data,'sheet1','B2');
        cd ..
    end
    set(handles.edit38,'string','保存成功');
    waitbar(0.99,wait_me);
    delete(wait_me);
     
    % --- Executes on button press in pushbutton30.
    function pushbutton30_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton30 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.edit38,'string','正在保存,请稍后');
    wait_me = waitbar(0,'正在保存');
    for i=1:100
        pause(0.0001);
        waitbar(i/110,wait_me);
    end
    name = '多样性曲线图';
    if exist(name)==0
        mkdir(name);
    end
    cd('多样性曲线图')
    new_f_handle=figure('visible','off');
    new_axes=copyobj(handles.axes2,new_f_handle);
    pix=getframe(gcf);
    set(new_axes,'units','default','position','default');
    myfile_time = datestr(now,30);
    saveas(gca,['多样性曲线图',char(myfile_time)],'fig')
    saveas(gca,['多样性曲线图',char(myfile_time)],'emf')
    close(gcf)
    cd ..
    set(handles.edit38,'string','保存成功');
    waitbar(0.99,wait_me);
    delete(wait_me);
     
     
    % --- Executes on button press in pushbutton31.
    function pushbutton31_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton31 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global permission_goal permission_start
    permission_goal = 0;
    permission_start = 0;
    

    三、运行结果

    在这里插入图片描述

    四、备注

    版本:2014a

    展开全文
  • 路径规划是实现移动机器人自主导航的关键技术,是指在有障碍物的环境中,按照一定的评价标准(如距离、时间、能耗等),寻找到一条从起始点到目标点的无碰撞路径,这里选取最短距离路径规划的评价标准,即最短路径...

    一、简介

    路径规划是实现移动机器人自主导航的关键技术,是指在有障碍物的环境中,按照一定的评价标准(如距离、时间、能耗等),寻找到一条从起始点到目标点的无碰撞路径,这里选取最短距离路径规划的评价标准,即最短路径规划问题。

    1.路径规划数学模型的建立
    将移动机器人周围环境用一组数据进行抽象表达,建立二维或三维的环境模型,得到移动机器人能够理解分析的环境数据,是机器人路径规划的基本前提。我这里用的是栅格法,其原理是将周围环境看成一个二维平面,将平面分成一个个等面积大小的具有二值信息的栅格,每个栅格中存储着周围环境信息量,下图我给出了一个栅格法地图,方便大家更好的理解栅格地图。这里设计的栅格地图为一个20×20的地形矩阵,黑色的地方表示有障碍,白色的地方表示没有障碍。
    在这里插入图片描述
    图1 栅格法地图
    在用栅格法建立环境模型时,为了将环境信息转换成移动机器人可以识别的数据,一般采用序号法标记环境地图信息,即将栅格地图中一个个栅格从序号1依次累加直到标记到最后一个栅格。如图2所示。
    在这里插入图片描述
    在这里插入图片描述
    图3 八叉树搜索策略
    那么,怎么判断一个栅格点是否为另一个栅格点的相邻栅格点呢,另外,又怎么判断是否为有障碍栅格呢。这就需建立矩阵D,记录每个栅格点至其相邻栅格点的代价值。本例中栅格地图有20×20个栅格点,则D的大小为400×400,其中列是起点栅格,行是局部终点栅格,各栅格点至其各相邻无障碍栅格点的代价值非零,而有障碍栅格及非相邻栅格设为0。
    这里需要说明的是,我的MATLAB程序来自于:
    版权声明:本文为CSDN博主「qq_40443076」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
    原文链接:https://blog.csdn.net/qq_40443076/article/details/88179836
    这里主要介绍基于蚁群算法的机器人最短路径规划的思路,以及我在运行MALTLAB程序的时候,学到的内容。

    2.机器人最短路径规划的实现步骤
    蚁周模型实现机器人最短路径规划的流程图

    为了方便大家更好地理解蚁群算法的原理及实现过程,其流程图如图4所示。(流程图较长,我截图了两段。)
    在这里插入图片描述
    在这里插入图片描述
    图4 基于蚁群算法的机器人最小路径规划流程图
    图中公式(3)(4)的具体表达在下边的具体步骤里。

    蚁周模型实现机器人最短路径规划的具体步骤

    **步骤1:**给出栅格地图的地形矩阵;初始化信息素矩阵 Tau(记录每个栅格至其他栅格的信息素量),最大迭代次数K,蚂蚁个数M,表征信息素重要程度的参数 、表征启发式信息重要程度的参数 ,信息素蒸发系数 ,信息素增加强度系数Q及启发式信息矩阵
    **步骤2:**构建启发式信息矩阵。按式(1)和式(2)计算每个栅格至目标点的距离,启发式信息素取为至目标点距离的倒数,距离越短,启发式因子越大,障碍物处的启发式信息为0。建立矩阵D,用以存储每个栅格点至各自相邻无障碍栅格点的代价值。
    **步骤3:**对于每一只蚂蚁,初始化蚂蚁爬行的路径及路径长度,将禁忌列表全部初始化为1;蚂蚁从起始点出发开始搜索路径,找出当前栅格点的所有无障碍相邻栅格点(即矩阵D中相应元素不为0的栅格点),再根据禁忌列表筛选出当前可选择的栅格点。
    **步骤4:**如果起始点是目标点,且可选栅格点个数大于等于1,则根据式(3)计算蚂蚁从当前栅格点转移到各相邻栅格点的概率,
    在这里插入图片描述

    二、源代码

    function varargout = main_GUI_xu(varargin)
    % MAIN_GUI_XU MATLAB code for main_GUI_xu.fig
    %      MAIN_GUI_XU, by itself, creates a new MAIN_GUI_XU or raises the existing
    %      singleton*.
    %
    %      H = MAIN_GUI_XU returns the handle to a new MAIN_GUI_XU or the handle to
    %      the existing singleton*.
    %
    %      MAIN_GUI_XU('CALLBACK',hObject,eventData,handles,...) calls the local
    %      function named CALLBACK in MAIN_GUI_XU.M with the given input arguments.
    %
    %      MAIN_GUI_XU('Property','Value',...) creates a new MAIN_GUI_XU or raises the
    %      existing singleton*.  Starting from the left, property value pairs are
    %      applied to the GUI before main_GUI_xu_OpeningFcn gets called.  An
    %      unrecognized property name or invalid value makes property application
    %      stop.  All inputs are passed to main_GUI_xu_OpeningFcn via varargin.
    %
    %      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
    %      instance to run (singleton)".
    %
    % See also: GUIDE, GUIDATA, GUIHANDLES
     
    % Edit the above text to modify the response to help main_GUI_xu
     
    % Last Modified by GUIDE v2.5 22-Mar-2017 15:58:57
     
    % Begin initialization code - DO NOT EDIT
    gui_Singleton = 1;
    gui_State = struct('gui_Name',       mfilename, ...
                       'gui_Singleton',  gui_Singleton, ...
                       'gui_OpeningFcn', @main_GUI_xu_OpeningFcn, ...
                       'gui_OutputFcn',  @main_GUI_xu_OutputFcn, ...
                       'gui_LayoutFcn',  [] , ...
                       'gui_Callback',   []);
    if nargin && ischar(varargin{1})
        gui_State.gui_Callback = str2func(varargin{1});
    end
     
    if nargout
        [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
    else
        gui_mainfcn(gui_State, varargin{:});
    end
    % End initialization code - DO NOT EDIT
     
     
    % --- Executes just before main_GUI_xu is made visible.
    function main_GUI_xu_OpeningFcn(hObject, eventdata, handles, varargin)
    % This function has no output args, see OutputFcn.
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % varargin   command line arguments to main_GUI_xu (see VARARGIN)
    % Choose default command line output for main_GUI_xu
    handles.output = hObject;
     
    % Update handles structure
    guidata(hObject, handles);
     
    % UIWAIT makes main_GUI_xu wait for user response (see UIRESUME)
    % uiwait(handles.figure1);
    init_all(handles)
    set(handles.edit38,'string','先选择实验目的,默认选择目的一,即运行一种算法');
     
    % --- Outputs from this function are returned to the command line.
    function varargout = main_GUI_xu_OutputFcn(hObject, eventdata, handles) 
    % varargout  cell array for returning output args (see VARARGOUT);
    % hObject    handle to figure
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Get default command line output from handles structure
    varargout{1} = handles.output;
     
     
    % --- Executes on selection change in listbox1.
    function listbox1_Callback(hObject, eventdata, handles)
    % hObject    handle to listbox1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: contents = cellstr(get(hObject,'String')) returns listbox1 contents as cell array
    %        contents{get(hObject,'Value')} returns selected item from listbox1
     
     
    % --- Executes during object creation, after setting all properties.
    function listbox1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to listbox1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: listbox controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton1.
    function pushbutton1_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % 绘制栅格线和调用figure的屏幕回调函数
    global barrier pushbutton1_userdata
    pushbutton1_userdata = 1; % 控制设计障碍物按钮是否能够使用
    set(handles.edit38,'string','障碍物设计完成后,请点击输出障碍物按钮,否则容易出错');
    axes(handles.axes1)
    cla reset
    n_barrier = str2double(get(handles.edit1,'string'));
    barrier = zeros(n_barrier,n_barrier);
    axes(handles.axes1);
    s.hf = get(handles.axes1,'parent');
    % 绘制栅格边线
    for i=0:1:n_barrier
        plot([0,n_barrier],[i,i],'color','k');
        hold on
        axis([0,n_barrier,0,n_barrier])
        for j=0:1:n_barrier
            plot([i,i],[0,n_barrier],'color','k') ;
            hold on
            axis([0,n_barrier,0,n_barrier])
        end
    end
    % 设置figure的WindowButtonDownFcn属性
    set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn)
     
     
    % --- Executes on selection change in popupmenu1.
    function popupmenu1_Callback(hObject, eventdata, handles)
    % hObject    handle to popupmenu1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: contents = cellstr(get(hObject,'String')) returns popupmenu1 contents as cell array
    %        contents{get(hObject,'Value')} returns selected item from popupmenu1
    global barrier_select start_select goal_select pushbutton1_userdata barrier start goal
    barrier_value = get(handles.popupmenu1,'value');
    cd('barrier')
    if barrier_value==2
        barrier_select = xlsread('e_barrier');
        start_select = 20;
        goal_select = 295;
        pushbutton1_userdata = 0;
    elseif barrier_value==3
        barrier_select = xlsread('simple_e');
        start_select = 20;
        goal_select = 295;
        pushbutton1_userdata = 0;
    elseif barrier_value==4
        barrier_select = xlsread('u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==5
        barrier_select = xlsread('light_u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==6
        barrier_select = xlsread('right_u_barrier');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==7
        barrier_select = xlsread('z_barrier');
        start_select = 49;
        goal_select = 369;
        pushbutton1_userdata = 0;
    elseif barrier_value==8
        barrier_select = xlsread('complex_z');
        start_select = 47;
        goal_select = 367;
        pushbutton1_userdata = 0;
    elseif barrier_value==9
        barrier_select = xlsread('complex_1');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==10
        barrier_select = xlsread('complex_2');
        start_select = 1;
        goal_select = 400;
        pushbutton1_userdata = 0;
    elseif barrier_value==11
        barrier_select = xlsread('complex_30');
        start_select = 1;
        goal_select = 890;
        pushbutton1_userdata = 0;
    elseif barrier_value==12
        barrier_select = xlsread('complex_50_1');
        start_select = 1;
        goal_select = 2500;
    elseif barrier_value==13
        barrier_select = xlsread('complex_50_2');
        start_select = 1;
        goal_select = 2500;
        pushbutton1_userdata = 0;
    elseif barrier_value==14
        barrier_select = xlsread('complex_50_3');
        start_select = 1;
        goal_select = 2500;
        pushbutton1_userdata = 0;
    elseif barrier_value==15
        barrier_select = xlsread('barrier_tmp');
        set(handles.edit18,'string','请选择起点和终点')
        pushbutton1_userdata = 0;
        start = 0;
        goal = 0;
    end
    cd ..
    X = size(barrier_select,1);
    Y = size(barrier_select,2);
    axes(handles.axes1);
    barrier = barrier_select;
    figure_barrier(barrier,handles);
    start = start_select;
    goal = goal_select;
     
    set(handles.edit2,'string',num2str(start) );
    set(handles.edit3,'string',num2str(goal) );
    % 画起点
        x_goal_new = ( mod(start-1,X) +1-0.5);
        y_goal_new = ( Y- ceil(start/Y) +1-0.5);
        x_start_floor = floor(x_goal_new);
        x_start_ceil = ceil(x_goal_new);
        y_start_floor = floor(y_goal_new);
        y_start_ceil = ceil(y_goal_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[0,1,0]);
    % 画终点
    x_goal_new = ( mod(goal-1,X) +1-0.5);
    y_goal_new = ( Y- ceil(goal/Y) +1-0.5);
    x_start_floor = floor(x_goal_new);
    x_start_ceil = ceil(x_goal_new);
    y_start_floor = floor(y_goal_new);
    y_start_ceil = ceil(y_goal_new);
    x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
    y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
    fill(x_data,y_data,[1,0,0]);
    % 设置通用参数
    num_ant = 2*X;
    set(handles.edit9,'string',num_ant);
    set(handles.edit10,'string',250);
    set(handles.edit18,'string',10)
    set(handles.axes2,'visible','on')
     
     
    % --- Executes during object creation, after setting all properties.
    function popupmenu1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to popupmenu1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: popupmenu controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton1.
    function radiobutton1_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton1
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','on')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton2.
    function radiobutton2_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton2
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','on')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton3.
    function radiobutton3_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton3
     
     
     
    function edit1_Callback(hObject, eventdata, handles)
    % hObject    handle to edit1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit1 as text
    %        str2double(get(hObject,'String')) returns contents of edit1 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit2_Callback(hObject, eventdata, handles)
    % hObject    handle to edit2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit2 as text
    %        str2double(get(hObject,'String')) returns contents of edit2 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit2_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit3_Callback(hObject, eventdata, handles)
    % hObject    handle to edit3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit3 as text
    %        str2double(get(hObject,'String')) returns contents of edit3 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit3_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton2.
    function pushbutton2_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton2 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 鼠标取起点
    global permission_start
    permission_start = 1;
    set(handles.edit2,'string',[]);
    set(handles.edit3,'string',[]);
    axes(handles.axes1);
    if permission_start==1
        set(handles.edit38,'string','选择起点结束后请点击结束按钮,否则易出错');
        s.hf = get(handles.axes1,'parent');
        set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn_point_start);
    end
    global start
    figure_start(start)
     
      
    function figure1_windowbuttondownfcn_point_start(hobj,event)
    global barrier
    X = size(barrier,1);
    Y = size(barrier,2);
    global permission_start
    if permission_start==1
        if strcmp(get(hobj,'SelectionType'),'normal')
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标;
                x_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y_ceil = ceil(y(1));
                point_start = [x_ceil,y_ceil];
                start_tmp =  point_start(1) + ( Y-point_start(2) )*X;
                figure_start(start_tmp);
        end
    end
     
     
    % 画出起点函数
    function figure_start(start_new)
    global barrier start 
    if start_new~=start
        X = size(barrier,1);
        Y = size(barrier,2);
        % 清除以前的点的消息
        x_start = ( mod(start-1,X) +1-0.5);
        y_start = ( Y- ceil(start/Y) +1-0.5);
        x_start_floor = floor(x_start);
        x_start_ceil = ceil(x_start);
        y_start_floor = floor(y_start);
        y_start_ceil = ceil(y_start);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,1,1]);
        %% 画新的点
        x_start_new = ( mod(start_new-1,X) +1-0.5);
        y_start_new = ( Y- ceil(start_new/Y) +1-0.5);
        x_start_floor = floor(x_start_new);
        x_start_ceil = ceil(x_start_new);
        y_start_floor = floor(y_start_new);
        y_start_ceil = ceil(y_start_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[0,1,0]);
        start = start_new;
        data = '起点是%4.0f\n';
        fprintf(data,start)
    %     set(handles.edit2,'string',start)
    end
     
    % function test(hObject, eventdata, handles)
    % global start start_new
    % if start~=start_new
    %     set(hanles.edit2,'value',start_new)
    % end
     
    % 画终点的函数
    function figure_goal(goal_new)
    global barrier goal
    if goal_new~=goal
        X = size(barrier,1);
        Y = size(barrier,2);
        % 清除以前的点的消息
        x_goal = ( mod(goal-1,X) +1-0.5);
        y_goal = ( Y- ceil(goal/Y) +1-0.5);
        x_start_floor = floor(x_goal);
        x_start_ceil = ceil(x_goal);
        y_start_floor = floor(y_goal);
        y_start_ceil = ceil(y_goal);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,1,1]);
        %% 画新的点
        x_goal_new = ( mod(goal_new-1,X) +1-0.5);
        y_goal_new = ( Y- ceil(goal_new/Y) +1-0.5);
        x_start_floor = floor(x_goal_new);
        x_start_ceil = ceil(x_goal_new);
        y_start_floor = floor(y_goal_new);
        y_start_ceil = ceil(y_goal_new);
        x_data = [x_start_floor,x_start_ceil,x_start_ceil,x_start_floor];
        y_data = [y_start_floor,y_start_floor,y_start_ceil,y_start_ceil];
        fill(x_data,y_data,[1,0,0]);
        goal = goal_new;
    end
     
     
    % --- Executes on button press in pushbutton3.
    function pushbutton3_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton3 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 画终点
    global permission_goal
    permission_goal = 1;
    set(handles.edit2,'string',[])
    set(handles.edit3,'string',[])
    axes(handles.axes1);
    if permission_goal==1
        set(handles.edit38,'string','选择起点结束后请点击结束按钮,否则易出错');
        s.hf = get(handles.axes1,'parent');
        set(s.hf,'WindowButtonDownFcn',@figure1_windowbuttondownfcn_point_goal);
    end
    global goal
    figure_goal(goal);
     
     
    function figure1_windowbuttondownfcn_point_goal(hobj,event)
    global barrier
    X = size(barrier,1);
    Y = size(barrier,2);
    global permission_goal
    if permission_goal==1
        if strcmp(get(hobj,'SelectionType'),'normal')
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标;
                x_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y_ceil = ceil(y(1));
                point_goal = [x_ceil,y_ceil];
                goal =  point_goal(1) + ( Y-point_goal(2) )*X;
                figure_goal(goal);
                data = '终点是%4.0f\n';
                fprintf(data,goal)
        end
    end
     
     
    function edit5_Callback(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit201 as text
    %        str2double(get(hObject,'String')) returns contents of edit201 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit5_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit6_Callback(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit202 as text
    %        str2double(get(hObject,'String')) returns contents of edit202 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit6_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit7_Callback(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit203 as text
    %        str2double(get(hObject,'String')) returns contents of edit203 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit7_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit8_Callback(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit204 as text
    %        str2double(get(hObject,'String')) returns contents of edit204 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit8_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit9_Callback(hObject, eventdata, handles)
    % hObject    handle to edit9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit9 as text
    %        str2double(get(hObject,'String')) returns contents of edit9 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit9_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit10_Callback(hObject, eventdata, handles)
    % hObject    handle to edit10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit10 as text
    %        str2double(get(hObject,'String')) returns contents of edit10 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit10_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton4.
    function radiobutton4_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton4 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton4
     
     
    % --- Executes on button press in pushbutton4.
    function pushbutton4_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton4 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason start goal 
    global h_waitbar
    set(handles.edit57,'string',1);set(handles.edit58,'string',1);set(handles.edit59,'string',1);
    set(handles.edit60,'string',1);set(handles.edit61,'string',1);
    set(handles.edit2,'string',start);
    set(handles.edit3,'string',goal);
    set(handles.edit38,'string','正在运行');
    set(handles.text60,'visible','off')
    tic;
    h_waitbar = waitbar(0,'正在运行,请稍后...');
    if reason == 1 % 如果是第一个目的,即选择一种算法进行分析,则选择一种算法运行
        prime_only_one_algorithm(hObject, eventdata, handles)
    elseif reason==2 % 如果是第二个目的,即选择多种算法进行分析
        prime_multi_algorithm(hObject, eventdata, handles)
    end
    delete(h_waitbar);
    time_algorithm = round(toc);
    tip_time = ['运行结束,已运行',num2str(time_algorithm),'秒'];
    set(handles.edit38,'string',tip_time);
     
     
    function edit91_Callback(hObject, eventdata, handles)
    % hObject    handle to edit91 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit91 as text
    %        str2double(get(hObject,'String')) returns contents of edit91 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit91_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit91 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit12_Callback(hObject, eventdata, handles)
    % hObject    handle to edit12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit12 as text
    %        str2double(get(hObject,'String')) returns contents of edit12 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit12_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit13_Callback(hObject, eventdata, handles)
    % hObject    handle to edit13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit13 as text
    %        str2double(get(hObject,'String')) returns contents of edit13 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit13_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit14_Callback(hObject, eventdata, handles)
    % hObject    handle to edit14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit14 as text
    %        str2double(get(hObject,'String')) returns contents of edit14 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit14_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit92_Callback(hObject, eventdata, handles)
    % hObject    handle to edit92 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit92 as text
    %        str2double(get(hObject,'String')) returns contents of edit92 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit92_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit92 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit16_Callback(hObject, eventdata, handles)
    % hObject    handle to edit16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit16 as text
    %        str2double(get(hObject,'String')) returns contents of edit16 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit16_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit94_Callback(hObject, eventdata, handles)
    % hObject    handle to edit94 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit94 as text
    %        str2double(get(hObject,'String')) returns contents of edit94 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit94_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit94 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit18_Callback(hObject, eventdata, handles)
    % hObject    handle to edit18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit18 as text
    %        str2double(get(hObject,'String')) returns contents of edit18 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit18_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton5.
    function radiobutton5_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton5
    set(handles.uipanel200,'visible','on')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton6.
    function radiobutton6_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton6 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton6
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','on')
    set(handles.uipanel204,'visible','off')
     
    % --- Executes on button press in radiobutton7.
    function radiobutton7_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton7 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton7
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','on')
     
    % --- Executes when figure1 is resized.
    function figure1_ResizeFcn(hObject, eventdata, handles)
    % hObject    handle to figure1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit93_Callback(hObject, eventdata, handles)
    % hObject    handle to edit93 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit93 as text
    %        str2double(get(hObject,'String')) returns contents of edit93 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit93_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit93 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit24_Callback(hObject, eventdata, handles)
    % hObject    handle to edit24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit24 as text
    %        str2double(get(hObject,'String')) returns contents of edit24 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit24_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit25_Callback(hObject, eventdata, handles)
    % hObject    handle to edit25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit25 as text
    %        str2double(get(hObject,'String')) returns contents of edit25 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit25_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit26_Callback(hObject, eventdata, handles)
    % hObject    handle to edit26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit26 as text
    %        str2double(get(hObject,'String')) returns contents of edit26 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit26_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit27_Callback(hObject, eventdata, handles)
    % hObject    handle to edit27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit27 as text
    %        str2double(get(hObject,'String')) returns contents of edit27 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit27_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit28_Callback(hObject, eventdata, handles)
    % hObject    handle to edit28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit28 as text
    %        str2double(get(hObject,'String')) returns contents of edit28 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit28_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit101_Callback(hObject, eventdata, handles)
    % hObject    handle to edit101 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit101 as text
    %        str2double(get(hObject,'String')) returns contents of edit101 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit101_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit101 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit102_Callback(hObject, eventdata, handles)
    % hObject    handle to edit102 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit102 as text
    %        str2double(get(hObject,'String')) returns contents of edit102 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit102_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit102 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit104_Callback(hObject, eventdata, handles)
    % hObject    handle to edit104 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit104 as text
    %        str2double(get(hObject,'String')) returns contents of edit104 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit104_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit104 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit105_Callback(hObject, eventdata, handles)
    % hObject    handle to edit105 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit105 as text
    %        str2double(get(hObject,'String')) returns contents of edit105 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit105_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit105 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit106_Callback(hObject, eventdata, handles)
    % hObject    handle to edit106 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit106 as text
    %        str2double(get(hObject,'String')) returns contents of edit106 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit106_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit106 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton5.
    function pushbutton5_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton6.
    function pushbutton6_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton6 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton7.
    function pushbutton7_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton7 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton8.
    function pushbutton8_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton8 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in radiobutton9.
    function radiobutton9_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton9
     
     
    % --- Executes on button press in radiobutton10.
    function radiobutton10_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton10
     
     
    % --- Executes on button press in pushbutton9.
    function pushbutton9_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton9 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton10.
    function pushbutton10_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton10 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes on button press in pushbutton11.
    function pushbutton11_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton11 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit34_Callback(hObject, eventdata, handles)
    % hObject    handle to edit34 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit34 as text
    %        str2double(get(hObject,'String')) returns contents of edit34 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit34_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit34 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit35_Callback(hObject, eventdata, handles)
    % hObject    handle to edit35 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit35 as text
    %        str2double(get(hObject,'String')) returns contents of edit35 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit35_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit35 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton11.
    function radiobutton11_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton11 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton11
     
     
    % --- Executes on button press in radiobutton12.
    function radiobutton12_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton12
     
     
    % --- Executes on button press in pushbutton12.
    function pushbutton12_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton12 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % --------------------------------------------------------------------
    function Untitled_1_Callback(hObject, eventdata, handles)
    % hObject    handle to Untitled_1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    function figure1_windowbuttondownfcn(hobj,event)
    % point_data 输出,输出当前的一个点
    % 定义figure的回调函数
    global draw_enable x y data barrier pushbutton1_userdata
    % if pushbutton1_userdata == 0
    %     set(handles.edit38,'string','如果需要设计障碍物图形,请先点击设计障碍物按钮');
    % disp('如果需要设计障碍物图形,请先点击设计障碍物按钮')
    if pushbutton1_userdata ==1
        n_barrier = size(barrier,1);
        % 若figure的selectiontype属性值为normal,则表示单击鼠标左键
        if strcmp(get(hobj,'SelectionType'),'normal')
            draw_enable = 1;
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标
                x1_floor = floor(x(1));
                x1_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y1_floor = floor(y(1));
                y1_ceil = ceil(y(1));
            data = [x1_floor,y1_floor;...
                    x1_ceil,y1_floor;...
                    x1_ceil,y1_ceil;...
                    x1_floor,y1_ceil]; % 依次取该点的周围四个顶点
            x_data = [x1_floor,x1_ceil,x1_ceil,x1_floor];
            y_data = [y1_floor,y1_floor,y1_ceil,y1_ceil];
            fill(x_data,y_data,[0,0,0]); % 填充这个方格为黑色
            % 设置这个方格不可用,即设置barrier中对应方格为1(表示该方格是障碍)
            y1_ceil_temp = n_barrier - y1_ceil + 1;
            barrier(y1_ceil_temp,x1_ceil) = 1;
        end
        % 如果figure的selectiontype属性值为alt,则表示双击鼠标,使方格为白色,可以安全行走
        if strcmp(get(hobj,'selectiontype'),'open')
            draw_enable = 0;
            p = get(gca,'currentpoint'); % 取鼠标当前所在点的坐标
            x(1) = p(1);% 当前点的横坐标
                x1_floor = floor(x(1));
                x1_ceil = ceil(x(1));
            y(1) = p(3);% 当前点的纵坐标
                y1_floor = floor(y(1));
                y1_ceil = ceil(y(1));
            data = [x1_floor,y1_floor;...
                    x1_ceil,y1_floor;...
                    x1_ceil,y1_ceil;...
                    x1_floor,y1_ceil]; % 依次取该点的周围四个顶点
            x_data = [x1_floor,x1_ceil,x1_ceil,x1_floor];
            y_data = [y1_floor,y1_floor,y1_ceil,y1_ceil];
            fill(x_data,y_data,[1,1,1]); % 填充这个方格为白色
            % 设置这个方格可用,即设置barrier中对应方格为0(表示该方格是障碍)
            y1_ceil_temp = n_barrier - y1_ceil + 1;
            barrier(y1_ceil_temp,x1_ceil) = 0;
        end
    %     % 如果是鼠标右键,则输出并保存当前设置的障碍物信息
    %     if strcmp(get(hobj,'selectiontype'),'alt')
    %         disp(barrier)
    %     end
    end
     
     
    % --- Executes on button press in pushbutton13.
    function pushbutton13_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton13 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global barrier pushbutton1_userdata
    % disp(barrier);
    cd('barrier')
    delete barrier_tmp.xls
    xlswrite('barrier_tmp.xls',barrier)
    pushbutton1_userdata = 0;
    cd ..
     
     
    % --- Executes on button press in pushbutton14.
    function pushbutton14_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.edit38,'string','请选择一种算法分析,默认选择ACO,并请继续实验设置');
    init_reason1(handles);
    reason = 1;% 实验目标模式,用在后面判断表格和图形的设计,以及采用何种算法设置框
     
     
    function edit36_Callback(hObject, eventdata, handles)
    % hObject    handle to edit36 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit36 as text
    %        str2double(get(hObject,'String')) returns contents of edit36 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit36_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit36 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton15.
    function pushbutton15_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton15 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.edit38,'string','请选择几类算法分析,默认选择全部算法进行比较');
    init_reason2(handles);
    reason = 2; % 实验目标模式,用在后面判断画图
     
    function edit37_Callback(hObject, eventdata, handles)
    % hObject    handle to edit37 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit37 as text
    %        str2double(get(hObject,'String')) returns contents of edit37 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit37_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit37 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in pushbutton16.
    function pushbutton16_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','on')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','off')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
     
    % --- Executes on button press in pushbutton17.
    function pushbutton17_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton17 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','on')
    set(handles.uipanel7,'visible','off')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
    % --- Executes on button press in pushbutton18.
    function pushbutton18_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global reason
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','off')
    if reason == 1
        set(handles.uipanel5,'visible','off')
        set(handles.uipanel15,'visible','on')
    end
    if reason == 2
        set(handles.uipanel5,'visible','on')
        set(handles.uipanel15,'visible','off')
    end
     
    % --- Executes on button press in pushbutton19.
    function pushbutton19_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton19 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    set(handles.uipanel1,'visible','off')
    set(handles.uipanel6,'visible','off')
    set(handles.uipanel7,'visible','on')
    set(handles.uipanel5,'visible','off')
    set(handles.uipanel15,'visible','off')
     
    % --- Executes during object creation, after setting all properties.
    function uipanel5_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to uipanel5 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
    % --- Executes during object deletion, before destroying properties.
    function text25_DeleteFcn(hObject, eventdata, handles)
    % hObject    handle to text25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
    % --- Executes during object creation, after setting all properties.
    function text25_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to text25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
    % --- Executes during object creation, after setting all properties.
    function pushbutton14_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to pushbutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
     
     
    function edit38_Callback(hObject, eventdata, handles)
    % hObject    handle to edit38 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit38 as text
    %        str2double(get(hObject,'String')) returns contents of edit38 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit38_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit38 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
     
    % --- Executes during object creation, after setting all properties.
    function slider1_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to slider1 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: slider controls usually have a light gray background.
    if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor',[.9 .9 .9]);
    end
     
     
     
    function edit39_Callback(hObject, eventdata, handles)
    % hObject    handle to edit39 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit39 as text
    %        str2double(get(hObject,'String')) returns contents of edit39 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit39_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit39 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit201_Callback(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit201 as text
    %        str2double(get(hObject,'String')) returns contents of edit201 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit201_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit201 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit202_Callback(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit202 as text
    %        str2double(get(hObject,'String')) returns contents of edit202 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit202_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit202 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit84_Callback(hObject, eventdata, handles)
    % hObject    handle to edit84 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit84 as text
    %        str2double(get(hObject,'String')) returns contents of edit84 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit84_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit84 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit203_Callback(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit203 as text
    %        str2double(get(hObject,'String')) returns contents of edit203 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit203_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit203 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit111_Callback(hObject, eventdata, handles)
    % hObject    handle to edit111 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit111 as text
    %        str2double(get(hObject,'String')) returns contents of edit111 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit111_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit111 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit112_Callback(hObject, eventdata, handles)
    % hObject    handle to edit112 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit112 as text
    %        str2double(get(hObject,'String')) returns contents of edit112 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit112_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit112 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit114_Callback(hObject, eventdata, handles)
    % hObject    handle to edit114 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit114 as text
    %        str2double(get(hObject,'String')) returns contents of edit114 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit114_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit114 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit113_Callback(hObject, eventdata, handles)
    % hObject    handle to edit113 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit113 as text
    %        str2double(get(hObject,'String')) returns contents of edit113 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit113_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit113 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit115_Callback(hObject, eventdata, handles)
    % hObject    handle to edit115 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit115 as text
    %        str2double(get(hObject,'String')) returns contents of edit115 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit115_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit115 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit204_Callback(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit204 as text
    %        str2double(get(hObject,'String')) returns contents of edit204 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit204_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit204 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
     
    function edit103_Callback(hObject, eventdata, handles)
    % hObject    handle to edit103 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit103 as text
    %        str2double(get(hObject,'String')) returns contents of edit103 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit103_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit103 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton16.
    function radiobutton16_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton16 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton16
    set(handles.uipanel200,'visible','on')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton15.
    function radiobutton15_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton15 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton15
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','on')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton14.
    function radiobutton14_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton14 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton14
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','on')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton17.
    function radiobutton17_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton17 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton17
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','on')
    set(handles.uipanel204,'visible','off')
     
     
    % --- Executes on button press in radiobutton18.
    function radiobutton18_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton18 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton18
    set(handles.uipanel200,'visible','off')
    set(handles.uipanel201,'visible','off')
    set(handles.uipanel202,'visible','off')
    set(handles.uipanel203,'visible','off')
    set(handles.uipanel204,'visible','on')
     
     
     
    function edit51_Callback(hObject, eventdata, handles)
    % hObject    handle to edit51 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit51 as text
    %        str2double(get(hObject,'String')) returns contents of edit51 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit51_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit51 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit85_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit85 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit83_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit83 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit82_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit82 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes during object creation, after setting all properties.
    function edit81_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit81 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
    % --- Executes on button press in pushbutton20.
    function pushbutton20_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton20 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    global path_node diversity_line convergence_curve_global convergence_curve_iter
    display_exercise = str2double( get(handles.edit39,'string') );
    exercise_num = str2double( get(handles.edit18,'string') );
    if display_exercise>exercise_num
    %     disp()
        set(handles.edit38,'string','您设置的显示次数已超过最大值');
    else
        set(handles.edit38,'string','马上显示');
    end
    routes = path_node{1,display_exercise};
    diversity = diversity_line{display_exercise,1};
    convergence_global = convergence_curve_global{display_exercise,1};
    convergence_iter = convergence_curve_iter{display_exercise,1};
    [marker_algorithm] = marker_algorithm_function(hObject, eventdata, handles);
    figure_path(routes,marker_algorithm,hObject, eventdata, handles);
    figure_diversity_line(diversity,handles);
    figure_convergence (convergence_global,convergence_iter,handles)
    set(handles.radiobutton310,'value',1);
     
    % --- Executes when selected object is changed in uipanel18.
    function uipanel18_SelectionChangeFcn(hObject, eventdata, handles)
    % hObject    handle to the selected object in uipanel18 
    % eventdata  structure with the following fields (see UIBUTTONGROUP)
    %	EventName: string 'SelectionChanged' (read only)
    %	OldValue: handle of the previously selected object or empty if none was selected
    %	NewValue: handle of the currently selected object
    % handles    structure with handles and user data (see GUIDATA)
    global convergence_curve_global convergence_curve_iter
    times_displace = str2double( get(handles.edit39,'string') );
    convergence_global = convergence_curve_global{times_displace,1};
    convergence_iter = convergence_curve_iter{times_displace,1};
    switch get(handles.uipanel18,'SelectedObject')
        case handles.radiobutton11
            figure_convergence_iter (convergence_iter,handles)
        case handles.radiobutton12
            figure_convergence_global (convergence_global,handles)
        case handles.radiobutton310
            figure_convergence (convergence_global,convergence_iter,handles)
    end
     
     
     
    function edit52_Callback(hObject, eventdata, handles)
    % hObject    handle to edit52 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit52 as text
    %        str2double(get(hObject,'String')) returns contents of edit52 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit52_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit52 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton21.
    function radiobutton21_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton21 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton21
     
     
     
    function edit53_Callback(hObject, eventdata, handles)
    % hObject    handle to edit53 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit53 as text
    %        str2double(get(hObject,'String')) returns contents of edit53 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit53_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit53 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton22.
    function radiobutton22_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton22 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton22
     
     
     
    function edit54_Callback(hObject, eventdata, handles)
    % hObject    handle to edit54 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit54 as text
    %        str2double(get(hObject,'String')) returns contents of edit54 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit54_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit54 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton23.
    function radiobutton23_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton23 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton23
     
     
     
    function edit55_Callback(hObject, eventdata, handles)
    % hObject    handle to edit55 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit55 as text
    %        str2double(get(hObject,'String')) returns contents of edit55 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit55_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit55 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton24.
    function radiobutton24_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton24
     
     
     
    function edit56_Callback(hObject, eventdata, handles)
    % hObject    handle to edit56 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit56 as text
    %        str2double(get(hObject,'String')) returns contents of edit56 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit56_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit56 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton25.
    function radiobutton25_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton25 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton25
     
     
    % --- Executes on button press in pushbutton22.
    function pushbutton22_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton22 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
     
     
    function edit57_Callback(hObject, eventdata, handles)
    % hObject    handle to edit57 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit57 as text
    %        str2double(get(hObject,'String')) returns contents of edit57 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit57_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit57 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton26.
    function radiobutton26_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton26 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton26
     
     
     
    function edit58_Callback(hObject, eventdata, handles)
    % hObject    handle to edit58 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit58 as text
    %        str2double(get(hObject,'String')) returns contents of edit58 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit58_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit58 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton27.
    function radiobutton27_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton27
     
     
     
    function edit59_Callback(hObject, eventdata, handles)
    % hObject    handle to edit59 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit59 as text
    %        str2double(get(hObject,'String')) returns contents of edit59 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit59_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit59 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton28.
    function radiobutton28_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton28 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton28
     
     
     
    function edit60_Callback(hObject, eventdata, handles)
    % hObject    handle to edit60 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit60 as text
    %        str2double(get(hObject,'String')) returns contents of edit60 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit60_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit60 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton29.
    function radiobutton29_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton29 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton29
     
     
     
    function edit61_Callback(hObject, eventdata, handles)
    % hObject    handle to edit61 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hints: get(hObject,'String') returns contents of edit61 as text
    %        str2double(get(hObject,'String')) returns contents of edit61 as a double
     
     
    % --- Executes during object creation, after setting all properties.
    function edit61_CreateFcn(hObject, eventdata, handles)
    % hObject    handle to edit61 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    empty - handles not created until after all CreateFcns called
     
    % Hint: edit controls usually have a white background on Windows.
    %       See ISPC and COMPUTER.
    if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
        set(hObject,'BackgroundColor','white');
    end
     
     
    % --- Executes on button press in radiobutton30.
    function radiobutton30_Callback(hObject, eventdata, handles)
    % hObject    handle to radiobutton30 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
     
    % Hint: get(hObject,'Value') returns toggle state of radiobutton30
     
     
    % --- Executes on button press in pushbutton23.
    function pushbutton23_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton23 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % 判断需要进行哪几种算法
    axes(handles.axes2)
    cla reset
    set(handles.axes2,'visible','off')
    reason2_ACO = get(handles.radiobutton5,'value'); % ACS
    if reason2_ACO==0
        set(handles.edit57,'string',0)
    end
    reason2_AS = get(handles.radiobutton2,'value');  % AS
    if reason2_AS==0
        set(handles.edit58,'string',0)
    end
    reason2_ACS = get(handles.radiobutton1,'value'); % ACO
    if reason2_ACS==0
        set(handles.edit59,'string',0)
    end
    reason2_RAS = get(handles.radiobutton6,'value'); % RAS
    if reason2_RAS==0
        set(handles.edit60,'string',0)
    end
    reason2_EAS = get(handles.radiobutton7,'value'); % EAS
    if reason2_EAS==0
        set(handles.edit61,'string',0)
    end
    figure_multi_algorithm(hObject, eventdata, handles)
     
    % --- Executes on button press in pushbutton24.
    function pushbutton24_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton24 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    init_all(handles);
     
     
    % --- Executes on button press in pushbutton27.
    function pushbutton27_Callback(hObject, eventdata, handles)
    % hObject    handle to pushbutton27 (see GCBO)
    % eventdata  reserved - to be defined in a future version of MATLAB
    % handles    structure with handles and user data (see GUIDATA)
    % [f,p]=uiputfile({'*.jpg'},'保存文件');
    % str=strcat(p,f);
    % axes(handles.axes1);
    % pix=getframe(handles.axes1);
    % save file1 pix
    % saveas(pix,'路径规划图','emf')
    % imwrite(pix.cdata,'路径规划图','jpg')
    % set(gcf,'CurrentAxes',handles.axes1);
    % pix=getimage(gcf);
    % imwrite(pix,'路径规划图')
    wait_me = waitbar(0,'正在保存');
    for i=1:100
        pause(0.0001);
        waitbar(i/110,wait_me);
    end
    name = '路径规划图';
    if exist(name)==0
        mkdir(name);
    end
    cd('路径规划图')
    new_f_handle=figure('visible','off');
    new_axes=copyobj(handles.axes1,new_f_handle);
    pix=getframe(gcf);
    set(new_axes,'units','default','position','default');
    myfile_time = datestr(now,30);
    saveas(gca,['路径规划图',char(myfile_time)],'fig')
    saveas(gca,['路径规划图',char(myfile_time)],'emf')
    close(gcf)
    cd ..
    waitbar(0.99,wait_me);
    delete(wait_me);
    % delete(new_axes)
    % imwrite(pix.cdata,'路径规划图','fig')
    % [filename,pathname fileindex]=uiputfile({'*.jpg';'*.bmp'},'save picture as');
     
    % ---