Skip to content
Snippets Groups Projects
Commit 4286d19c authored by Reiner Jung's avatar Reiner Jung
Browse files

Made clustering distance configurable.

parent f7a1a238
No related branches found
No related tags found
1 merge request!89Reiner
......@@ -12,7 +12,7 @@ cd $BASE_DIR/build/oceandsl-tools
mkdir bin
mkdir lib
for I in allen-upper-limit cmi dar delta fxca maa mktable mop mvis sar relabel restructuring ; do
for I in allen-upper-limit cmi dar delta fxca maa mktable mop mt mvis sar relabel restructuring ; do
unzip $BASE_DIR/tools/$I/build/distributions/$I-$VERSION.zip
mv $I-$VERSION/lib/* lib/
mv $I-$VERSION/bin/* bin/
......
......@@ -25,11 +25,9 @@ dependencies {
implementation 'com.sun.xml.bind:jaxb-impl:2.3.3'
implementation 'org.apache.commons:commons-compress:1.20'
implementation 'org.apache.commons:commons-lang3:3.12.0'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
implementation 'org.apache.commons:commons-text:1.10.0'
// https://mvnrepository.com/artifact/com.edwardraff/JSAT
implementation 'com.edwardraff:JSAT:0.0.9'
// https://mvnrepository.com/artifact/org.apache.commons/commons-text
implementation 'org.apache.commons:commons-text:1.10.0'
implementation 'org.csveed:csveed:0.7.4'
}
......
......@@ -40,6 +40,12 @@ public class Settings { // NOPMD data class
"--sort" }, required = true, converter = SortDescriptorConverter.class, description = "Sort description")
private SortDescriptor sortDescription;
@Parameter(names = { "-p", "--min-ptr" }, required = false, description = "Min ptr value for clustering")
private Integer minPtr;
@Parameter(names = { "-d", "--cluster-distance" }, required = true, description = "Min cluster distance")
private double clusteringDistance;
public Path getInputTable() {
return this.inputTable;
}
......@@ -52,4 +58,16 @@ public class Settings { // NOPMD data class
return this.sortDescription;
}
public int getMinPtr() {
if (this.minPtr == null) {
return 1;
} else {
return this.minPtr;
}
}
public double getClusteringDistance() {
return this.clusteringDistance;
}
}
......@@ -48,10 +48,6 @@ public class TeetimeConfiguration extends Configuration {
public TeetimeConfiguration(final Settings settings) throws IOException {
final double clusteringDistance = 0.11;
final int minPtr = 1;
final String inputFileName = settings.getInputTable().getFileName().toString();
final CsvTableReaderProducerStage<String, MoveOperationEntry> csvTableReaderStage = new CsvTableReaderProducerStage<>(
......@@ -80,26 +76,25 @@ public class TeetimeConfiguration extends Configuration {
final MTreeGeneratorStage<OpticsData<MoveOperationEntry>> mTreeGeneratorStage = new MTreeGeneratorStage<>(
distanceFunction);
final OpticsStage<MoveOperationEntry> opticsStage = new OpticsStage<>(clusteringDistance, minPtr);
final OpticsStage<MoveOperationEntry> opticsStage = new OpticsStage<>(settings.getClusteringDistance(),
settings.getMinPtr());
final ExtractDBScanClustersStage<MoveOperationEntry> clustering = new ExtractDBScanClustersStage<>(
clusteringDistance);
settings.getClusteringDistance());
final ConstructTableStage constructTableStage = new ConstructTableStage(inputFileName);
final SingleFileTableCsvSink<String, MoveOperationEntry> tableSink = new SingleFileTableCsvSink<>(
settings.getOutputTable(), MoveOperationEntry.class, true, TableCsvSink.LF);
this.connectPorts(csvTableReaderStage.getOutputPort(), sortModelStage.getInputPort());
this.connectPorts(sortModelStage.getOutputPort(), converterStage.getInputPort());
this.connectPorts(csvTableReaderStage.getOutputPort(), converterStage.getInputPort());
this.connectPorts(converterStage.getOutputPort(), distributor.getInputPort());
this.connectPorts(distributor.getNewOutputPort(), mTreeGeneratorStage.getInputPort());
this.connectPorts(mTreeGeneratorStage.getOutputPort(), opticsStage.getMTreeInputPort());
this.connectPorts(distributor.getNewOutputPort(), opticsStage.getModelsInputPort());
this.connectPorts(opticsStage.getOutputPort(), clustering.getInputPort());
this.connectPorts(clustering.getOutputPort(), constructTableStage.getInputPort());
this.connectPorts(constructTableStage.getOutputPort(), tableSink.getInputPort());
// tableSink.getInputPort());
this.connectPorts(constructTableStage.getOutputPort(), sortModelStage.getInputPort());
this.connectPorts(sortModelStage.getOutputPort(), tableSink.getInputPort());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment