private TimePointStats executeTimePoint(TimePoint timePoint) { List<ProgramData> programDataList = data.prepareProgramDataList(timePoint); if (programDataList.isEmpty()) return null; Debug.d("Starting TimePoint:", timePoint); TimePointResult timePointResult = timePointExecutor.execute( timePoint, programDataList, population, !engineSettings.executionOnly); TimePointStats timePointStats = TimePointStats.getNewStats(timePoint); for (DataSetResult dataSetResult : timePointResult.listDataSetResults()) { Prediction prediction = dataSetResult.getCumulativePrediction(); Debug.d("Prediction for:", dataSetResult.getName(), prediction); Double actualChange = data.getActualChange(dataSetResult.getName(), timePoint); if (!actualChange.isNaN()) { Debug.d("Actual change:", actualChange); printPercentEarned(dataSetResult.getName(), actualChange, prediction); timePointStats.update(dataSetResult.getName(), actualChange, prediction); } } if (!engineSettings.executionOnly) { updatePopulation(); } Debug.d("Finished TimePoint:", timePoint); return timePointStats; }
private void initPopulation() { if (population.getSize() == 0 && !engineSettings.executionOnly) breeder.breedPopulation(population, timePointExecutor.getProgramInfos()); }
private void updatePopulation() { List<ProgramInfo> list = timePointExecutor.getProgramInfos(); killer.killPrograms(population, list); breeder.breedPopulation(population, list); }