Skip to content

Commit

Permalink
Update GitHub pages links
Browse files Browse the repository at this point in the history
  • Loading branch information
shilangyu committed Feb 11, 2024
1 parent 1274771 commit 1c92a7f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ For browser:

## usage

See [examples](https://shilangyu.dev/genetic.ts/). Source code can be found in `docs/`.
See [examples](https://github.shilangyu.dev/genetic.ts/). Source code can be found in `docs/`.

```ts
import * as genetic from 'genetic.ts' /* import the library, this object will be available globally if imported through HTML */
Expand All @@ -50,20 +50,20 @@ const population = [
dna: [1, 2, 4],
fitness() {
return this.dna.reduce((a, b) => a + b)
}
},
},
{
dna: [4, 4, 8],
fitness() {
return this.dna.reduce((a, b) => a + b)
}
},
},
{
dna: [11, 3, 7],
fitness() {
return this.dna.reduce((a, b) => a + b)
}
}
},
},
]

/* create your genetic object */
Expand All @@ -74,8 +74,8 @@ const ga = new genetic.Instance({
) /* add mutation function */,
modes: {
crossover:
genetic.CrossoverModes.clone /* overwrite default modes with enums */
}
genetic.CrossoverModes.clone /* overwrite default modes with enums */,
},
})

/* All Genetic's methods are chainable */
Expand Down Expand Up @@ -187,7 +187,7 @@ Genetic.ts provides some pre-made functions for mutations:
If you'd like to mutate only some properties (based on the mutation rate) wrap your function in `chance(yourFunction)`, like so:
```ts
const mutFunc = chance(mRate => 2 * mRate)
const mutFunc = chance((mRate) => 2 * mRate)
```

### add
Expand Down

0 comments on commit 1c92a7f

Please sign in to comment.