Skip to content

Commit

Permalink
Bump version, improve README, improve docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
SharpCoder committed Nov 21, 2022
1 parent 70e270c commit 8780ad8
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "algen"
description = "A parallelized genetic algorithm runner"
version = "0.1.1"
version = "0.1.2"
authors = ["Josh Cole"]
edition = "2021"
license = "MIT"
Expand Down
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
algen = "0.1.0"
algen = "0.1.2"
```

And then you can run cargo to fetch it.
Expand All @@ -24,8 +24,39 @@ cargo build

## Usage

See the examples folder for how to use it.
Algen provides an abstraction on top of genetic algorithms. On its own, it
does not provide a working implementation. That's up to you! So here are the
traits you need to implement in order to use Algen:

- **Algorithm** to define how input data is manipulated to solve a particular
problem.
- **Analyzer** to score the result of the algorithm and produce a numeric
value representing how well it did.

In addition to these traits, you need to provide [TestParameters](https://docs.rs/algen/latest/algen/models/test_parameters/index.html) and
some kind of **Input Data** which is fed to your algorithm.

See the example in the examples folder for more details.

```rust
run_algorithm(
&parameters,
test_data,
algo,
analyzer,
Some(after_generation),
);
```

## Features

Optionally, you can include the tracing feature if you would like the library
to emit traces using the [tracing](https://crates.io/crates/tracing) crate.

```toml
[dependencies]
algen = { version = "0.1.2", features = ["tracing"] }
```

## Contributing

Expand Down
23 changes: 22 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,28 @@
//!
//! This will happen until a winning condition is met, or until you have
//! exhausted all generations.

//!
//! Algen provides an abstraction on top of genetic algorithms. On its own, it
//! does not provide a working implementation. That's up to you! So here are the
//! traits you need to implement in order to use Algen:
//!
//! - **Algorithm** to define how input data is manipulated to solve a particular problem.
//! - **Analyzer** to score the result of the algorithm and produce a numeric value representing how well it did.
//!
//! In addition to these traits, you need to provide [TestParameters](https://docs.rs/algen/latest/algen/models/test_parameters/index.html) and
//! some kind of **Input Data** which is fed to your algorithm.
//!
//! See the example in the examples folder for more details.
//!
//! ```no_run
//! run_algorithm(
//! &parameters,
//! test_data,
//! algo,
//! analyzer,
//! Some(after_generation),
//! );
//! ```
mod math;
pub mod models;

Expand Down

0 comments on commit 8780ad8

Please sign in to comment.