<commit_before>/*
  Machine.js
  by <NAME>
  http://github.com/maryrosecook/machinejs

  Make behaviour trees in JavaScript.
  See index.html for an example.

  Uses Base.js by Dean Edwards.  Thanks, Dean.
*/

/*
  The tree generator.  Instantiate and then call generateTree(),
  passing the JSON definition of the tree and the object the tree controls.
*/
var Machine = Base.extend({
    constructor: function() { },

    // makes behaviour tree from passed json and returns the root node
    generateTree: function(treeJson, actor) {
        return this.read(treeJson, null, actor);
    },

    // reads in all nodes in passed json, constructing a tree of nodes as it goes
    read: function(subTreeJson, parent, actor) {
        var node = null;
        if(subTreeJson.pointer == true)
            node = new Pointer(subTreeJson.identifier, subTreeJson.test, subTreeJson.strategy, parent, actor);
        else
            node = new State(subTreeJson.identifier, subTreeJson.test, subTreeJson.strategy, parent, actor);

        node.report = subTreeJson.report;

        for(var i in subTreeJson.children)
            node.children[node.children.length] = this.read(subTreeJson.children[i], node, actor);

        return node;
    },
}, {
	getClassName: function() { return "Machine"; }

});

/*
  The object for nodes in the tree.
*/
var Node = Base.extend({
    identifier: null,
    test: null,
    strategy: null,
    parent: null,
    children: null,
    actor: null,
    report: null,

	constructor: function(identifier, test, strategy, parent, actor) {
        this.identifier = identifier;
        this.test = test;
        this.strategy = strategy;
        this.parent = parent;
        this.actor = actor;
        this.children = [];
	},

    // a tick of the clock.  Called every time
    tick: function() {<commit_msg>removed reference to the Slut<commit_after>/*
  Machine.js
  by <NAME>
  http://github.com/maryrosecook/machinejs

  Make behaviour trees in JavaScript.
  See index.html for an example.

  Uses Base.js by <NAME>.  Thanks, Dean.
*/

/*
  The tree generator.  Instantiate and then call generateTree(),
  passing the JSON definition of the tree and the object the tree controls.
*/
var Machine = Base.extend({
    constructor: function() { },

    // makes behaviour tree from passed json and returns the root node
    generateTree: function(treeJson, actor) {
        return this.read(treeJson, null, actor);
    },

    // reads in all nodes in passed json, constructing a tree of nodes as it goes
    read: function(subTreeJson, parent, actor) {
        var node = null;
        if(subTreeJson.pointer == true)
            node = new Pointer(subTreeJson.identifier, subTreeJson.test, subTreeJson.strategy, parent, actor);
        else
            node = new State(subTreeJson.identifier, subTreeJson.test, subTreeJson.strategy, parent, actor);

        node.report = subTreeJson.report;

        for(var i in subTreeJson.children)
            node.children[node.children.length] = this.read(subTreeJson.children[i], node, actor);

        return node;
    },
}, {
	getClassName: function() { return "Machine"; }

});

/*
  The object for nodes in the tree.
*/
var Node = Base.extend({
    identifier: null,
    test: null,
    strategy: null,
    parent: null,
    children: null,
    actor: null,
    report: null,

    constructor: function(identifier, test, strategy, parent, actor) {
        this.identifier = identifier;
        this.test = test;
        this.strategy = strategy;
        this.parent = parent;
        this.actor = actor;
        this.children = [];
    },

    // a tick of the clock.  Called every time
    tick: function() {
{'fraction_non_alphanumeric': 0.10592069527430745, 'fraction_numerical': 0.0, 'mean_word_length': 2.6465346534653467, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '2786877', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1048, 'n_words': 347}