Difference between revisions of "How-to Implement Algorithms for the Statistical Manager"
From Gcube Wiki
Line 1: | Line 1: | ||
+ | =Prerequisites= | ||
+ | IDE: Eclipse Java EE IDE for Web Developers. Version: 3.7+ | ||
− | = | + | =Step by Step= |
+ | Let's start creating a project using the eclipse IDE that is mavenized. | ||
+ | After having mavenized the project in eclipse you have to put dependencies. | ||
+ | ====Step by Step==== | ||
+ | The maven artifact coordinates are: | ||
+ | <source lang="java"> | ||
+ | <dependency> | ||
+ | <groupId>org.gcube.dataanalysis</groupId> | ||
+ | <artifactId>ecological-engine</artifactId> | ||
+ | <version>1.6.1-SNAPSHOT</version> | ||
+ | </dependency> | ||
+ | </source> | ||
+ | Let's start creating a new call which implements basic algorithm; it will be executed by Statistical Manager. | ||
+ | Next step is to extend basic interface <code>StandardLocalExternalAlgorithm</code>. | ||
+ | The following snippet shows unimplemented interface methods that we are going to fulfill. | ||
+ | <source lang="java"> | ||
+ | public class SimpleAlgorithm extends StandardLocalExternalAlgorithm{ | ||
+ | |||
+ | @Override | ||
+ | public void init() throws Exception { | ||
+ | // TODO Auto-generated method stub | ||
+ | } | ||
+ | @Override | ||
+ | public String getDescription() { | ||
+ | // TODO Auto-generated method stub | ||
+ | return null; | ||
+ | } | ||
+ | @Override | ||
+ | protected void process() throws Exception { | ||
+ | // TODO Auto-generated method stub | ||
+ | |||
+ | } | ||
+ | @Override | ||
+ | protected void setInputParameters() { | ||
+ | // TODO Auto-generated method stub | ||
+ | |||
+ | } | ||
+ | @Override | ||
+ | public void shutdown() { | ||
+ | // TODO Auto-generated method stub | ||
+ | } | ||
+ | @Override | ||
+ | public StatisticalType getOutput() { | ||
+ | return null; | ||
+ | } | ||
+ | } | ||
+ | </source> |
Revision as of 10:15, 21 June 2013
Prerequisites
IDE: Eclipse Java EE IDE for Web Developers. Version: 3.7+
Step by Step
Let's start creating a project using the eclipse IDE that is mavenized. After having mavenized the project in eclipse you have to put dependencies.
Step by Step
The maven artifact coordinates are:
<dependency> <groupId>org.gcube.dataanalysis</groupId> <artifactId>ecological-engine</artifactId> <version>1.6.1-SNAPSHOT</version> </dependency>
Let's start creating a new call which implements basic algorithm; it will be executed by Statistical Manager.
Next step is to extend basic interface StandardLocalExternalAlgorithm
.
The following snippet shows unimplemented interface methods that we are going to fulfill.
public class SimpleAlgorithm extends StandardLocalExternalAlgorithm{ @Override public void init() throws Exception { // TODO Auto-generated method stub } @Override public String getDescription() { // TODO Auto-generated method stub return null; } @Override protected void process() throws Exception { // TODO Auto-generated method stub } @Override protected void setInputParameters() { // TODO Auto-generated method stub } @Override public void shutdown() { // TODO Auto-generated method stub } @Override public StatisticalType getOutput() { return null; } }