code: function AwesomeAutomata(config) {
    var _this = this;
    config = config || {};
  
    // Extend the event emitter interface
    EventEmitter.call(this);
  
    // Use an instance method to make it easier to mock for testing
    this._ = require('lodash');
  
    this.name = config.name; // Helpful for debugging purposes
  
    // Set a max history to store for circular diagrams that may never terminate/
    // reset to prevent a massive memory buildup
    this._maxHistory = config.maxHistory;
  
    // Whenever the initial state is reached, reset the history
    this._resetAtRoot = config.resetAtRoot;
  
    /**
     * States are stored in a hash for fast reference and duplicate checks
     */
    this._states = {};
  
    // Keep track of the starting point which leads to all other nodes in the
    // graph
    this._rootNode = null;
  
    this._previousState = null;
    this._currentState = null;
    this._previouslyVisitedStates = [];
  
    // DEBUGGING
  
    this.debug = function () {}; // No-op for default debugger
  
    if (!config.debug) {
      return this;
    }
  
    // Allow for custom debugging methods
    if (typeof config.debug === 'function') {
      this.debug = config.debug;
      return this;
    }
  
    // Provide a wrapper around console.log()
    this.debug = function debug () {
      var args = arguments.slice(); // Copy args
      args.unshift('[AwesomeAutomata:' + _this.name + ']');
  
      console.log.apply(console, args);
    };
  }
docs: A
  
  Note: Throws exceptions for an invalid initial configuration of the machine.
  If the machine is based off of dynamic input, the caller is responsible for
  building the necessary validation (or try/catch logic) to successfully build
  the state machine.
  
  Events:
  * `error` - Fired for runtime errors that affect a particular state (like
  invalid or no outbound transitions)
  * `reset` - Emitted whenever the machine is reset to its initial state, either
  after an error or after a terminal state
  * `return` - Returns a value based on the accepting state's accept method.
  Fired whenever the state machine enters an accepting state.
  * `change` - Marks a transition between states