In AutoAnalyser switching to store calculator as its actual class rather than superclass, since otherwise you can't access features like analytic surrogates without casting to the correct interface.

This commit is contained in:
jlizier 2017-08-29 15:08:50 +10:00
parent 1f236dee49
commit bba00f07fc
1 changed files with 5 additions and 1 deletions

View File

@ -958,7 +958,11 @@ public abstract class AutoAnalyser extends JFrame
} else {
// Construct the calculator:
// 1. Java
javaCode.append(" " + abstractContinuousClass.getSimpleName() + " calc;\n");
// If we wanted to create as superclass:
// javaCode.append(" " + abstractContinuousClass.getSimpleName() + " calc;\n");
// But that gives problems when we use interfaces such as AnalyticNullDistributionComputer,
// so we'll store it as the instantiated class:
javaCode.append(" " + calcContinuous.getClass().getSimpleName() + " calc;\n");
javaCode.append(javaConstructorLine);
// 2. Python
pythonCode.append(pythonPreConstructorLine);