找回密码
 新注册用户
搜索
楼主: 碧城仙

“蚁群算法”学习包下载

[复制链接]
发表于 2005-10-10 22:41:33 | 显示全部楼层
太长了,太专业了,看不懂。这个和分布式有关系吗?
谁能简单介绍一下?
回复

使用道具 举报

 楼主| 发表于 2005-10-11 11:06:14 | 显示全部楼层
引用 tcogh327 在 2005-10-10 22:41 时的帖子:
太长了,太专业了,看不懂。这个和分布式有关系吗?

和分布式没多大关系吧……主要是讲的一种编程中的自适应智能算法。
回复

使用道具 举报

发表于 2005-10-14 15:20:13 | 显示全部楼层

其实,什么是分布式计算啊!

我不是很了解啊.我曾经在报纸看过啊!
回复

使用道具 举报

 楼主| 发表于 2005-10-14 18:00:29 | 显示全部楼层
引用 zengyuo 在 2005-10-14 15:20 时的帖子:
什么是分布式计算啊!

请浏览本站新手指南(http://www.equn.com/info/)和项目介绍(http://www.equn.com/distributed/)子站。
回复

使用道具 举报

发表于 2005-11-27 15:03:45 | 显示全部楼层
嗯,以前看到过介绍,收藏一下。


看看可以有什么具体的应用。
回复

使用道具 举报

发表于 2005-12-25 18:08:10 | 显示全部楼层
这些文章基本都是国内学者写的,建议大家多参考点国际上知名期刊的蚁群算法文章,国际上的文章更加深入、更加系统!
回复

使用道具 举报

发表于 2006-1-16 16:47:52 | 显示全部楼层
就怕看不懂,最近准备在这方面扫扫盲,DX们可有推荐?(遗传算法,蚁群算法,神经网络)
回复

使用道具 举报

发表于 2006-1-17 19:01:12 | 显示全部楼层
下载中,谢谢
回复

使用道具 举报

发表于 2006-1-17 21:49:45 | 显示全部楼层
我在一个研究神经网络与人工智能的网站也看到大仙的这篇文章。
回复

使用道具 举报

发表于 2011-2-15 18:11:58 | 显示全部楼层
各位大虾 我用电驴 下不来啊 可不可以麻烦下载到的 发到我邮箱771461217@qq.com急用感谢啊
回复

使用道具 举报

 楼主| 发表于 2011-2-18 14:50:41 | 显示全部楼层
回复 25# oxiaomio2010

失效好多年了,当年我是在学校图书馆,上维普和万方上搜索了下载的,然后压了一个包放在电驴上的。
回复

使用道具 举报

发表于 2011-8-13 15:42:30 | 显示全部楼层
现在没了吗?哪里还可以再看啊
回复

使用道具 举报

发表于 2012-5-5 17:32:52 | 显示全部楼层
回复 27# tonyga

http://www.verycd.com/topics/46263/

我上个月刚下载过。。。
回复

使用道具 举报

发表于 2012-5-5 17:48:39 | 显示全部楼层
本帖最后由 refla 于 2012-5-5 17:50 编辑

我写了一个 MMAS 的程序,供大家一起讨论与学习,限于篇幅,这里只给出程序主架构,完成程序我已经打包上传,供大家下载。
  1. struct _tsp  tsp;

  2. void fuck_tsp()
  3. {
  4.   implement_mmas_plan();
  5.   output( FLAG_SO_FAR_BEST );
  6. }

  7. void implement_mmas_plan()  // enterance
  8. {
  9.   initialize();

  10.   int iteration = 0;
  11.   while( ! dose_meet_termination_condition( iteration ) )
  12.   {
  13.     printf( "interation %d ", iteration );

  14.     construct_solutions( iteration );
  15.     local_search();  // optional
  16.     update_statistics();
  17.     update_pheromone_trails();

  18.     output( FLAG_ITERATION_BEST );
  19.     iteration++;
  20.   }// while( ! dose_meet_termination_condition() )
  21. }

  22. void initialize()
  23. {
  24.   set_default_parameters();
  25.   tsp.random_seed = (long) time( NULL );
  26.   tsp.so_far_best_ant.tour_length = NO_ROUTE;

  27.   read_instance();
  28.   compute_primary_info();
  29. }

  30. void set_default_parameters()
  31. {
  32.   tsp.parameter.alpha = 1;  
  33.   tsp.parameter.beta = 2;
  34.   tsp.parameter.rou = 0.02;
  35.   tsp.parameter.quantity = 1.0;

  36.   tsp.parameter.tau_min_factor = 0.2;
  37.   tsp.parameter.tau_max = 1.0;
  38.   tsp.parameter.tau_min = tsp.parameter.tau_max * tsp.parameter.tau_min_factor;
  39. }

  40. void construct_solutions(int iteration)
  41. {
  42.   struct _ant  *ant = tsp.ant;

  43.   int k;
  44.   for( k = 0; k < tsp.parameter.ants; k++ )  // to empty the memory of ants
  45.   {
  46.     memset( ant[ k ].visited, FLAG_UNVISITED, sizeof(int) * (MAX_CITIES + 1) );
  47.     ant[ k ].visited[ tsp.cities ] = iteration;
  48.   }

  49.   for( k = 0; k < tsp.parameter.ants; k++ )  // to place ants
  50.   {
  51.     int start = pickup_start_city();
  52.     ant[ k ].tour[ 0 ] = start;
  53.     ant[ k ].visited[ start ] = FLAG_VISITED;
  54.   }

  55.   int step = 1; // The start city has been determined.
  56.   while( step < tsp.cities )
  57.   {
  58.     for( k = 0; k < tsp.parameter.ants; k++ )
  59.       tour( k, step );

  60.     step++;
  61.   }

  62.   for( k = 0; k < tsp.parameter.ants; k++ )
  63.   {
  64.     ant[ k ].tour[ tsp.cities ] = ant[ k ].tour[ 0 ];
  65.     compute_tour_length( ant + k );
  66.   }
  67. }

  68. int pickup_start_city()
  69. {
  70.   int  result = (int)( Oh_Fortuna() * tsp.cities );
  71.   return  result;
  72. }


  73. void tour(int k, int step)
  74. {
  75.   struct _ant  *ant = tsp.ant;

  76.   int  i = ant[ k ].tour[ step - 1 ];
  77.   double sum_probabilities = 0.0;
  78.   double selection_probability[ MAX_CITIES ];

  79.   int j;
  80.   for( j = 0; j < tsp.cities; j++ )
  81.     if( ant[ k ].visited[ j ] )
  82.       selection_probability[ j ] = 0.0;
  83.     else
  84.     {
  85.       selection_probability[ j ] = tsp.choice_info[ i ][ j ];
  86.       sum_probabilities += selection_probability[ j ];
  87.     }

  88.   double roulette_wheel = Oh_Fortuna() * sum_probabilities;

  89.   j = 0;
  90.   double p = selection_probability[j];
  91.   while( p < roulette_wheel )
  92.   {
  93.     j++;
  94.     p += selection_probability[j];
  95.   }

  96.   ant[k].tour[ step ] = j;
  97.   ant[k].visited[j] = FLAG_VISITED;
  98. }


  99. void update_statistics()
  100. {
  101.   double rou = tsp.parameter.rou;
  102.   double quantity = tsp.parameter.quantity;
  103.   double tau_max = tsp.parameter.tau_max;
  104.   double tau_min = tsp.parameter.tau_min;
  105.   double tau_min_factor = tsp.parameter.tau_min_factor;

  106.   struct _ant *ant = tsp.ant;
  107.   struct _ant *iter_ant = &( tsp.iteration_best_ant );
  108.   struct _ant *sofar_ant = &( tsp.so_far_best_ant );

  109.   int  k = find_iteration_best();
  110.   memcpy( iter_ant, ant+k, sizeof( struct _ant ) );
  111.   if( iter_ant->tour_length < sofar_ant->tour_length )
  112.   {
  113.     memcpy( sofar_ant, ant+k, sizeof( struct _ant ) );
  114.     tau_max = quantity / ( rou * sofar_ant->tour_length );
  115.     tau_min = tau_max * tau_min_factor;
  116.   }
  117. }

  118. void update_pheromone_trails()
  119. {
  120.   mmas_pheromone_update();
  121. }

  122. void mmas_pheromone_update()
  123. {
  124.   evaporate_pheromone();

  125.   struct _ant  *elite_ant = &( tsp.iteration_best_ant );
  126.   if( dose_use_so_far_best_ant() )
  127.     elite_ant = &( tsp.so_far_best_ant );

  128.   deposit_pheromone( elite_ant );  // MMAS allows only one ant to deposit its pheromone.
  129.   limit_pheromone();

  130.   compute_choice_information();
  131. }

  132. void output(int which)
  133. {
  134.   static const  struct _ant  *ant[2] = { &( tsp.so_far_best_ant ), &( tsp.iteration_best_ant ) };
  135.   static const  char *hint[2] =
  136.   {
  137.     "\nAt last, the best tour length is %d.\n",
  138.         "length = %d\n"
  139.   };

  140.   printf( hint[ which ], ant[ which ]->tour_length );
  141.   printf( "route: " );

  142.   int  step;
  143.   for( step = 0;  step <= tsp.cities; step++ )
  144.     printf( "%d ", ant[ which ]->tour[ step ] );

  145.   printf( "\n" );
  146. }
复制代码
回复

使用道具 举报

发表于 2012-5-5 18:15:35 | 显示全部楼层
都是考古学家啊有木有
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 新注册用户

本版积分规则

论坛官方淘宝店开业啦~

Archiver|手机版|小黑屋|中国分布式计算总站 ( 沪ICP备05042587号 )

GMT+8, 2024-4-19 20:49

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表