New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

evjs

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

evjs - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

package.json
{
"name": "evjs",
"version": "0.1.1",
"version": "0.1.2",
"description": "Generic genetic/evolution algorithm in JS",

@@ -5,0 +5,0 @@ "main": "lib/evjs.js",

@@ -30,3 +30,7 @@ # EvJs

const evjs = new EvJs({
const evjsConfig = {
notification: 0.5 // emit 50% of the logs
}
const generationConfig = {
size: 10,

@@ -38,8 +42,15 @@ crossover: 0.7,

pair: 'tournament2',
optimizeKey: 'Max',
optimizeKey: 'Max'
}
const individualConfig = {
fitness,
mutate,
mate
})
}
const config = Object.assign({}, evjsConfig, generationConfig, individualConfig)
const evjs = new EvJs(config)
evjs.populate(seed)

@@ -78,19 +89,2 @@ evjs.run()

## Individual Configuration Parameters
```typescript
interface IndividualConfig {
fitness: (entity: any): number
mutate: (entity: any): any
mate: (mother: any, father: any): [any, any]
}
```
| Parameter | Type | Description
| --------------------- | -------- | -----------
| fitness | Function | Calculates the fitness score of an individual
| mutate | Function | Mutates an individual
| mate | Function | Mates 2 individuals and returns 2 new individuals
### SelectType

@@ -104,2 +98,3 @@

## Optimizer

@@ -126,2 +121,19 @@

## Individual Configuration Parameters
```typescript
interface IndividualConfig {
fitness: (entity: any): number
mutate: (entity: any): any
mate: (mother: any, father: any): [any, any]
}
```
| Parameter | Type | Description
| --------------------- | -------- | -----------
| fitness | Function | Calculates the fitness score of an individual
| mutate | Function | Mutates an individual
| mate | Function | Mates 2 individuals and returns 2 new individuals
## Building

@@ -128,0 +140,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc