public static AutomatonSimulator getSimulator(Automaton automaton) {
		if (automaton instanceof automata.fsa.FiniteStateAutomaton)
			return new automata.fsa.FSAStepWithClosureSimulator(automaton);
		else if (automaton instanceof automata.pda.PushdownAutomaton)
			return new automata.pda.PDAStepWithClosureSimulator(automaton);
		else if (automaton instanceof automata.turing.TuringMachine)
			return new automata.turing.TMSimulator(automaton);
        /*
         * Check for Moore must take place before check for Mealy because Moore
         * is a subclass of Mealy.
         */
        else if(automaton instanceof automata.mealy.MooreMachine)
            return new automata.mealy.MooreStepByStateSimulator(automaton);
        else if(automaton instanceof automata.mealy.MealyMachine)
            return new automata.mealy.MealyStepByStateSimulator(automaton);
		return null;
	}