This commit is contained in:
Gianpaolo Coro 2012-06-01 08:40:34 +00:00
parent 1854ca9591
commit 7b7b4e94e2
18 changed files with 47 additions and 32 deletions

View File

@ -200,8 +200,8 @@ public class DiscrepancyAnalysis extends DataAnalysis {
}
@Override
public String getContentType() {
return HashMap.class.getName();
public VARTYPE getContentType() {
return VARTYPE.MAP;
}
@Override

View File

@ -324,8 +324,8 @@ public class DistributionQualityAnalysis extends DataAnalysis {
@Override
public String getContentType() {
return HashMap.class.getName();
public VARTYPE getContentType() {
return VARTYPE.MAP;
}
@Override

View File

@ -315,8 +315,8 @@ public class HabitatRepresentativeness extends DataAnalysis {
}
@Override
public String getContentType() {
return HashMap.class.getName();
public VARTYPE getContentType() {
return VARTYPE.MAP;
}
@Override

View File

@ -3,6 +3,7 @@ package org.gcube.dataanalysis.ecoengine.interfaces;
import java.util.HashMap;
import org.gcube.dataanalysis.ecoengine.configuration.WEIGHT;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public interface ComputationalAgent {
@ -20,7 +21,7 @@ public interface ComputationalAgent {
public WEIGHT getWeight();
// gets the type of the content inside the generator: String, File, HashMap.
public String getContentType();
public VARTYPE getContentType();
// gets the content of the model: e.g. Table indications etc.
public Object getContent();

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public interface Model {
@ -43,7 +44,7 @@ public interface Model {
public void stop();
public String getContentType();
public VARTYPE getContentType();
public Object getContent();
}

View File

@ -3,6 +3,7 @@ package org.gcube.dataanalysis.ecoengine.interfaces;
import java.util.HashMap;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public interface SpatialProbabilityDistribution {
@ -19,7 +20,7 @@ public interface SpatialProbabilityDistribution {
//set the input parameters for this generator
public HashMap<String, VarCouple> getInputParameters();
public String getContentType();
public VARTYPE getContentType();
public Object getContent();

View File

@ -7,6 +7,7 @@ import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.configuration.WEIGHT;
import org.gcube.dataanalysis.ecoengine.interfaces.Model;
import org.gcube.dataanalysis.ecoengine.interfaces.Modeler;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public class SimpleModeler implements Modeler{
@ -72,7 +73,7 @@ public class SimpleModeler implements Modeler{
return WEIGHT.LOWEST;
}
public String getContentType() {
public VARTYPE getContentType() {
return innermodel.getContentType();
}

View File

@ -182,8 +182,8 @@ public class ModelAquamapsNN implements Model {
status = 100f;
}
public String getContentType() {
return File.class.getName();
public VARTYPE getContentType() {
return VARTYPE.FILE;
}
public Object getContent() {

View File

@ -187,8 +187,8 @@ public class ModelAquamapsNNNS implements Model {
status = 100f;
}
public String getContentType() {
return String.class.getName();
public VARTYPE getContentType() {
return VARTYPE.FILE;
}
public Object getContent() {

View File

@ -335,8 +335,8 @@ public class ModelHSPEN implements Model {
// take ending time
}
public String getContentType() {
return String.class.getName();
public VARTYPE getContentType() {
return VARTYPE.HSPEN;
}
public Object getContent() {

View File

@ -19,6 +19,7 @@ import org.gcube.dataanalysis.ecoengine.connectors.livemonitor.ResourceLoad;
import org.gcube.dataanalysis.ecoengine.connectors.livemonitor.Resources;
import org.gcube.dataanalysis.ecoengine.interfaces.Generator;
import org.gcube.dataanalysis.ecoengine.interfaces.SpatialProbabilityDistributionGeneric;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public class LocalSimpleSplitGenerator implements Generator {
@ -337,7 +338,7 @@ public class LocalSimpleSplitGenerator implements Generator {
}
@Override
public String getContentType() {
public VARTYPE getContentType() {
return distributionModel.getContentType();
}

View File

@ -22,6 +22,7 @@ import org.gcube.dataanalysis.ecoengine.connectors.livemonitor.Resources;
import org.gcube.dataanalysis.ecoengine.interfaces.Generator;
import org.gcube.dataanalysis.ecoengine.interfaces.SpatialProbabilityDistributionTable;
import org.gcube.dataanalysis.ecoengine.utils.DatabaseFactory;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
import org.hibernate.SessionFactory;
@ -496,8 +497,8 @@ public class LocalSplitGenerator implements Generator {
}
@Override
public String getContentType() {
return String.class.getName();
public VARTYPE getContentType() {
return distributionModel.getContentType();
}
@Override

View File

@ -196,8 +196,8 @@ public class RainyCloudGenerator implements Generator {
}
@Override
public String getContentType() {
return String.class.getName();
public VARTYPE getContentType() {
return VARTYPE.HSPEC;
}
@Override

View File

@ -206,10 +206,10 @@ public class AquamapsSuitable implements SpatialProbabilityDistributionTable{
@Override
public HashMap<String, VarCouple> getInputParameters() {
HashMap<String, VarCouple> parameters = new HashMap<String,VarCouple>();
parameters.put("EnvelopeTable", new VarCouple(VARTYPE.STRING,"hspen"));
parameters.put("CsquarecodesTable", new VarCouple(VARTYPE.STRING,"hcaf_d"));
parameters.put("EnvelopeTable", new VarCouple(VARTYPE.HSPEN,"hspen"));
parameters.put("CsquarecodesTable", new VarCouple(VARTYPE.HCAF,"hcaf_d"));
parameters.put("DistributionTable", new VarCouple(VARTYPE.RANDOM,"hspec_"));
parameters.put("PreprocessedTable", new VarCouple(VARTYPE.STRING,"maxminlat_hspen"));
parameters.put("PreprocessedTable", new VarCouple(VARTYPE.MINMAXLAT,"maxminlat_hspen"));
parameters.put("CreateTable", new VarCouple(VARTYPE.STRING,"true"));
parameters.put("DatabaseUserName",new VarCouple(VARTYPE.DATABASEUSERNAME,""));
parameters.put("DatabasePassword",new VarCouple(VARTYPE.DATABASEPASSWORD,""));
@ -220,8 +220,8 @@ public class AquamapsSuitable implements SpatialProbabilityDistributionTable{
}
@Override
public String getContentType() {
return String.class.getName();
public VARTYPE getContentType() {
return VARTYPE.HSPEC;
}
@Override

View File

@ -14,6 +14,7 @@ import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.interfaces.SpatialProbabilityDistributionGeneric;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public class DummyAlgorithm implements SpatialProbabilityDistributionGeneric{
@ -197,8 +198,8 @@ public class DummyAlgorithm implements SpatialProbabilityDistributionGeneric{
}
@Override
public String getContentType() {
return File.class.getName();
public VARTYPE getContentType() {
return VARTYPE.FILE;
}
@Override

View File

@ -14,6 +14,7 @@ import org.gcube.contentmanagement.lexicalmatcher.utils.AnalysisLogger;
import org.gcube.dataanalysis.ecoengine.configuration.ALG_PROPS;
import org.gcube.dataanalysis.ecoengine.configuration.AlgorithmConfiguration;
import org.gcube.dataanalysis.ecoengine.interfaces.SpatialProbabilityDistributionGeneric;
import org.gcube.dataanalysis.ecoengine.utils.VARTYPE;
import org.gcube.dataanalysis.ecoengine.utils.VarCouple;
public class TestAlgorithm implements SpatialProbabilityDistributionGeneric{
@ -144,8 +145,8 @@ public class TestAlgorithm implements SpatialProbabilityDistributionGeneric{
}
@Override
public String getContentType() {
return File.class.getName();
public VARTYPE getContentType() {
return VARTYPE.FILE;
}
@Override

View File

@ -112,7 +112,7 @@ public static void main(String[] args) throws Exception {
config.setParam("DistributionTable","hspec_suitable_test_gp");
config.setParam("CsquarecodesTable","hcaf_d");
config.setParam("EnvelopeTable","hspen");
config.setParam("EnvelopeTable","hspen_micro");
config.setParam("PreprocessedTable", "maxminlat_hspen");
config.setParam("CreateTable","true");

View File

@ -10,5 +10,12 @@ public enum VARTYPE {
DATABASEDRIVER,
DATABASEDIALECT,
CONSTANT,
RANDOM
RANDOM,
HSPEN,
HCAF,
HSPEC,
OCCURRENCE,
MINMAXLAT,
FILE,
MAP
}