Amiba-1.0

Rationale





Scope for Amiba-1.0





Future Enhancements





Something About The Design


The Framework and the Plug-ins


Amiba is designed as a rather generic framework accompanied by the most common plug-ins. This gives readymade all the common functionality while ensuring the freedom to implement your own specialized functionality. For example, a GeneGrammar represents a grammar for a gene. An implementation in the form of ScientificGrammar is provided. This implementation deals with the simple operations of a scientific calculator. You also have the freedom of implementing GeneGrammar for a completely different set of operators that may operate on objects other than numbers and that may have n number of operands.

This philosophy has been followed throughout. Generic behavior is defined through interfaces and abstract classes. The implementations of the most common use cases are bundled with this structure.


The choices made while using Amiba will be dictated by

  1. The problem domain. For example, what kind of grammar to use

  2. The problem itself. For example, the selection rate, the replication rate, population size etc.


Case 1: You are happy with the bundled grammars like ScientificGrammar and GraphGrammar

Many of the cases are expected to fall in this category. You only have to give method calls as shown in the example code. Just specify your configuration options in AmibaConfig.xml.


Case 2: You want to implement your own grammar

This takes a bit more effort. The new implementation is to be made available through abstract factory pattern. So you have to implement AmibaFactory and make sure it yields your implementation of FitnessCaseLoader and GeneGrammar.

You need to implement FitnessCaseLoader because how a fitness case is described depends on what kind of terminals you are going to use. You will need to define a structure for your fitness case and parse that structure through FitnessCaseLoader.load()

To implement GeneGrammar

Note that we are using visitor pattern for AST traversal. You don’t have to know JavaCC inside out. In fact, the ScientificParser.jjt file can be reused with minor modifications as long as you are dealing with a prefix grammar having operators and operands! That is the beauty of visitor pattern. The specific actions to be taken at each node go into the visitor implementation. You can have a look at the bundled implementations to understand this process better.