1 <?xml version="1.0" encoding="iso-8859-1"?>
3 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8 <title>Class: Genome</title>
9 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10 <meta http-equiv="Content-Script-Type" content="text/javascript" />
11 <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
12 <script type="text/javascript">
15 function popupCode( url ) {
16 window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
19 function toggleCode( id ) {
20 if ( document.getElementById )
21 elem = document.getElementById( id );
22 else if ( document.all )
23 elem = eval( "document.all." + id );
27 elemStyle = elem.style;
29 if ( elemStyle.display != "block" ) {
30 elemStyle.display = "block"
32 elemStyle.display = "none"
38 // Make codeblocks hidden by default
39 document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
49 <div id="classHeader">
50 <table class="header-table">
51 <tr class="top-aligned-row">
52 <td><strong>Class</strong></td>
53 <td class="class-name-in-header">Genome</td>
55 <tr class="top-aligned-row">
56 <td><strong>In:</strong></td>
58 <a href="../files/lib/libgenetics_rb.html">
62 <a href="../files/lib/libpplayer_rb.html">
69 <tr class="top-aligned-row">
70 <td><strong>Parent:</strong></td>
77 <!-- banner header -->
79 <div id="bodyContent">
83 <div id="contextContent">
85 <div id="description">
87 A single genome in a population
95 <div id="method-list">
96 <h3 class="section-bar">Methods</h3>
98 <div class="name-list">
99 <a href="#M000004">crossover</a>
100 <a href="#M000002">mutate</a>
101 <a href="#M000003">mutate!</a>
102 <a href="#M000001">new</a>
103 <a href="#M000005">to_potential_player</a>
118 <div id="attribute-list">
119 <h3 class="section-bar">Attributes</h3>
121 <div class="name-list">
123 <tr class="top-aligned-row context-row">
124 <td class="context-item-name">genome</td>
125 <td class="context-item-value"> [RW] </td>
126 <td class="context-item-desc"></td>
134 <!-- if method_list -->
136 <h3 class="section-bar">Public Class methods</h3>
138 <div id="method-M000001" class="method-detail">
139 <a name="M000001"></a>
141 <div class="method-heading">
142 <a href="Genome.src/M000001.html" target="Code" class="method-signature"
143 onclick="popupCode('Genome.src/M000001.html');return false;">
144 <span class="method-name">new</span><span class="method-args">(bitstring_or_length)</span>
148 <div class="method-description">
150 Create a random genome of the given length
155 <h3 class="section-bar">Public Instance methods</h3>
157 <div id="method-M000004" class="method-detail">
158 <a name="M000004"></a>
160 <div class="method-heading">
161 <a href="Genome.src/M000004.html" target="Code" class="method-signature"
162 onclick="popupCode('Genome.src/M000004.html');return false;">
163 <span class="method-name">crossover</span><span class="method-args">(other_genome, crossover_point)</span>
167 <div class="method-description">
169 Crossover two genomes at the given point
174 <div id="method-M000002" class="method-detail">
175 <a name="M000002"></a>
177 <div class="method-heading">
178 <a href="Genome.src/M000002.html" target="Code" class="method-signature"
179 onclick="popupCode('Genome.src/M000002.html');return false;">
180 <span class="method-name">mutate</span><span class="method-args">(mutation_probability = 0.05)</span>
184 <div class="method-description">
186 Mutate a genome with the given rate per bit
191 <div id="method-M000003" class="method-detail">
192 <a name="M000003"></a>
194 <div class="method-heading">
195 <a href="Genome.src/M000003.html" target="Code" class="method-signature"
196 onclick="popupCode('Genome.src/M000003.html');return false;">
197 <span class="method-name">mutate!</span><span class="method-args">(mutation_probability = 0.05)</span>
201 <div class="method-description">
203 Mutate a genome in-place with the given rate per bit
208 <div id="method-M000005" class="method-detail">
209 <a name="M000005"></a>
211 <div class="method-heading">
212 <a href="Genome.src/M000005.html" target="Code" class="method-signature"
213 onclick="popupCode('Genome.src/M000005.html');return false;">
214 <span class="method-name">to_potential_player</span><span class="method-args">()</span>
218 <div class="method-description">
220 Create a potential player from a genome
232 <div id="validator-badges">
233 <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>