📄 test_results.txt
字号:
randtest: Random Number Test
Using the RAN2 random number generator (RNG).
Using specified random seed 555
Library thinks the random seed is 555
running the chi-square test for randomness of the RNG...
(there will be some failures of the chi-square test)
integer test (1000): chi-squared should be within 20 of 100
run #0 100
run #1 116.8
run #2 107.68
run #3 83.368
run #4 109.937
run #5 83.1937
run #6 123.719 ***failed***
run #7 123.772 ***failed***
run #8 112.177
run #9 117.418
integer test (10000): chi-squared should be within 20 of 100
run #0 90.74
run #1 90.54
run #2 106.14
run #3 101.34
run #4 121.72 ***failed***
run #5 90.86
run #6 103.26
run #7 85.9
run #8 99.68
run #9 95.8
integer test (10000): chi-squared should be within 20 of 100
run #0 116.32
run #1 100.54
run #2 87.64
run #3 80.34
run #4 110.82
run #5 101.44
run #6 129.98 ***failed***
run #7 98.58
run #8 90.42
run #9 79.62 ***failed***
integer test (100000): chi-squared should be within 20 of 100
run #0 114.012
run #1 95.838
run #2 86.642
run #3 93.536
run #4 79.85 ***failed***
run #5 102.88
run #6 101.152
run #7 84.582
run #8 85.89
run #9 69.776 ***failed***
Example 1
This program tries to fill a 2DBinaryStringGenome with
alternating 1s and 0s using a SimpleGA
The GA found:
0101010101
1010101010
0101010101
1010101010
0101010101
Example 2
This program generates a sequence of random numbers then uses
a simple GA and binary-to-decimal genome to match the
sequence.
input sequence:
0.265886 54.6261 3 -2.85019 69151.2 0.00150462 2
random values in the genome:
0.980392 18.4314 3 -4.34118 23997.6 0.00276471 0.494118
the ga generated:
0.278431 54.5098 3 -2.87059 2450.59 0.00163529 2.00392
best of generation data are in 'bog.dat'
Example 3
This program reads in a data file then runs a simple GA whose
objective function tries to match the pattern of bits that are
in the data file.
input pattern:
* * * * * *
* * * *
* *
* * * * * *
* * * * * *
* *
* *
* *
* * * *
* * * * * * * *
* * * *
* * * * * *
best of generation data are in 'bog.dat'
the ga generated:
* *
* * * * *
* * * * *
* * *
* * * * * * *
* * * * *
* * *
* * * * * *
* * * *
* * * * *
* * * * * * * * *
* *
* * * * * * *
* *
Example 4
This program tries to fill a 3DBinaryStringGenome with
alternating 1s and 0s using a SteadyStateGA
the ga generated:
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
1010101010
0101010101
best of generation data are in 'bog.dat'
Example 5
This program shows how to use a composite genome. It reads
a matrix from a data file and a set of values to be matched in
a binary-to-decimal genome then uses a steady-state GA to
match the pattern and value set.
input pattern:
* * * * * *
* * * *
* *
* * * * * *
* * * * * *
* *
* *
* *
* * * *
* * * * * * * *
* * * *
* * * * * *
input sequence:
10.2 32.5 66 99.234 0.003 210
the ga generated:
* * * * * *
* * * *
* *
* * * * * *
* * * * * *
* * *
* *
* *
* * * *
* * * * * * * *
* * * *
* * * * * *
8.48132 35.1548 106.446 99.234 0.00586374 210
Example 6
This example uses a SteadyState GA and Tree<int> genome. It
tries to maximize the size of the tree genomes that it
contains. The genomes contain ints in its nodes.
8653 nodes, 120 levels deep.
best of generation data are in 'bog.dat'
Example 7
This program reads in a data file then runs a steady-state GA
whose objective function tries to match the pattern of bits that
are in the data file.
input pattern:
* * * * * *
* * * *
* *
* * * * * *
* * * * * *
* *
* *
* *
* * * *
* * * * * * * *
* * * *
* * * * * *
the ga generated:
* * * * * *
* * * *
* * *
* * * * * * *
* * * * * * *
* * *
* *
* *
* * * * *
* * * * * * *
* * * *
* * * * * *
best of generation data are in 'bog.dat'
Example 8
This program runs a steady-state GA whose objective function
tries to maximize the size of the list and tries to make lists
that contain the number 101 in the nodes. The lists contain
ints in the nodes.
the list contains 0 nodes
the ga used the parameters:
minimaxi 1
number_of_generations 50
generations_to_convergence 20
convergence_percentage 0.99
crossover_probability 0.6
mutation_probability 0.05
population_size 40
score_frequency 1
flush_frequency 10
record_diversity 0
score_filename bog.dat
select_scores 7
number_of_best 1
replacement_percentage 0.5
replacement_number 20
Example 9
This program finds the maximum value in the function
y = - x1^2 - x2^2
with the constraints
-5 <= x1 <= 5
-5 <= x2 <= 5
the ga found an optimum at the point (7.62939e-05, 0.00328064)
best of generation data are in 'bog.dat'
Example 10
This program uses sharing to do speciation. The objective
function has more than one optimum, so different genomes
may have equally high scores. Speciation keeps the population
from clustering at one optimum.
Both gene-wise and phenotype-wise distance functions are used.
Populations from all three runs are written to the files
pop.nospec.dat, pop.genespec.dat and pop.phenespec.dat. The
function is written to the file sinusoid.dat
running with no speciation (fitness proportionate scaling)...
the ga found an optimum at the point 3.2549
running the ga with speciation (sharing using bit-wise)...
the ga found an optimum at the point 2.2549
running the ga with speciation (sharing using phenotype-wise)...
the ga found an optimum at the point 4.2549
dumping the function to file...
Example 11
This program illustrates the use of order-based lists. The
list in this problem contains 25 numbers, 0 to 24. It tries
to put them in descending order from 24 to 0.
the ga generated the following list (objective score is 24):
24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
best of generation data are in 'bog.dat'
minimaxi 1
number_of_generations 1000
generations_to_convergence 20
convergence_percentage 0.99
crossover_probability 0.6
mutation_probability 0.01
population_size 30
score_frequency 10
flush_frequency 10
record_diversity 0
score_filename bog.dat
select_scores 2
number_of_best 1
replacement_percentage 0.5
replacement_number 15
Example 12
This program illustrates the use of order-based strings. The
string in this problem contains 26 letters, a to z. It tries
to put them in alphabetic order.
the ga generated the following string (objective score is 26):
abcdefghijklmnopqrstuvwxyz
GAStringGenome
Example 13
This program runs a GA-within-GA. The outer level GA tries to
match the pattern read in from a file. The inner level GA is
run only when the outer GA reaches a threshhold objective score
then it tries to match a sequence of numbers that were generated
randomly at the beginning of the program's execution.
You might have to run the primary GA for more than 5000
generations to get a score high enough to kick in the secondary
genetic algorithm. Use the ngen option to do this on the
command line.
input pattern:
* * * * * *
* * * *
* *
* * * * * *
* * * * * *
* *
* *
* *
* * * *
* * * * * * * *
* * * *
* * * * * *
input sequence:
0.265886 54.6261 3 -2.85019 69151.2 0.00150462 2
the ga generated:
* * * * *
* * * * * * * * *
* * * *
* *
* * * * *
* * * * * * * *
* * * * * *
* *
* * * * *
* * * * * * *
* * * * * *
* * * * * * * *
* * * * * *
* * * * * *
0.411765 12.9412 3 -2.16471 74143.5 0.00749412 6.17647
best of generation data are in 'bog.dat'
Example 14
This example shows how to create a genome that contains
a list of lists. We create a composite genome that has
lists in it. Each list has some nodes, only one of which
contains the number 0. The objective is to move the node with
number 0 in it to the nth position where n is the number of the
list within the composite genome.
a randomly-generated set of paths:
list 0: 28 20 21 22 25 24 0 26 23 27
list 1: 22 20 23 21 0 24 25 26 28 27
list 2: 20 23 21 28 27 24 22 26 0 25
list 3: 0 20 21 22 23 24 27 26 25 28
list 4: 0 28 21 22 23 24 27 26 20 25
list 5: 28 27 21 26 23 24 25 22 20 0
the ga generated:
list 0: 0 26 24 22 25 23 27 28 21 20
list 1: 24 0 20 26 23 22 25 27 21 28
list 2: 21 26 0 22 23 20 25 27 28 24
list 3: 24 21 22 0 23 27 25 20 26 28
list 4: 24 26 23 21 0 20 22 28 27 25
list 5: 20 26 21 25 23 0 24 22 27 28
Example 15
This program generates a sequence of random numbers then uses
a simple GA and binary-to-decimal genome to match the
sequence. It uses the convergence of the best-of-generation
as the criterion for when to stop.
input sequence:
0.265886 54.6261 3 -2.85019 69151.2 0.00150462 2
random values in the genome:
0.419608 85.098 3 -4.90588 6760 0.00834118 5.92941
the ga generated:
0.247059 49.8039 3 -2.74118 60823.5 0.00156471 2.00392
Example 16
This example uses a SteadyState GA and Tree<int> genome. It
tries to maximize the size of the tree genomes that it
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -