Revised 2006-09-03 DMB

Return to the Index  |  The Events File  |  The Analyze File


List of Actions

Action Categories

There is a large library of actions available for scheduling as events. Additionally, all of these actions can be used within analyze scripts. Below you will find a listing of the high level groupings of these actions, along with detailed sections for each them.

Print
Print actions are the primary way of saving data from an Avida experiments.
Population
Population actions modify the state of the population, and will actually change the course of the run.
Environment
Actions that allow user to change properties of the environment, including resources.
Save and Load
Actions that allow for saving and loading large data sets, such as full populations.
Landscape Analysis
Actions that use data from the current state of Avida, process it and then output the results.
Driver
Actions that allow user to control program execution, including experiment termination.

For a brief overview of writing a new action, please see Creating an Action below.

 

Alphabetical Listing of Available Actions

AnalyzeLandscape
AnalyzePopulation
CompeteDemes
ConnectCells
CopyDeme
DeletionLandscape
DisconnectCells
DumpDonorGrid
DumpFitnessGrid
DumpGenotypeIDGrid
DumpMemory
DumpPopulation
DumpReceiverGrid
DumpTaskGrid
Echo
Exit
ExitAveLineageLabelGreater
ExitAveLineageLabelLess
FullLandscape
HillClimb
Inject
InjectAll
InjectParasite
InjectRandom
InjectRange
InjectResource
InjectScaledResource
InjectSequence
InsertionLandscape
JoinGridCol
JoinGridRow
KillProb
KillRate
KillRectangle
LoadClone
LoadPopulation
ModMutProb
OutflowScaledResource
PairTestLandscape
PrecalcLandscape
PredictNuLandscape
PredictWLandscape
PrintAverageData
PrintCCladeCounts
PrintCCladeFitnessHistogram
PrintCCladeRelativeFitnessHistogram
PrintCountData
PrintData
PrintDebug
PrintDemeStats
PrintDepthHistogram
PrintDetailedFitnessData
PrintDivideMutData
PrintDominantData
PrintDominantGenotype
PrintDominantParaData
PrintDominantParasiteGenotype
PrintErrorData
PrintGeneticDistanceData
PrintGenomicSiteEntropy
PrintGenotypeAbundanceHistogram
PrintGenotypeMap
PrintGenotypes
PrintInstructionAbundanceHistogram
PrintInstructionData
PrintLineageCounts
PrintLineageTotals
PrintLogFitnessHistogram
PrintMutationRateData
PrintPhenotypeData
PrintPhenotypeStatus
PrintPhenotypicPlasticity
PrintPopulationDistanceData
PrintRelativeFitnessHistogram
PrintResourceData
PrintSpeciesAbundanceData
PrintStatsData
PrintTasksSnapshot
PrintTasksExeData
PrintTasksQualData
PrintTimeData
PrintTotalsData
PrintTreeDepths
PrintVarianceData
PrintViableTasksData
RandomLandscape
ResetDemes
SampleLandscape
SaveClone
SaveHistoricPopulation
SaveHistoricSexPopulation
SaveParasitePopulation
SavePopulation
SaveSexPopulation
SerialTransfer
SetMutProb
SetReactionInst
SetReactionValue
SetReactionValueMult
SetResource
SetVerbose
SeverGridCol
SeverGridRow
TestDominant
ZeroMuts

 

Print Actions

Output events are the primary way of saving data from an Avida experiments. The main two types are continuous output, which append to a single file every time the event is trigged, and singular output, which produce a single, complete file for each trigger.

 

Population Actions

Population events modify the state of the population, and will actually change the course of the run. There are a wide variety of these.

 

Environment Actions

Events that allow user to change environment properties, such as resources and reaction parameters.

 

Save Load Actions

 

Landscape Analysis Actions

Landscape analysis actions perform various types mutation studies to calculate properties of the fitness landscape for a particular genome. When scheduled as an event during a run, these actions will typically perform analysis on the dominant genotype. In analyze mode, analysis is performed on the entire currently selected batch.

These actions are often very computationally intensive, thus will take a long time to compute. In order to take advantage of increasingly available multi-processor/multi-core systems, a number of these actions have been enhanced to make use of multiple threads to parallize work. Set the configuration setting MT_CONCURRENCY to the number of logical processors available to make use of all processor resources for these compuations.

 

Driver Actions

These actions control the driver object responsible for executing the current run.

 

Creating an Action

The action source code is contained in the source/action directory. Each of the individual action categories has its own source code files (e.g. Landcape Actions are located in the LandscapeActions files).

Each action is derrived from the cAction class. Briefly, to get an action to work you must create a child class that has a Process and GetDescription function defined as well as a constructor. You must also register this new class with the action library.

So, with that quick review of what must be done, here is a step by step guide to creating an action:

  1. Identify which of the action categories your action should be assigned to. There are six different action categories described above. Each category has a similar means of creating a new action, but do note that some action commands are generated via macros defined at the top of the files. For instance, in the PrintActions file, you will notice a number of STATS_OUT_FILE macros being used to generate rather repetitively coded standard output files. 

  2. Create a new class in the file that follows proper naming conventions. Any class should begin with "cAction" and be followed by the name of the action command you will register with the library. For instance, if we were to create a new command "MyAction", we'd name the class cActionMyAction. Below is a stub for this new action class:

    class cActionMyAction : public cAction
    {
    	private:
    		// Private data members for this action
    	public:
    		cActionMyAction(cWorld* world, const cString& args) : cAction(world, args) { ; }
    		
    		static const cString GetDescription() { return "Arguments: My Arguments"; }
    		
    		void Process(cAvidaContext& ctx)
    		{
    			//Perform whatever processing is needed when the action is triggered.
    		}
    };
    

  3. Define the private data members, constructor, description string in GetDescription, and the Process function. Any arguments that you specify after the action name in the events configuration will be passed to your new class via the args argument in the constructor.

  4. Register the new action with the action library. At the bottom of each action definitions file, there are the commands that register the individual actions with the action library. In the PrintActions.cc file, for instance, this function is called RegisterPrintActions.

    To register our example action "MyAction", we'd write:

    action_lib->Register<cActionMyAction>("MyAction");

  5. Test your action.


Return to the Index  |  The Events File  |  The Analyze File