diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java index a228110a520fbf15eda4e4da8bb87852b7b943a4..02bcee9949ca4f8fe4bc1c4f9b0073b0a6cb36af 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/CyActivator.java @@ -117,7 +117,7 @@ public class CyActivator extends AbstractCyActivator { Properties props = new Properties(); props.setProperty(COMMAND_NAMESPACE, "yoshiko"); props.setProperty(COMMAND, YoshikoCommand.PERFORM_ALGORITHM.toString()); - props.setProperty(COMMAND_DESCRIPTION,"TEST PERFORM ALGORITHM"); + props.setProperty(COMMAND_DESCRIPTION,"Cluster a network with the Yoshiko algorithm"); registerService(context, commandTaskFactory, TaskFactory.class, props); //Initialize and register main panel diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java index 753d5bb3f4ce91fe61c17142c67b0d847896a861..79d7daaa14067a70c1b07172010d8ce87a83cea9 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/core/ParameterSet.java @@ -8,21 +8,40 @@ public class ParameterSet { @Tunable(description="Time Limit for the ILP mode", context="nogui") public int timeLimit = -1; + @Tunable(description="A column in the edge table containing weights", context="nogui") public CyColumn weightColumn; - + @Tunable(description="A column containing boolean entries for edges that are to be treated as permanent",context="nogui") public CyColumn permanentColumn; + @Tunable(description="A column containing boolean entries for edges that are to be treated as forbidden",context="nogui") public CyColumn forbiddenColumn; - public double defaultInsertionCost; - public double defaultDeletionCost; - public String reductionRulesBitMask; - public double snrMultFactor; - public boolean useTriangleCuts; - public boolean usePartitionCuts; - public boolean useHeuristic; - public int solCount; + + @Tunable(description="The default insertion cost that is to be used for non-existing edges",context="nogui") + public double defaultInsertionCost = -1; + @Tunable(description="The default deletion cost that is to be used for edges without an associated weight",context="nogui") + public double defaultDeletionCost = 1; + + @Tunable(description="A bitmask representing which reduction rules should be used",context="nogui") //TODO: Filter bad bitmasks + public String reductionRulesBitMask = "000000"; + @Tunable(description="A value controlling the resolution of the SNR reduction rule. Higher values mean a longer running time but possibly better reduction.",context="nogui") + public double snrMultFactor = 1.0; + + @Tunable(description="Alternative Callback for CPLEX, might be faster on certain instances",context="nogui") + public boolean useTriangleCuts = false; + @Tunable(description="Alternative Callback for CPLEX, might be faster on large instances",context="nogui") + public boolean usePartitionCuts = false; + + @Tunable(description="Uses a heuristic instead of ILP to solve WCE, significantly faster",context="nogui") + public boolean useHeuristic = true; + + @Tunable(description="The maximum number of (optimal) solutions that is to be calculated",context="nogui") + public int solCount = 1; + + @Tunable(description="Disable multithreading to keep the system responsive",context="nogui") public boolean disableMultiThreading; + + @Tunable(description="Automatically choose an appopriate set of reduction rules (overrides a given bitmask)",context="nogui") /**Describes whether auto configuration of the reduction rules is to be used. Overrides the bit mask.**/ - public boolean suggestReduction; + public boolean suggestReduction = true; } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java index 51c1dafca4c2ad4ca4b6d1358563520ce860b464..c6003910ae939c4e7359a03d7d67f98b7ec1a207 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/cytoUtil/GraphAnalyzer.java @@ -6,14 +6,14 @@ import org.cytoscape.model.CyColumn; import org.cytoscape.model.CyEdge; import org.cytoscape.model.CyNetwork; import org.cytoscape.model.CyRow; -import org.slf4j.Logger; +//import org.slf4j.Logger; -import de.hhu.ba.yoshikoWrapper.logging.YoshikoLogger; +//import de.hhu.ba.yoshikoWrapper.logging.YoshikoLogger; public class GraphAnalyzer { - private static Logger logger = YoshikoLogger.getInstance().getLogger(); + //private static Logger logger = YoshikoLogger.getInstance().getLogger(); public static boolean isMultiGraph(CyNetwork net) { //TODO: Better algorithm? @@ -38,6 +38,13 @@ public class GraphAnalyzer { return false; } + /** + * Checks whether two edges connect the same pair of nodes + * This function is symmetric + * @param e1 An arbitrary CyEdge + * @param e2 An arbitrary CyEdge + * @return true if the edges connect the same pair of nodes, false otherwise + */ private static boolean connectSameNodes(CyEdge e1, CyEdge e2) { if (//Treating all edges as undirected here (e1.getSource() == e2.getTarget() && e1.getTarget() == e2.getSource()) || @@ -61,7 +68,7 @@ public class GraphAnalyzer { * Generates a fitting bitmask by choosing the reduction rules that appear to be the best choice based on current research * @param containsRealValues * @param heuristic - * @return + * @return The bitmask as a String */ public static String suggestReductionRules(boolean containsRealValues, boolean heuristic) { diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java b/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java index 812564310a916ea70ad7a2f0f044e710c2087e0e..87fb8c9b9fdc62ef34ad6c5caf2f7a4c086fc2c2 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/taskFactories/YoshikoCommand.java @@ -18,6 +18,9 @@ public enum YoshikoCommand { if (this==PERFORM_ALGORITHM) { return "cluster"; //TODO: Dynamic } + else if (this==CREATE_CLUSTER_VIEW) { + return "createcvs"; + } return "null"; } } diff --git a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java index 0535700545e8dd0835df9fc31449ddbb00bd38bf..8920a781c04170ef7bc16adc7b4e6d3918ee76d8 100644 --- a/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java +++ b/src/main/java/de/hhu/ba/yoshikoWrapper/tasks/AlgorithmTask.java @@ -76,7 +76,7 @@ public class AlgorithmTask extends AbstractTask implements ObservableTask { public ParameterSet parameterSet = null; @Tunable(description="Network to analyze for clusters", context="nogui") - public CyNetwork net; + public CyNetwork net = CyCore.cy.getCurrentNetwork(); //Temps, pointing to and need to be freed in C++ private LibraryInput c_input; @@ -289,7 +289,7 @@ public class AlgorithmTask extends AbstractTask implements ObservableTask { @Override public <R> R getResults(Class<? extends R> type) { - //TODO: + //TODO: Return Result in some format that is suitable for console applications if (type.equals(YoshikoResult.class)) { return (R) (result!=null ? result : null); }