2012-08-29 11:52:18 +02:00
|
|
|
package org.gcube.dataanalysis.ecoengine.processing.factories;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
|
|
|
|
import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType;
|
|
|
|
import org.gcube.dataanalysis.ecoengine.interfaces.Clusterer;
|
2012-11-30 18:55:01 +01:00
|
|
|
import org.gcube.dataanalysis.ecoengine.interfaces.ComputationalAgent;
|
2012-08-29 11:52:18 +02:00
|
|
|
|
|
|
|
public class ClusterersFactory {
|
|
|
|
|
|
|
|
public static Clusterer getClusterer(AlgorithmConfiguration config) throws Exception {
|
2017-09-19 17:19:34 +02:00
|
|
|
Clusterer clus = (Clusterer) ProcessorsFactory.getProcessor(config, config.getConfigPath() + AlgorithmConfiguration.clusterersFile, config.getAlgorithmClassLoader());
|
2012-08-29 11:52:18 +02:00
|
|
|
return clus;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static List<String> getAllClusterers(String configPath) throws Exception {
|
|
|
|
List<String> cluss = ProcessorsFactory.getClasses(configPath + AlgorithmConfiguration.clusterersFile);
|
|
|
|
return cluss;
|
|
|
|
}
|
|
|
|
|
2017-09-19 17:19:34 +02:00
|
|
|
public static List<StatisticalType> getClustererParameters(String configPath, String algorithmName, AlgorithmConfiguration config) throws Exception {
|
|
|
|
List<StatisticalType> inputs = ProcessorsFactory.getParameters(configPath + AlgorithmConfiguration.clusterersFile, algorithmName, config.getAlgorithmClassLoader());
|
2012-08-29 11:52:18 +02:00
|
|
|
return inputs;
|
|
|
|
}
|
|
|
|
|
2017-09-19 17:19:34 +02:00
|
|
|
public static StatisticalType getClustererOutput(String configPath, String algorithmName, AlgorithmConfiguration config) throws Exception {
|
|
|
|
StatisticalType output = ProcessorsFactory.getOutputDescriptions(configPath + AlgorithmConfiguration.clusterersFile, algorithmName, config.getAlgorithmClassLoader());
|
2014-05-22 12:06:51 +02:00
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
2017-09-19 17:19:34 +02:00
|
|
|
public static String getDescription(String configPath, String algorithmName, AlgorithmConfiguration config) throws Exception{
|
|
|
|
String input = ProcessorsFactory.getDescription(configPath + AlgorithmConfiguration.clusterersFile, algorithmName, config.getAlgorithmClassLoader());
|
2012-09-27 11:07:45 +02:00
|
|
|
return input;
|
|
|
|
}
|
|
|
|
|
2012-11-30 18:55:01 +01:00
|
|
|
public static List<ComputationalAgent> getClusterers(AlgorithmConfiguration config) throws Exception {
|
|
|
|
List<ComputationalAgent> clusterers = new ArrayList<ComputationalAgent>();
|
2012-08-29 11:52:18 +02:00
|
|
|
clusterers.add(getClusterer(config));
|
2012-11-30 18:55:01 +01:00
|
|
|
ProcessorsFactory.addAgent2List(clusterers,GeneratorsFactory.getGenerator(config));
|
2012-08-29 11:52:18 +02:00
|
|
|
return clusterers;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|