Genetic Algorithm Specification
This document contains the API specification for the JAVA and C++
based Genetic Algorithm packages that are a part of OpenAI.
Persistence and Transmissibility
- Each class must be XML-able. Each class at the API
level must have the ability to be initialized via an
XML-style character stream. Each class at the API level
must have the ability to write out its state into an
XML-style character stream. This XML'ed data must contain
all relevant information to reconstructing a copy of the
original object. The format of the stream written must be
compatibile with the XML format of the initialization
stream. All implementing languages' (currently JAVA and
C++) XML format must be compatibile. An optional tag
specifying the language and version must be handled by the
class being initialized. Initially, this will most likely be
ignored, but will be utilized with future releases to ensure
backwards-compatibility. Ideally, this would be in only the
top-level encapsulating initialization structure within the
XML to reduce redundant data (and some network
bandwidth). The writing of this tag by a particular class
should be done from the time of the first full release. The
format of this tag is still TBD.
- Each class may optionally (but is strongly encouraged
to) implement a method to save/transmit its state and
re-initialize from this saved/transmitted state in a
"native" form. The goal here is to have a more optimal mode
of transmission for "migrating" an object from one machine
to another and take up less disk space as a persistent
object but using the same version and language of the
transmitted/persistent object. Later versions of these
packages will extend this functionality to allow
cross-language/version/platform exploits of this "native"
communication. For JAVA, this may be a serialized instance
of the class, but it would be preferred to have both
serialization available and a stream that could be used for
other languages.
Extensibility
- All functionality that may vary by implementation must
have the ability to be overridden. b.A default behavior
should be supplied that is either the most common
implementation or the simplest implementation.
Thread safe (MT-safe)
- There must be an MT-safe version of all
classes/methods/functions available at the API level. From
the view of the application developer using these packages,
all function/method calls must be able to be treated as
though they are atomic. It will be allowed, however, to have
two implementations of a particular class/method/function -
one that is MT-safe and one that is not for the purposes of
speed within a single-threaded process/application. At the
time of this writing, we will leave this up the developers
of the packages to determine at what level the separation
between MT-safe and speed-optimized code will be made.
Language-specific features
- JAVA "Core" classes must be in the package
net.openai.ai.ga. Events must be in the package
net.openai.ai.ga.event. Listeners and Adapters must be in
the package net.openai.ai.ga.event. All classes must
implement the Serializable interface.
- C++ "Core" classes must be in the namespace
openai::ai::ga. Events must be in the namespace
openai::ai::ga::event. Listeners and Adapters must be in
the namespace openai::ai::ga::event.