From: Jürgen Purtz <juergen@purtz.de>
To: Pg Docs <pgsql-docs@lists.postgresql.org>
Subject: Re: Make 'Genetic Algorithm' a real figure
Date: Fri, 19 Jul 2019 20:57:37 +0200
Message-ID: <edeaf03d-2e19-3b35-e17b-983e4dd95606@purtz.de> (raw)
In-Reply-To: <c6027f7a-78ea-8453-0837-09903ba5fd9b@purtz.de>
References: <c6027f7a-78ea-8453-0837-09903ba5fd9b@purtz.de>
This is an adoption of the genetic-algorithm.gv file to the style of the
gin.gv file: same font, similar header, use of TAB instead of SPACE.
Kind regards
Jürgen Purtz
Attachments:genetic-algorithm-v1.patch (text/x-patch, 4.5K) downloaddiff --git a/doc/src/sgml/geqo.sgml b/doc/src/sgml/geqo.sgmlindex 5120dfbb42..5a52fb46db 100644--- a/doc/src/sgml/geqo.sgml+++ b/doc/src/sgml/geqo.sgml@@ -84,7 +84,8 @@
Through simulation of the evolutionary operations <firstterm>recombination</firstterm>,
<firstterm>mutation</firstterm>, and
<firstterm>selection</firstterm> new generations of search points are found
- that show a higher average fitness than their ancestors.+ that show a higher average fitness than their ancestors. <xref linkend="geqo-figure"/>+ illustrates in which order and how long the three steps are processed.
</para>
<para>
@@ -94,48 +95,13 @@
non-random (better than random).
</para>
- <figure id="geqo-diagram">- <title>Structured Diagram of a Genetic Algorithm</title>-- <informaltable frame="none">- <tgroup cols="2">- <tbody>- <row>- <entry>P(t)</entry>- <entry>generation of ancestors at a time t</entry>- </row>-- <row>- <entry>P''(t)</entry>- <entry>generation of descendants at a time t</entry>- </row>- </tbody>- </tgroup>- </informaltable>--<literallayout class="monospaced">-+=========================================+-|>>>>>>>>>>> Algorithm GA <<<<<<<<<<<<<<|-+=========================================+-| INITIALIZE t := 0 |-+=========================================+-| INITIALIZE P(t) |-+=========================================+-| evaluate FITNESS of P(t) |-+=========================================+-| while not STOPPING CRITERION do |-| +-------------------------------------+-| | P'(t) := RECOMBINATION{P(t)} |-| +-------------------------------------+-| | P''(t) := MUTATION{P'(t)} |-| +-------------------------------------+-| | P(t+1) := SELECTION{P''(t) + P(t)} |-| +-------------------------------------+-| | evaluate FITNESS of P''(t) |-| +-------------------------------------+-| | t := t + 1 |-+===+=====================================+-</literallayout>+ <figure id="geqo-figure">+ <title>Structure of a Genetic Algorithm</title>+ <mediaobject>+ <imageobject>+ <imagedata fileref="images/genetic-algorithm.svg" format="SVG" width="100%"/>+ </imageobject>+ </mediaobject>
</figure>
</sect1>
diff --git a/doc/src/sgml/images/Makefile b/doc/src/sgml/images/Makefileindex 1e7993020b..f9e356348b 100644--- a/doc/src/sgml/images/Makefile+++ b/doc/src/sgml/images/Makefile@@ -3,6 +3,7 @@
# see README in this directory about image handling
ALL_IMAGES = \
+ genetic-algorithm.svg \
gin.svg \
pagelayout.svg
diff --git a/doc/src/sgml/images/genetic-algorithm.gv b/doc/src/sgml/images/genetic-algorithm.gvindex e69de29bb2..520c44bc65 100644--- a/doc/src/sgml/images/genetic-algorithm.gv+++ b/doc/src/sgml/images/genetic-algorithm.gv@@ -0,0 +1,51 @@+digraph {++ layout=dot;++ // default values+ node [shape=box, label="", fontname="sans-serif", style=filled, fillcolor=white, width=2.2, fontsize=8];+ graph [fontname="sans-serif"]; // must be specified separately+ edge [fontname="sans-serif"]; // must be specified separately++ // an unobtrusive background color+ pad="1.0, 0.5";+ bgcolor=whitesmoke;++ // layout of edges and nodes+ splines=ortho;+ nodesep=0.3;+ ranksep=0.3;++ // label="Structure of a Genetic Algorithm" fontsize=26;++ // nodes + a1[label="INITIALIZE t := 0"];+ a2[label="INITIALIZE P(t)"];+ a3[label="evaluate FITNESS of P(t)"];+ a4[shape="diamond", label="STOPPING CRITERION"; width=4];++ // connect 'end' node with 'a9' node (bottom of figure)+ {+ rank=same;+ a9[label="t := t + 1"];+ // end-symbol similar to UML notation+ end[shape=doublecircle, label="end", width=0.5];+ }++ a5[label="P'(t) := RECOMBINATION{P(t)}"];+ a6[label="P''(t) := MUTATION{P'(t)}"];+ a7[label="P(t+1) := SELECTION{P''(t) + P(t)}"];+ a8[label="evaluate FITNESS of P''(t)"];++ // edges+ a1 -> a2 -> a3 -> a4;+ a4 -> a5[xlabel="false ", fontsize=10];+ a4 -> end[xlabel="true ", fontsize=10];+ a5 -> a6 -> a7 -> a8 -> a9;+ a4 -> a9 [dir=back]; // forces 'true'-edge to right side of figure++ // explain the notation+ expl [shape=plaintext, fontsize=10, width=3.2, fillcolor=whitesmoke,+ label="P(t) generation of ancestors at a time t\nP''(t) generation of descendants at a time t"];++}
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: juergen@purtz.de, pgsql-docs@lists.postgresql.org
Subject: Re: Make 'Genetic Algorithm' a real figure
In-Reply-To: <edeaf03d-2e19-3b35-e17b-983e4dd95606@purtz.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox