public static void main(String args[])
{
BasicNetwork network = createNetwork();
MLTrain train;
if( args.length>0 && args[0].equalsIgnoreCase("anneal"))
{
train = new NeuralSimulatedAnnealing(
network, new PilotScore(), 10, 2, 100);
}
else
{
train = new NeuralGeneticAlgorithm(
network, new FanInRandomizer(),
new PilotScore(),500, 0.1, 0.25);
}
int epoch = 1;
for(int i=0;i<50;i++) {
train.iteration();
System.out
.println("Epoch #" + epoch + " Score:" + train.getError());
epoch++;
}
System.out.println("\nHow the winning network landed:");
network = (BasicNetwork)train.getMethod();
NeuralPilot pilot = new NeuralPilot(network,true);
System.out.println(pilot.scorePilot());
Encog.getInstance().shutdown();
}