diff --git a/cfg/userperspective.properties b/cfg/userperspective.properties new file mode 100644 index 0000000..3488ddc --- /dev/null +++ b/cfg/userperspective.properties @@ -0,0 +1,11 @@ +ANOMALIES_DETECTION=DBSCAN,KMEANS,XMEANS +CLASSIFICATION=FEED_FORWARD_A_N_N_DISTRIBUTION +CLIMATE=BIOCLIMATE_HSPEC,BIOCLIMATE_HCAF,BIOCLIMATE_HSPEN +CORRELATION_ANALYSIS=HRS +DATA_CLUSTERING=DBSCAN,KMEANS,XMEANS +FILTERING=HCAF_FILTER,HSPEN_FILTER +FUNCTION_SIMULATION=FEED_FORWARD_A_N_N_DISTRIBUTION +OCCURRENCES=ABSENCE_CELLS_FROM_AQUAMAPS,PRESENCE_CELLS_GENERATION,OCCURRENCES_MERGER,OCCURRENCES_INTERSECTOR,OCCURRENCES_MARINE_TERRESTRIAL,OCCURRENCES_DUPLICATES_DELETER,OCCURRENCES_SUBTRACTION +PERFORMANCES_EVALUATION=QUALITY_ANALYSIS,DISCREPANCY_ANALYSIS +SPECIES_SIMULATION=AQUAMAPS_SUITABLE,AQUAMAPS_NATIVE,AQUAMAPS_NATIVE_2050,AQUAMAPS_SUITABLE_2050,AQUAMAPS_NATIVE_NEURALNETWORK,AQUAMAPS_SUITABLE_NEURALNETWORK +TRAINING=HSPEN,AQUAMAPSNN,FEED_FORWARD_ANN \ No newline at end of file diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/configuration/AlgorithmConfiguration.java b/src/main/java/org/gcube/dataanalysis/ecoengine/configuration/AlgorithmConfiguration.java index 76ff549..70e0f09 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/configuration/AlgorithmConfiguration.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/configuration/AlgorithmConfiguration.java @@ -45,6 +45,7 @@ public class AlgorithmConfiguration extends LexicalEngineConfiguration implement public static String evaluatorsFile = "evaluators.properties"; public static String clusterersFile = "clusterers.properties"; public static String transducererFile = "transducerers.properties"; + public static String userperspectiveFile = "userperspective.properties"; public static String RapidMinerOperatorsFile = "operators.xml"; public static String StatisticalManagerService = "StatisticalManager"; public static String StatisticalManagerClass = "Services"; diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/processing/factories/ProcessorsFactory.java b/src/main/java/org/gcube/dataanalysis/ecoengine/processing/factories/ProcessorsFactory.java index d4d7ab7..0ae2f63 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/processing/factories/ProcessorsFactory.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/processing/factories/ProcessorsFactory.java @@ -1,8 +1,12 @@ package org.gcube.dataanalysis.ecoengine.processing.factories; +import java.io.BufferedReader; import java.io.File; +import java.io.FileReader; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Properties; @@ -162,6 +166,24 @@ public class ProcessorsFactory { return map; } + public static HashMap> getAllFeaturesUser(String configPath) throws Exception{ + + BufferedReader br = new BufferedReader(new FileReader(new File(configPath,AlgorithmConfiguration.userperspectiveFile))); + LinkedHashMap> map = new LinkedHashMap>(); + String line = br.readLine(); + while (line!=null){ + int eq = line.indexOf("="); + String key = line.substring(0,eq); + String values = line.substring(eq+1); + String [] algoNames = values.split(","); + List list = Arrays.asList(algoNames); + map.put(key, list); + line = br.readLine(); + } + br.close(); + return map; + } + //adds a generator to a sorted generators list public static void addAgent2List(List agents, ComputationalAgent agent){ if (agent == null) diff --git a/src/main/java/org/gcube/dataanalysis/ecoengine/test/TestsMetaInfo.java b/src/main/java/org/gcube/dataanalysis/ecoengine/test/TestsMetaInfo.java index ca725da..7253f69 100644 --- a/src/main/java/org/gcube/dataanalysis/ecoengine/test/TestsMetaInfo.java +++ b/src/main/java/org/gcube/dataanalysis/ecoengine/test/TestsMetaInfo.java @@ -2,14 +2,12 @@ package org.gcube.dataanalysis.ecoengine.test; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration; import org.gcube.dataanalysis.ecoengine.datatypes.StatisticalType; -import org.gcube.dataanalysis.ecoengine.interfaces.Clusterer; import org.gcube.dataanalysis.ecoengine.interfaces.ComputationalAgent; -import org.gcube.dataanalysis.ecoengine.interfaces.Evaluator; import org.gcube.dataanalysis.ecoengine.interfaces.Generator; -import org.gcube.dataanalysis.ecoengine.interfaces.Transducerer; import org.gcube.dataanalysis.ecoengine.processing.factories.ClusterersFactory; import org.gcube.dataanalysis.ecoengine.processing.factories.EvaluatorsFactory; import org.gcube.dataanalysis.ecoengine.processing.factories.GeneratorsFactory; @@ -99,6 +97,11 @@ public static void main(String[] args) throws Exception { String desc = ClusterersFactory.getDescription("./cfg/","DBSCAN"); System.out.println("DESCRIPTION: "+desc); + System.out.println("\n***TEST 20- Get USER perspective***"); + Map m = ProcessorsFactory.getAllFeaturesUser("./cfg/"); + System.out.println("USER PERSPECTIVE: "+m); + + int cores = Runtime.getRuntime().availableProcessors(); System.out.println("Number of cores: "+cores); }