public void setTraining(EngineIndexableSet training) {
this.training = training;
this.trainingLength = (int) this.training.getRecordCount();
final EngineData pair = BasicEngineData.createPair(
flat.getInputCount(), flat.getOutputCount());
this.inputArray = new float[training.getInputSize() * this.trainingLength];
this.idealArray = new float[training.getIdealSize() * this.trainingLength];
int inputIndex = 0;
int idealIndex = 0;
for (int i = 0; i < this.trainingLength; i++) {
training.getRecord(i, pair);
for (int col = 0; col < flat.getInputCount(); col++) {
this.inputArray[inputIndex++] = (float) pair.getInputArray()[col];
}
for (int col = 0; col < flat.getOutputCount(); col++) {
this.idealArray[idealIndex++] = (float) pair.getIdealArray()[col];
}
}
final int errorSize = (int) training.getRecordCount();
this.errors = new float[errorSize];