com.rubecula.darwin.startup
Class Darwin

java.lang.Object
  extended by com.rubecula.darwin.startup.Darwin
Direct Known Subclasses:
TravelingSalesman

public class Darwin
extends java.lang.Object

Class to start up a Darwin application (not an applet).

The syntax of the command line parameters is:

 Darwin[-d][-gN][configurationfilename]
 
The configuration filename should be specified as a full path name in the following form: /C:/.../../file.xml (yes, you can use the forward slashes on Windows). If you do not start the filename with a "/" character, the system will look for the configuration file in the com.rubecula.darwin.startup package under the /src/main/resoure/ source folder. This is useful for running demo programs provided by Darwin contributors. Currently, there are only two such demos, called outOfTheBox.xml (the default demo if you don't specify a configuration file at all) and travelingSalesman.xml. There are two other optional parameters:

-d
(which sets debug mode)
-gN
where N is the maximum number of generations you'd like to run (by default it will run forever, or until some other condition terminates it).

Note that this class is designed for use with the BeanPot as the bean container. However, by changing the class BeanContainer, and making some other relatively minor changes in this class, it should be possible to use Spring or some other bean container instead.

Author:
Robin Hillyard

Nested Class Summary
static class Darwin.DarwinClassLoader
          Darwin's own class loader.
 
Field Summary
protected static java.lang.String CONFIG_OUT_OF_THE_BOX
           
protected static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
Darwin()
           
 
Method Summary
protected  void configureAndRunEvolution(int maxGenerations, boolean debug, java.lang.String configurationFile)
           
protected  void doMain(java.lang.String[] args)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIG_OUT_OF_THE_BOX

protected static final java.lang.String CONFIG_OUT_OF_THE_BOX
See Also:
Constant Field Values

LOG

protected static final org.apache.commons.logging.Log LOG
Constructor Detail

Darwin

public Darwin()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

configureAndRunEvolution

protected void configureAndRunEvolution(int maxGenerations,
                                        boolean debug,
                                        java.lang.String configurationFile)
                                 throws com.rubecula.beanpot.BeanPotException
Parameters:
maxGenerations -
debug -
configurationFile -
Throws:
com.rubecula.beanpot.BeanPotException

doMain

protected void doMain(java.lang.String[] args)
Parameters:
args -


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.