Permalink
Browse files

Clean up

  • Loading branch information...
tzaeschke committed Dec 11, 2018
1 parent 028fe14 commit 24099698394b3ce8f1be62cce5ea399a0db6c204
Showing with 63 additions and 35 deletions.
  1. +3 −0 README.md
  2. +1 −6 pom.xml
  3. +59 −29 src/main/java/ch/ethz/globis/tinspin/Example.java
@@ -8,6 +8,9 @@ TinSpin provides several dataset generators for point data and rectangle data. T

The framework was originally developed at ETH Zurich in the GlobIS group. It is now maintained by Tilmann Zäschke.

If you want to reference this project, please consider referencing the [PH-Tree](http://www.phtree.org) instead, as TinSpin was originally developed to benchmark the PH-Tree and because there is currently no TinSpin publication: _The PH-tree: A Space-Efficient Storage Structure and Multi-Dimensional Index, T. Zäschke, C. Zimmerli and M.C. Norrie, Proc. of the 2014 ACM SIGMOD Intl. Conf. on Management of Data._


# Changelog

2018-12:
@@ -65,12 +65,7 @@
<artifactId>tinspin-indexes</artifactId>
<version>[1.7,)</version>
</dependency>
<!-- <dependency>
<groupId>org.tinspin</groupId>
<artifactId>tinspin-third-party-impl</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
--> </dependencies>
</dependencies>

<build>
<plugins>
@@ -8,12 +8,52 @@

import java.io.Serializable;

import ch.ethz.globis.tinspin.TestInstances.IDX;
import ch.ethz.globis.tinspin.TestInstances.TST;
import ch.ethz.globis.tinspin.data.TestPointCube;
import ch.ethz.globis.tinspin.wrappers.PointPHC;

public class Example {

private static class MyIndexHandle implements IndexHandle, Serializable {
public static void main(String[] args) {
//How to test your own index or data

//If you test your own index or data, implement one (or two) or the following:
//1a) Implement an Index into a wrapper class, such as PointPHC.class,
// this requires the 'Candidate' class from tinspin-common.
//1b) Implement a data source into a wrapper, such as TestPointCube,
// this requires the 'AbstractTest' class from tinspin-common.

//2) Create an IndexHandle and/or TestHandle
IndexHandle myIndex = new MyIndexHandle();
TestHandle myDataSource = new MyDataSource();
//Alternatively: use predefined index or data source
//myIndex = IDX.PHC;
//myDataSource = TST.CUBE_P;

//3) Create TestStats
int N = 10_000; //10_000 points
int DIM = 3; //3 dimensions
TestStats ts = new TestStats(myDataSource, myIndex, N, DIM, 1.0);

//4a) Either run it as single test
// Features or running TestRunner:
// - mainly useful for debugging and superficial tests
// TestRunner test = new TestRunner(ts);
// TestStats s = test.run();
// System.out.println(s);

//4b) Or run it with the Framework
// Features of running the framework:
// - repeated tests with averaged results
// - results are written to logfiles in 'target/logs'
// - each repeat is run in a separate virtual machine via RMI
// - each repeat is warmed up with a small dataset
ts.cfgNRepeat = 2;
TestManager.runTest(ts);
}

private static class MyIndexHandle implements IndexHandle, Serializable {
private static final long serialVersionUID = 1L;

@Override
@@ -28,40 +68,30 @@ public String getCandidateClassNameRectangle() {

@Override
public String getCandidateClassNamePoint() {
//This class mus implement 'Candidate'
//We only need the String name here:
return PointPHC.class.getName();
}
};


public static void main(String[] args) {
//How to test your own index

//1) Implement an Index into a wrapper class, such as PointPHC.class,
// this requires the 'Candidate' class from tinspin-common.

//2) Create an IndexHandle
IndexHandle myIndex = new MyIndexHandle();

//3) Create TestStats
int N = 10_000; //10_000 points
int DIM = 3; //3 dimensions
TestStats ts = new TestStats(TestInstances.TST.CUBE_P, myIndex, N, DIM, 1.0);
private static class MyDataSource implements TestHandle, Serializable {
private static final long serialVersionUID = 1L;

//4a) Either run it as single test:
// Features: This is mainly useful for debugging and superficial tests
// TestRunner test = new TestRunner(ts);
// TestStats s = test.run();
// System.out.println(s);
@Override
public String name() {
return "MyTest";
}

//4b) Or run it with the Framework
// Features of running the framework:
// - repeated tests with averaged results
// - results are written to logfiiles in 'target/logs'
// - each repeat is run in a separate virtual machine via RMI
// - each repeat is warmed up with a small dataset
ts.cfgNRepeat = 2;
TestManager.runTest(ts);
}
@Override
public String getTestClassName() {
//This class must implement 'AbstractTest'
return TestPointCube.class.getName();
}

@Override
public boolean isRangeData() {
return false;
}
};

}

0 comments on commit 2409969

Please sign in to comment.