How to use the ix.Enumerable function in ix

To help you get started, we’ve selected a few ix examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ThePrimeagen / neural-js / lib / evolution / lib / crossover.js View on Github external
function nPoint(selectorEnum) {
    var enu = selectorEnum.getEnumerator();

    return Ix.Enumerable.repeat(1)
        .select(function() {
            var a = next(enu);
            var b = next(enu);
            var l = a.length;
            var child = [];

            for (var i = 0; i < l; i++) {
                if (Math.random() > 0.499) {
                    child[i] = a[i];
                } else {
                    child[i] = b[i];
                }
            }

            return child;
        });
github ThePrimeagen / neural-js / lib / evolution / strategy_enumerables.js View on Github external
function populationEnumerator(basePopulation) {
    return Ix.Enumerable.repeat(1).select(function() {
        return basePopulation;
    });
}
github ThePrimeagen / neural-js / lib / evolution / lib / util.js View on Github external
function populationEnumerator(basePopulation) {
    return Ix.Enumerable.repeat(1).select(function() {
        return basePopulation;
    });
}
github marinels / webrx-react / src / Extensions / Object.ts View on Github external
function fallback(...values: T[]) {
  return Ix.Enumerable
    .fromArray(values)
    .where(x => x != null)
    .firstOrDefault();
}