Huge News!Announcing our $40M Series B led by Abstract Ventures.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.2.1 to 0.2.2

2

dist/evjs/evjs.d.ts

@@ -8,3 +8,3 @@ import { Generation, GenerationConfig } from '../generation';

notification?: number;
notifyIndividual?: boolean;
notifyBestOnly?: boolean;
}

@@ -11,0 +11,0 @@ export declare class EvJs {

@@ -20,3 +20,3 @@ "use strict";

this.iterations = config.iterations;
const { size, crossover, mutation, keepFittest, select, pair, optimizeKey, fitness, mutate, mate, notification, notifyIndividual } = config;
const { size, crossover, mutation, keepFittest, select, pair, optimizeKey, fitness, mutate, mate, notification, notifyBestOnly: notifyIndividual } = config;
this.config = {

@@ -34,3 +34,3 @@ size,

notification,
notifyIndividual
notifyBestOnly: notifyIndividual
};

@@ -69,4 +69,13 @@ }

this.log(`Stats: ${statsStr}`);
if (!this.config.notifyIndividual)
if (this.config.notifyBestOnly) {
const individual = this.generation.individuals[0];
const name = `${individual.name.first} ${individual.name.last}`;
const config = individual.entity;
const deviation = Math.abs(stats.mean - individual.fitness);
const fitness = individual.fitness;
const data = { fitness, deviation, config, name };
const json = chalk_1.default.green(JSON.stringify(data, null, 1));
this.log(`Individual: ${json}`);
return this.log('');
}
this.generation.individuals.forEach(individual => {

@@ -73,0 +82,0 @@ const name = `${individual.name.first} ${individual.name.last}`;

{
"name": "evjs",
"version": "0.2.1",
"version": "0.2.2",
"description": "Generic genetic/evolution algorithm in JS",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

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