Commit 375627f5 authored by Philipp Spohr's avatar Philipp Spohr
Browse files

various fixes

parent 91d38344
......@@ -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.**/
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;
@Override
......@@ -101,5 +101,12 @@ public class ParameterSet implements TunableValidator
return true;
}
@Override
public String toString(){
String ret = "";
ret += "Target Cluster Count: "+clusterCount+"\n";
//TODO
return ret;
}
}
......@@ -59,6 +59,10 @@ public class ClusterEditingSolutions {
LibraryInterfaceJNI.ClusterEditingSolutions_setFlags(swigCPtr, this, SolutionFlags.getCPtr(f), f);
}
public void printSolution(long index) {
LibraryInterfaceJNI.ClusterEditingSolutions_printSolution(swigCPtr, this, index);
}
public ClusterEditingSolutions() {
this(LibraryInterfaceJNI.new_ClusterEditingSolutions(), true);
}
......
......@@ -25,8 +25,8 @@ public class LibraryInterface {
LibraryInterfaceJNI.setVerbosity(level);
}
public static CoreAlgorithm getRun(LibraryInput input, int nrOptimalSolutions, String rulesBitMask, double multiplicativeFactor, boolean useHeuristic, boolean separatePartitionCuts, boolean separateTriangles) {
long cPtr = LibraryInterfaceJNI.getRun(LibraryInput.getCPtr(input), input, nrOptimalSolutions, rulesBitMask, multiplicativeFactor, useHeuristic, separatePartitionCuts, 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, targetClusterCount);
return (cPtr == 0) ? null : new CoreAlgorithm(cPtr, false);
}
......
......@@ -53,6 +53,7 @@ public class LibraryInterfaceJNI {
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 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 void delete_ClusterEditingSolutions(long jarg1);
public final static native long new_LibraryInput();
......@@ -79,7 +80,7 @@ public class LibraryInterfaceJNI {
public final static native void setTimeLimit(int jarg1);
public final static native void setThreadLimit(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) {
jself.updateStatus(YoshikoState.swigToEnum(state));
......
......@@ -34,7 +34,8 @@ public class ClusterCountChooser extends JPanel {
public ClusterCountChooser() {
//Swing Component init
numSolutionsSetter = new IntegerInputField();
numSolutionsSetter = new IntegerInputField(1,Integer.MAX_VALUE);
numSolutionsSetter.setValue(2);
label = new JLabel(LocalizationManager.get("nrClusters"));
SwingUtil.addAll(this,label, numSolutionsSetter);
}
......
......@@ -34,12 +34,12 @@ public class IntegerInputField extends JFormattedTextField{
private final NumberFormatter formatter;
// public IntegerInputField(int minValue, int maxValue) {
// super();
// formatter = FormatHelper.getIntegerFormatter(minValue,maxValue);
// this.setFormatter(formatter);
// this.setColumns(8);
// }
public IntegerInputField(int minValue, int maxValue) {
super();
formatter = FormatHelper.getIntegerFormatter(minValue,maxValue);
this.setFormatter(formatter);
this.setColumns(8);
}
public IntegerInputField() {
super();
......
......@@ -108,7 +108,7 @@ public class OperationModePanel extends JPanel{
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING,true)
.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(useILP, 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
//Set the default value for insertion cost
c_input.setDefaultInsertionCost(parameterSet.defaultInsertionCost);
System.out.print(parameterSet.toString()); //TODO: Move to debug logger
//Call Yoshiko <<< Algorithm is performed here
c_algorithm = LibraryInterface.getRun(c_input,
parameterSet.solCount,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment