Skip to content
Snippets Groups Projects
Commit 375627f5 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

various fixes

parent 91d38344
No related branches found
No related tags found
No related merge requests found
...@@ -52,7 +52,7 @@ public class ParameterSet implements TunableValidator ...@@ -52,7 +52,7 @@ public class ParameterSet implements TunableValidator
/**Describes whether auto configuration of the reduction rules is to be used. Overrides the bit mask.**/ /**Describes whether auto configuration of the reduction rules is to be used. Overrides the bit mask.**/
public boolean suggestReduction = true; public boolean suggestReduction = true;
@Tunable(description="Determines the number of clusters that are to be generated. -1 generates the optimal amount of clusters in the sense of WCE") @Tunable(description="Determines the number of clusters that are to be generated. -1 generates the optimal amount of clusters in the sense of WCE",context="nogui")
public int clusterCount = -1; public int clusterCount = -1;
@Override @Override
...@@ -101,5 +101,12 @@ public class ParameterSet implements TunableValidator ...@@ -101,5 +101,12 @@ public class ParameterSet implements TunableValidator
return true; return true;
} }
@Override
public String toString(){
String ret = "";
ret += "Target Cluster Count: "+clusterCount+"\n";
//TODO
return ret;
}
} }
...@@ -59,6 +59,10 @@ public class ClusterEditingSolutions { ...@@ -59,6 +59,10 @@ public class ClusterEditingSolutions {
LibraryInterfaceJNI.ClusterEditingSolutions_setFlags(swigCPtr, this, SolutionFlags.getCPtr(f), f); LibraryInterfaceJNI.ClusterEditingSolutions_setFlags(swigCPtr, this, SolutionFlags.getCPtr(f), f);
} }
public void printSolution(long index) {
LibraryInterfaceJNI.ClusterEditingSolutions_printSolution(swigCPtr, this, index);
}
public ClusterEditingSolutions() { public ClusterEditingSolutions() {
this(LibraryInterfaceJNI.new_ClusterEditingSolutions(), true); this(LibraryInterfaceJNI.new_ClusterEditingSolutions(), true);
} }
......
...@@ -25,8 +25,8 @@ public class LibraryInterface { ...@@ -25,8 +25,8 @@ public class LibraryInterface {
LibraryInterfaceJNI.setVerbosity(level); LibraryInterfaceJNI.setVerbosity(level);
} }
public static CoreAlgorithm getRun(LibraryInput input, int nrOptimalSolutions, String rulesBitMask, double multiplicativeFactor, boolean useHeuristic, boolean separatePartitionCuts, boolean separateTriangles) { public static CoreAlgorithm getRun(LibraryInput input, int nrOptimalSolutions, String rulesBitMask, double multiplicativeFactor, boolean useHeuristic, boolean separatePartitionCuts, boolean separateTriangles, int targetClusterCount) {
long cPtr = LibraryInterfaceJNI.getRun(LibraryInput.getCPtr(input), input, nrOptimalSolutions, rulesBitMask, multiplicativeFactor, useHeuristic, separatePartitionCuts, separateTriangles); long cPtr = LibraryInterfaceJNI.getRun(LibraryInput.getCPtr(input), input, nrOptimalSolutions, rulesBitMask, multiplicativeFactor, useHeuristic, separatePartitionCuts, separateTriangles, targetClusterCount);
return (cPtr == 0) ? null : new CoreAlgorithm(cPtr, false); return (cPtr == 0) ? null : new CoreAlgorithm(cPtr, false);
} }
......
...@@ -53,6 +53,7 @@ public class LibraryInterfaceJNI { ...@@ -53,6 +53,7 @@ public class LibraryInterfaceJNI {
public final static native long ClusterEditingSolutions_getNumberOfSolutions(long jarg1, ClusterEditingSolutions jarg1_); public final static native long ClusterEditingSolutions_getNumberOfSolutions(long jarg1, ClusterEditingSolutions jarg1_);
public final static native long ClusterEditingSolutions_getFlags(long jarg1, ClusterEditingSolutions jarg1_); public final static native long ClusterEditingSolutions_getFlags(long jarg1, ClusterEditingSolutions jarg1_);
public final static native void ClusterEditingSolutions_setFlags(long jarg1, ClusterEditingSolutions jarg1_, long jarg2, SolutionFlags jarg2_); public final static native void ClusterEditingSolutions_setFlags(long jarg1, ClusterEditingSolutions jarg1_, long jarg2, SolutionFlags jarg2_);
public final static native void ClusterEditingSolutions_printSolution(long jarg1, ClusterEditingSolutions jarg1_, long jarg2);
public final static native long new_ClusterEditingSolutions(); public final static native long new_ClusterEditingSolutions();
public final static native void delete_ClusterEditingSolutions(long jarg1); public final static native void delete_ClusterEditingSolutions(long jarg1);
public final static native long new_LibraryInput(); public final static native long new_LibraryInput();
...@@ -79,7 +80,7 @@ public class LibraryInterfaceJNI { ...@@ -79,7 +80,7 @@ public class LibraryInterfaceJNI {
public final static native void setTimeLimit(int jarg1); public final static native void setTimeLimit(int jarg1);
public final static native void setThreadLimit(int jarg1); public final static native void setThreadLimit(int jarg1);
public final static native void setVerbosity(int jarg1); public final static native void setVerbosity(int jarg1);
public final static native long getRun(long jarg1, LibraryInput jarg1_, int jarg2, String jarg3, double jarg4, boolean jarg5, boolean jarg6, boolean jarg7); public final static native long getRun(long jarg1, LibraryInput jarg1_, int jarg2, String jarg3, double jarg4, boolean jarg5, boolean jarg6, boolean jarg7, int jarg8);
public static void SwigDirector_CplexInformer_updateStatus__SWIG_0(CplexInformer jself, int state) { public static void SwigDirector_CplexInformer_updateStatus__SWIG_0(CplexInformer jself, int state) {
jself.updateStatus(YoshikoState.swigToEnum(state)); jself.updateStatus(YoshikoState.swigToEnum(state));
......
...@@ -34,7 +34,8 @@ public class ClusterCountChooser extends JPanel { ...@@ -34,7 +34,8 @@ public class ClusterCountChooser extends JPanel {
public ClusterCountChooser() { public ClusterCountChooser() {
//Swing Component init //Swing Component init
numSolutionsSetter = new IntegerInputField(); numSolutionsSetter = new IntegerInputField(1,Integer.MAX_VALUE);
numSolutionsSetter.setValue(2);
label = new JLabel(LocalizationManager.get("nrClusters")); label = new JLabel(LocalizationManager.get("nrClusters"));
SwingUtil.addAll(this,label, numSolutionsSetter); SwingUtil.addAll(this,label, numSolutionsSetter);
} }
......
...@@ -34,12 +34,12 @@ public class IntegerInputField extends JFormattedTextField{ ...@@ -34,12 +34,12 @@ public class IntegerInputField extends JFormattedTextField{
private final NumberFormatter formatter; private final NumberFormatter formatter;
// public IntegerInputField(int minValue, int maxValue) { public IntegerInputField(int minValue, int maxValue) {
// super(); super();
// formatter = FormatHelper.getIntegerFormatter(minValue,maxValue); formatter = FormatHelper.getIntegerFormatter(minValue,maxValue);
// this.setFormatter(formatter); this.setFormatter(formatter);
// this.setColumns(8); this.setColumns(8);
// } }
public IntegerInputField() { public IntegerInputField() {
super(); super();
......
...@@ -108,7 +108,7 @@ public class OperationModePanel extends JPanel{ ...@@ -108,7 +108,7 @@ public class OperationModePanel extends JPanel{
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING,true) layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING,true)
.addComponent(useClusterCount, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(useClusterCount, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(ccChooser, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(ccChooser, DEFAULT_SIZE, DEFAULT_SIZE, DEFAULT_SIZE)
.addComponent(useHeuristic, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(useHeuristic, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(useILP, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(useILP, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(solutionNumberChooser, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(solutionNumberChooser, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)
......
...@@ -163,6 +163,8 @@ public class AlgorithmTask extends AbstractTask implements ObservableTask, Tunab ...@@ -163,6 +163,8 @@ public class AlgorithmTask extends AbstractTask implements ObservableTask, Tunab
//Set the default value for insertion cost //Set the default value for insertion cost
c_input.setDefaultInsertionCost(parameterSet.defaultInsertionCost); c_input.setDefaultInsertionCost(parameterSet.defaultInsertionCost);
System.out.print(parameterSet.toString()); //TODO: Move to debug logger
//Call Yoshiko <<< Algorithm is performed here //Call Yoshiko <<< Algorithm is performed here
c_algorithm = LibraryInterface.getRun(c_input, c_algorithm = LibraryInterface.getRun(c_input,
parameterSet.solCount, parameterSet.solCount,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment