@Override
protected Features extractFeatures(ParameterBlock parameters) {
IModel model = ModelFeatureExtractor.getModelRuntime(parameters);
Features features = new Features();
// Look up registry for all model feature extractors
List<FeatureExtractorFactory> featExtractFactories =
SimSystem.getRegistry().getFactories(FeatureExtractorFactory.class);
for (FeatureExtractorFactory featExtractFactory : featExtractFactories) {
// Test each if applicable to this model
if (featExtractFactory instanceof ModelFeatureExtractorFactory<?>
&& featExtractFactory.supportsParametersRuntime(parameters)) {
ModelFeatureExtractor<?> featureExtractor =
((ModelFeatureExtractorFactory<?>) featExtractFactory).create(null, SimSystem.getRegistry().createContext());
// If applicable, use it to generate features
features.putAll(featureExtractor.extractModelFeaturesRuntime(model));
}
}
return features;
}