<commit_before>#!/usr/bin/env node

bst = require('./bst');
rbt = require('./rbt');
heaptree = require('./heaptree');
heaparray = require('./heaparray');
tasks = require('./tasks');
sched = require('./scheduler');

// Using timeline for the timeline tree structure, generate a task
// queue for each of size 2^pow1 to 2^pow2 and do runScheduler and
// generate a report for each run.
function run_tasks (pow1, pow2, timeline) {
    for (var i=pow1; i<=pow2; i++) {
        var num_tasks = Math.pow(2,i);
        var taskdata = tasks.generateTasks(num_tasks, 10);

        // Run the CFS algorithm and generate a results report
        var results = sched.runScheduler(taskdata, timeline);

        sched.generate_report(taskdata, results);
        console.log("\n");
    }
}

function usage() {
    console.log("node run_tasks.js [bst|rbt|heaptree|heaparray] START_FACTOR END_FACTOR");
    process.exit(2);
}

if (process.argv.length < 5) {
    usage();
}

function vsort(a,b) {
    return a.val.vruntime - b.val.vruntime;
}
<commit_msg>Fix generateTasks call in run_tasks.js<commit_after>#!/usr/bin/env node

bst = require('./bst');
rbt = require('./rbt');
heaptree = require('./heaptree');
heaparray = require('./heaparray');
tasks = require('./tasks');
sched = require('./scheduler');

// Using timeline for the timeline tree structure, generate a task
// queue for each of size 2^pow1 to 2^pow2 and do runScheduler and
// generate a report for each run.
function run_tasks (pow1, pow2, timeline) {
    for (var i=pow1; i<=pow2; i++) {
        var num_tasks = Math.pow(2,i);
        var taskdata = tasks.generateTasks(num_tasks, 1, 10);

        // Run the CFS algorithm and generate a results report
        var results = sched.runScheduler(taskdata, timeline);

        sched.generate_report(taskdata, results);
        console.log("\n");
    }
}

function usage() {
    console.log("node run_tasks.js [bst|rbt|heaptree|heaparray] START_FACTOR END_FACTOR");
    process.exit(2);
}

if (process.argv.length < 5) {
    usage();
}

function vsort(a,b) {
    return a.val.vruntime - b.val.vruntime;
}

{'fraction_non_alphanumeric': 0.1493815413891532, 'fraction_numerical': 0.012844909609895337, 'mean_word_length': 3.3903966597077244, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1719160', 'n_tokens_mistral': 705, 'n_tokens_neox': 677, 'n_words': 189}