gooderp18绿色标准版
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

48 lines
5.4KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>59.2. Genetic Algorithms</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="geqo-intro.html" title="59.1. Query Handling as a Complex Optimization Problem" /><link rel="next" href="geqo-pg-intro.html" title="59.3. Genetic Query Optimization (GEQO) in PostgreSQL" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">59.2. Genetic Algorithms</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="geqo-intro.html" title="59.1. Query Handling as a Complex Optimization Problem">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="geqo.html" title="Chapter 59. Genetic Query Optimizer">Up</a></td><th width="60%" align="center">Chapter 59. Genetic Query Optimizer</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="geqo-pg-intro.html" title="59.3. Genetic Query Optimization (GEQO) in PostgreSQL">Next</a></td></tr></table><hr></hr></div><div class="sect1" id="GEQO-INTRO2"><div class="titlepage"><div><div><h2 class="title" style="clear: both">59.2. Genetic Algorithms</h2></div></div></div><p>
  3. The genetic algorithm (<acronym class="acronym">GA</acronym>) is a heuristic optimization method which
  4. operates through randomized search. The set of possible solutions for the
  5. optimization problem is considered as a
  6. <em class="firstterm">population</em> of <em class="firstterm">individuals</em>.
  7. The degree of adaptation of an individual to its environment is specified
  8. by its <em class="firstterm">fitness</em>.
  9. </p><p>
  10. The coordinates of an individual in the search space are represented
  11. by <em class="firstterm">chromosomes</em>, in essence a set of character
  12. strings. A <em class="firstterm">gene</em> is a
  13. subsection of a chromosome which encodes the value of a single parameter
  14. being optimized. Typical encodings for a gene could be <em class="firstterm">binary</em> or
  15. <em class="firstterm">integer</em>.
  16. </p><p>
  17. Through simulation of the evolutionary operations <em class="firstterm">recombination</em>,
  18. <em class="firstterm">mutation</em>, and
  19. <em class="firstterm">selection</em> new generations of search points are found
  20. that show a higher average fitness than their ancestors.
  21. </p><p>
  22. According to the <span class="systemitem">comp.ai.genetic</span> <acronym class="acronym">FAQ</acronym> it cannot be stressed too
  23. strongly that a <acronym class="acronym">GA</acronym> is not a pure random search for a solution to a
  24. problem. A <acronym class="acronym">GA</acronym> uses stochastic processes, but the result is distinctly
  25. non-random (better than random).
  26. </p><div class="figure" id="GEQO-DIAGRAM"><p class="title"><strong>Figure 59.1. Structured Diagram of a Genetic Algorithm</strong></p><div class="figure-contents"><div class="informaltable"><table class="informaltable" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>P(t)</td><td>generation of ancestors at a time t</td></tr><tr><td>P''(t)</td><td>generation of descendants at a time t</td></tr></tbody></table></div><pre class="literallayout">
  27. +=========================================+
  28. |&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; Algorithm GA &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;|
  29. +=========================================+
  30. | INITIALIZE t := 0 |
  31. +=========================================+
  32. | INITIALIZE P(t) |
  33. +=========================================+
  34. | evaluate FITNESS of P(t) |
  35. +=========================================+
  36. | while not STOPPING CRITERION do |
  37. | +-------------------------------------+
  38. | | P'(t) := RECOMBINATION{P(t)} |
  39. | +-------------------------------------+
  40. | | P''(t) := MUTATION{P'(t)} |
  41. | +-------------------------------------+
  42. | | P(t+1) := SELECTION{P''(t) + P(t)} |
  43. | +-------------------------------------+
  44. | | evaluate FITNESS of P''(t) |
  45. | +-------------------------------------+
  46. | | t := t + 1 |
  47. +===+=====================================+
  48. </pre></div></div><br class="figure-break" /></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="geqo-intro.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="geqo.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="geqo-pg-intro.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">59.1. Query Handling as a Complex Optimization Problem </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 59.3. Genetic Query Optimization (<acronym class="acronym">GEQO</acronym>) in PostgreSQL</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1