Skip to content

Commit

Permalink
doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bhaller committed Mar 18, 2024
1 parent c0821b7 commit fa18458
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 22 deletions.
22 changes: 11 additions & 11 deletions QtSLiM/help/SLiMHelpClasses.html
Expand Up @@ -538,36 +538,36 @@
<p class="p5">filePath =&gt; (string$)</p>
<p class="p6">The path of the log file being written to.<span class="Apple-converted-space">  </span>This may be changed with <span class="s1">setFilePath()</span>.</p>
<p class="p5">logInterval =&gt; (integer$)</p>
<p class="p6">The interval for automatic logging; a new row of data will be logged every <span class="s1">logInterval</span> ticks.<span class="Apple-converted-space">  </span>This may be changed with <span class="s1">setLogInterval()</span>.<span class="Apple-converted-space">  </span>If automatic logging has been disabled, this property will be <span class="s1">0</span>.</p>
<p class="p6">The interval for automatic logging; a new row of data will be logged every <span class="s1">logInterval</span> ticks.<span class="Apple-converted-space">  </span>This may be set with the <span class="s1">logInterval</span> parameter to <span class="s1">createLogFile()</span> and changed with <span class="s1">setLogInterval()</span>.<span class="Apple-converted-space">  </span>If automatic logging has been disabled, this property will be <span class="s1">0</span>.</p>
<p class="p5">precision &lt;–&gt; (integer$)</p>
<p class="p6">The precision of <span class="s1">float</span> output.<span class="Apple-converted-space">  </span>To be exact, <span class="s1">precision</span> specifies the preferred number of significant digits that will be output for <span class="s1">float</span> values.<span class="Apple-converted-space">  </span>The default is <span class="s1">6</span>; values in [<span class="s1">1</span>,<span class="s1">22</span>] are legal, but <span class="s1">17</span> is probably the largest value that makes sense given the limits of double-precision floating point.</p>
<p class="p5">tag &lt;–&gt; (integer$)</p>
<p class="p6">A user-defined <span class="s1">integer</span> value.<span class="Apple-converted-space">  </span>The value of <span class="s1">tag</span> is initially undefined, and it is an error to try to read it; if you wish it to have a defined value, you must arrange that yourself by explicitly setting its value prior to using it elsewhere in your code.<span class="Apple-converted-space">  </span>The value of <span class="s1">tag</span> is not used by SLiM; it is free for you to use.</p>
<p class="p11"><i>5.9.2<span class="Apple-converted-space">  </span></i><span class="s1"><i>LogFile</i></span><i> methods</i></p>
<p class="p5">– (void)addCustomColumn(string$ columnName, string$ source, [* context = NULL])</p>
<p class="p6">Adds a new data column with its name provided by <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>The value for the column, when a given row is generated, will be produced by the code supplied in <span class="s1">source</span>, which is expected to return either <span class="s1">NULL</span> (which will write out <span class="s1">NA</span>), or a singleton value of any non-object type.</p>
<p class="p6">Adds a new data column with its name provided by <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>The value for the column, when a given row is generated, will be produced by the code supplied in <span class="s1">source</span>, which is expected to return either <span class="s1">NULL</span> (which will write out <span class="s1">NA</span>), or a singleton value of any non-object type.</p>
<p class="p6">The <span class="s1">context</span> parameter will be set up as a pseudo-parameter, named <span class="s1">context</span>, when <span class="s1">source</span> is called, allowing the same source code to be used to generate values for multiple data columns; you might, for example, provide the particular <span class="s1">Subpopulation</span> object here that you wish <span class="s1">source</span> to use for its calculations.<span class="Apple-converted-space">  </span>This is optional; if the default value of <span class="s1">NULL</span> is used, then <span class="s1">context</span> will be <span class="s1">NULL</span> when <span class="s1">source</span> is called.</p>
<p class="p6">See <span class="s1">addMeanSDColumns()</span> for a useful variant.</p>
<p class="p5">– (void)addCycle([No&lt;Species&gt;$ species = NULL])</p>
<p class="p6">Adds a new data column that provides the cycle counter for <span class="s1">species</span> (the same as the value of the <span class="s1">cycle</span> property of that species).<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">cycle</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.</p>
<p class="p6">Adds a new data column that provides the cycle counter for <span class="s1">species</span> (the same as the value of the <span class="s1">cycle</span> property of that species).<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">cycle</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.</p>
<p class="p5">– (void)addCycleStage(void)</p>
<p class="p6">Adds a new data column that provides the cycle stage, named <span class="s1">cycle_stage</span>.<span class="Apple-converted-space">  </span>The stage is provided as a <span class="s1">string</span>, and will typically be <span class="s1">"first"</span>, <span class="s1">"early"</span>, <span class="s1">"late"</span>, or <span class="s1">"end"</span> (the latter used for the point in time at which end-of-tick automatic logging occurs).<span class="Apple-converted-space">  </span>Other possible values are discussed in the documentation for the <span class="s1">cycleStage</span> property of <span class="s1">Community</span>, which this column reflects.</p>
<p class="p6">Adds a new data column that provides the cycle stage, named <span class="s1">cycle_stage</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>The stage is provided as a <span class="s1">string</span>, and will typically be <span class="s1">"first"</span>, <span class="s1">"early"</span>, <span class="s1">"late"</span>, or <span class="s1">"end"</span> (the latter used for the point in time at which end-of-tick automatic logging occurs).<span class="Apple-converted-space">  </span>Other possible values are discussed in the documentation for the <span class="s1">cycleStage</span> property of <span class="s1">Community</span>, which this column reflects.</p>
<p class="p5">– (void)addKeysAndValuesFrom(object$ source)</p>
<p class="p6">This <span class="s1">Dictionary</span> method has an override in <span class="s1">LogFile</span> to make it illegal to call, since <span class="s1">LogFile</span> manages its <span class="s1">Dictionary</span> entries.</p>
<p class="p5">– (void)addMeanSDColumns(string$ columnName, string$ source, [* context = NULL])</p>
<p class="p6">Adds two new data columns with names of <span class="s1">columnName_mean</span> and <span class="s1">columnName_sd</span>.<span class="Apple-converted-space">  </span>When a given row is generated, the code supplied in <span class="s1">source</span> is expected to return either a zero-length vector of any type including <span class="s1">NULL</span> (which will write out <span class="s1">NA</span> to both columns), or a non-zero-length vector of <span class="s1">integer</span> or <span class="s1">float</span> values.<span class="Apple-converted-space">  </span>In the latter case, the result vector will be summarized in the two columns by its mean and standard deviation respectively.<span class="Apple-converted-space">  </span>If the result vector has exactly one value, the standard deviation will be written as <span class="s1">NA</span>.<span class="Apple-converted-space">  </span>The <span class="s1">context</span> parameter is set up as a pseudo-parameter when <span class="s1">source</span> is called, as described in <span class="s1">addCustomColumn()</span>.</p>
<p class="p6">Adds two new data columns with names of <span class="s1">columnName_mean</span> and <span class="s1">columnName_sd</span>.<span class="Apple-converted-space">  </span>The new columns will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>When a given row is generated, the code supplied in <span class="s1">source</span> is expected to return either a zero-length vector of any type including <span class="s1">NULL</span> (which will write out <span class="s1">NA</span> to both columns), or a non-zero-length vector of <span class="s1">integer</span> or <span class="s1">float</span> values.<span class="Apple-converted-space">  </span>In the latter case, the result vector will be summarized in the two columns by its mean and standard deviation respectively.<span class="Apple-converted-space">  </span>If the result vector has exactly one value, the standard deviation will be written as <span class="s1">NA</span>.<span class="Apple-converted-space">  </span>The <span class="s1">context</span> parameter is set up as a pseudo-parameter when <span class="s1">source</span> is called, as described in <span class="s1">addCustomColumn()</span>.</p>
<p class="p5">– (void)addPopulationSexRatio([No&lt;Species&gt;$ species = NULL])</p>
<p class="p6">Adds a new data column that provides the population sex ratio M:(M+F) for <span class="s1">species</span>.<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">sex_ratio</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.<span class="Apple-converted-space">  </span>If the species is hermaphroditic, <span class="s1">NA</span> will be written.</p>
<p class="p6">Adds a new data column that provides the population sex ratio M:(M+F) for <span class="s1">species</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">sex_ratio</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.<span class="Apple-converted-space">  </span>If the species is hermaphroditic, <span class="s1">NA</span> will be written.</p>
<p class="p5">– (void)addPopulationSize([No&lt;Species&gt;$ species = NULL])</p>
<p class="p6">Adds a new data column that provides the total population size for <span class="s1">species</span>.<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">num_individuals</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.</p>
<p class="p6">Adds a new data column that provides the total population size for <span class="s1">species</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>In single-species models, <span class="s1">species</span> may be <span class="s1">NULL</span> to indicate that single species.<span class="Apple-converted-space">  </span>The column will simply be named <span class="s1">num_individuals</span> in single-species models; an underscore and the name of the species will be appended in multispecies models.</p>
<p class="p5">– (void)addSubpopulationSexRatio(io&lt;Subpopulation&gt;$ subpop)</p>
<p class="p6">Adds a new data column that provides the sex ratio M:(M+F) of the subpopulation <span class="s1">subpop</span>, named <span class="s1">pX_sex_ratio</span>.<span class="Apple-converted-space">  </span>If the subpopulation exists but has a size of zero, <span class="s1">NA</span> will be written.</p>
<p class="p6">Adds a new data column that provides the sex ratio M:(M+F) of the subpopulation <span class="s1">subpop</span>, named <span class="s1">pX_sex_ratio</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>If the subpopulation exists but has a size of zero, <span class="s1">NA</span> will be written.</p>
<p class="p5">– (void)addSubpopulationSize(io&lt;Subpopulation&gt;$ subpop)</p>
<p class="p6">Adds a new data column that provides the size of the subpopulation <span class="s1">subpop</span>, named <span class="s1">pX_num_individuals</span>.<span class="Apple-converted-space">  </span>If the subpopulation exists but has a size of zero, <span class="s1">0</span> will be written.</p>
<p class="p6">Adds a new data column that provides the size of the subpopulation <span class="s1">subpop</span>, named <span class="s1">pX_num_individuals</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>If the subpopulation exists but has a size of zero, <span class="s1">0</span> will be written.</p>
<p class="p5">– (void)addSuppliedColumn(string$ columnName)</p>
<p class="p6">Adds a new data column with its name provided by <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>The value for the column is initially undefined, and will be written as <span class="s1">NA</span>.<span class="Apple-converted-space">  </span>A different value may (optionally) be provided by calling <span class="s1">setSuppliedValue()</span> with a value for <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>That value will be used for the column the next time a row is generated (whether automatically or by a call to <span class="s1">logRow()</span>), and the column’s value will subsequently be undefined again.<span class="Apple-converted-space">  </span>In other words, for any given logged row the default of <span class="s1">NA</span> may be kept, or a different value may be supplied.<span class="Apple-converted-space">  </span>This allows the value for the column to be set at any point during the tick cycle, which can be convenient if the column’s value depends upon transient state that is no longer available at the time the row is logged.</p>
<p class="p6">Adds a new data column with its name provided by <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.<span class="Apple-converted-space">  </span>The value for the column is initially undefined, and will be written as <span class="s1">NA</span>.<span class="Apple-converted-space">  </span>A different value may (optionally) be provided by calling <span class="s1">setSuppliedValue()</span> with a value for <span class="s1">columnName</span>.<span class="Apple-converted-space">  </span>That value will be used for the column the next time a row is generated (whether automatically or by a call to <span class="s1">logRow()</span>), and the column’s value will subsequently be undefined again.<span class="Apple-converted-space">  </span>In other words, for any given logged row the default of <span class="s1">NA</span> may be kept, or a different value may be supplied.<span class="Apple-converted-space">  </span>This allows the value for the column to be set at any point during the tick cycle, which can be convenient if the column’s value depends upon transient state that is no longer available at the time the row is logged.</p>
<p class="p5">– (void)addTick(void)</p>
<p class="p6">Adds a new data column, named <span class="s1">tick</span>, that provides the tick number for the simulation.</p>
<p class="p6">Adds a new data column, named <span class="s1">tick</span>, that provides the tick number for the simulation.<span class="Apple-converted-space">  </span>The new column will be logged each time that a row is generated, either by automatic logging or by a call to <span class="s1">logRow()</span>.</p>
<p class="p5">– (void)clearKeysAndValues(void)</p>
<p class="p6">This <span class="s1">Dictionary</span> method has an override in <span class="s1">LogFile</span> to make it illegal to call, since <span class="s1">LogFile</span> manages its <span class="s1">Dictionary</span> entries.</p>
<p class="p5">– (void)flush(void)</p>
Expand Down

0 comments on commit fa18458

Please sign in to comment.