noncompiled/models/universe/Universe.js
// the function will not generate more than a given number of samples per cycle
the function will not generate more than a given number of samples per cycle
the function will not generate more than a given number of samples per cycle
function samples(config, max_sample_count, min_perceivable_period) {
        var imperceptably_small_cycles = Object.values(cycles)
            .filter(cycle => {
                return (cycle !== void 0 &&
                        cycle.motion.period() < min_perceivable_period &&
                       !cycle.invariant_insolation);
            })
            .sort((a,b) => a.motion.period() - b.motion.period())
            .reverse();
        var samples_per_cycle = Math.floor(Math.pow(max_sample_count, 1/imperceptably_small_cycles.length));
        var samples = [Object.assign({}, config)];
        for(var cycle of imperceptably_small_cycles) {
            var period = cycle.motion.period();
            var subsamples = [];
            for (var sample of samples) {
                for (var j = 0; j < samples_per_cycle; j++) {
                    subsamples.push(advance(sample, j*period/samples_per_cycle, {}, 1));
                }
            }
            samples = subsamples;
        }
        return samples;
    }
function samples ( config , max_sample_count , min_perceivable_period ) { var imperceptably_small_cycles = Object . values ( cycles ) . filter ( cycle => { return ( cycle !== void 0 && cycle . motion . period ( ) < min_perceivable_period && ! cycle . invariant_insolation ) ; } ) . sort ( ( a , b ) => a . motion . period ( ) - b . motion . period ( ) ) . reverse ( ) ; var samples_per_cycle = Math . floor ( Math . pow ( max_sample_count , 1 / imperceptably_small_cycles . length ) ) ; var samples = [ Object . assign ( { } , config ) ] ; for ( var cycle of imperceptably_small_cycles ) { var period = cycle . motion . period ( ) ; var subsamples = [ ] ; for ( var sample of samples ) { for ( var j = 0 ; j < samples_per_cycle ; j ++ ) { subsamples . push ( advance ( sample , j * period / samples_per_cycle , { } , 1 ) ) ; } } samples = subsamples ; } return samples ; }
the function will not generate more than a given number of samples per cycle
the function will not generate more than a given number of samples per cycle
// if the cycle takes more than a given amount to complete,  // then don't sample across it // figure out how many samples you can allocate to each cycle without compromising performance. // Round down to the nearest whole number. // we return a list of configs to sample across, starting with a clone of `config` // for each imperceptably small cycle: // sample across the cycle's period and add results to `samples`