Extending Avrora with a New Action

Avrora has a class called avrora.Main which is the main entrypoint into Avrora. It parses options and then passes control and command line arguments to the specified action. Actions are represented as descendants of the avrora.actions.Action class. By creating a new class that extends this class, you can program new behavior for Avrora without modifying any of Avrora's code. Your action can have its own set of command line options, can load programs, create simulations, analyze the program's code, or anything that you program it to do.

Here's an example action:

You can run your action by simply specifying the name of your class in the -action option. Assuming your classpath is set correctly to include your class, you can run your action by this command:

From there, you can load programs, create simulators, instrument programs, run simulations, analyze the control flow graph of a program, etc. For inspiration, look at the source code existing actions to see the possibilities and read the JavaDoc API. Of course, once your action is stable and well documented, you can ask that it be included in the base distribution of Avrora and be available as one of the available actions.