⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 遗传算法的c源代码
💻
字号:
                             COPYRIGHT NOTICEThis software is copyright by Zbigniew Michalewicz. Permission isgranted to copy and use the software for scientific, noncommercial purposes only. The software is provided "as is", i.e., without anywarranties.                              GENERAL REMARKSThe genetic2 aims at solving the linear transportation problem(minimization of the transportation cost). It is interesting to comparethe results of the system with results from some linear programmingpackage. The system was described in an article "A Genetic Algorithm for the Linear Transportation Problem}, IEEE Transactions on Systems, Man, and Cybernetics, Vol.21, No.2, 1991, pp.445--452.It is also described in my new book "Genetic Algorithms + Data Structures = Evolution Programs" (Springer Verlag, August 1992).The system was build over 3 years ago. It is the first and lastversion (I do not plan to work on the system in the future).It is quite primitive with almost all variables global. However, theease of use is its main advantage.The current version of genetic2 should run without changes on any BSD-UN*Xsystem (preferably on a Sun SPARC machine). Note, however, that the system was NOT designed with portability in mind, i.e., the partability was not the main factor in the design process.                         HOW TO RUN THE GENETIC2 SYSTEMTo run the genetic2 system, there are two simple steps to follow:(1) prepare input file, say, "your_input",(2) type "genetic2 < your_input > your_output" ("your_output" is the name     of the output file provided by you).A simple example follows. The input file of this example is thetransferred file "input" you have now in your directory, the typical output is present in the file "output". INPUT FILE  (and the explanations, line by line. Note that the             explanations are NOT present in the real input file):____________________________________________________# Problem number 1             /* comment line   */nsource 8                      /* number of sources  */ndest   6                      /* number of destinations */sources12   7   6   11   10   4   4   3  /* all source values */dests13  11   9    7    3  14          /* all destinations values */costs  1   3   8  11   4   4           /* the cost matrix for a given  4   0  12   1   1   1              linear transportation problem */  3   3   1   5   7   9  9   4   1   0   0   5  8   9  14  11  11  10 19  12  40   1  39  11 18   2   5   7   9   9  4   6   9   1   0   9optimum 0                       /* if optimum is known, you can place                                   its value here */pop    40                       /* population size */cross   2                       /* number of crossovers per generation */inver   0                       /* inversion is NOT implemented; keep it                                   zero all the time */mutat   8                       /* number of mutations per generation */sprob   0.9                     /* a coefficient for probability distribution */it      200                     /* number of generations */run 250                         /* run id (optional) */seed    1                       /* seed */run 251                         /* for additional runs with different seeds: */seed 9999run 252seed 1313run 253seed 13333run 254seed 33333end__________________________________________________________The output is given in the "output" file; it is self-explanatory.IMPORTANT REMARKS:(1) the maximum sizes of the number of sorces, destinations, and thepopulation size are given in the genet.h file. If you run largerexample, change these maximum values first.(2) keep the total of crossovers and mutations (cross + mutat) atapprox. 25% of the population size for the best results.(3) there is a parameter "licz" in the genet.h file; licz = 2147483647.0. This represents the largest integer number (converted into float) which can be generated by the standard functionrand(). You may have to change this constant in your system.(4) All input data (except sprob) are integers.I hope this information would be sufficient to run the system.Zbigniew Michalewicz******************************************************************************* Mail: Department of Computer Science      E-mail: zbyszek@mosaic.uncc.edu  **       University of North Carolina        Phone:  (704) 547-4873           **       Charlotte, NC 28223                 Fax:    (704) 547-2352           *******************************************************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -