Repository navigation
README: dependency line and CTRNN dynamics section, README snippets as doc-tests - #110
Merged
Merged
Conversation
…, ref #93 - Sample usage: the crates.io release (0.2.1) predates this API and 0.3.0 is not published, so the README depends on the git repository (develop) instead of a version number. - Replace the explicit-Euler tau section with the current dynamics: exponential Euler, dt and step_time, propagation depth per activation, per-neuron tau genes and their mutation, and Integrator::Euler (only reachable through the low-level Ctrnn). - Bound the XOR snippet to 500 generations and seed it, so it can run as a test. - Compile and run the README Rust blocks as doc-tests through a cfg(doctest) item in lib.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
/api/v1/crates/rustneat, checked 2026-11-25): newest published version is 0.2.1 (2018-05-28); 0.3.0 is not published. 0.2.1 lackscreate_population_initialized,evaluate_in -> Resultandwith_seed, so the README now depends on the repository (git = "https://github.com/TLmaK0/rustneat", branch = "develop") and says the README documents the code in the repo, which can differ from crates.io releases. No version number or release status is written in the README, so it does not go stale when 0.3.0 is published (at that point the line can becomerustneat = "0.3").Organism::activate,dt/step_time/round(step_time/dt)steps, the meaning ofdt/τ, propagation depth (one connection per step, so at mostround(step_time/dt)connections per call), per-neuron τ genes (Genome::tau/set_tau,tau_mutation_rate(0 by default),tau_gene_mutation_rate,tau_mutate_power,tau_range,compatibility_tau_coefficient), andIntegrator::Euler. It also includes a smallMutationConfigbuilder snippet.src/lib.rsadds#[cfg(doctest)] #[doc = include_str!("../README.md")] pub struct ReadmeDoctests;, socargo testcompiles and runs every ```rust block in the README. The XOR snippet is now bounded (500 generations) and seeded (with_seed(42)) so it can run as a test, and it points to `examples/simple_sample.rs`.Fact found while documenting:
Integrator::Eulercan only be reached through the low-levelCtrnn::with_integrator.Organismuses apub(crate) const INTEGRATOR = ExponentialEuler, so evolution cannot select it. The README states this as it is and does not change that behaviour.Verification
create_population_initialised),cargo test --release --docfails withsrc/lib.rs - ReadmeDoctests ... Couldn't compile the test.cargo test --release --docrunsReadmeDoctests (line 100)and(line 194), both ok. The XOR snippet, run as a program, solves XOR with seed 42 (champion fitness 15.69 > 15.5) well inside the 500-generation cap. The doc-test takes 0.6 s.cargo fmt -- --checkok;cargo clippy --release --all-targets56 warnings, same as develop 4eafc8e;cargo build --release --examplesok;cargo test --release --no-fail-fastall green (122 unit + every integration binary + 4 doc-tests, 2 ignored as on develop).Closing criterion
Integrator::Euler,dt, per-neuron τ,tau_mutation_rate, propagation depth.ref #93
Parte de la épica #55 (part of epic #55)
🤖 Generated with Claude Code