From: <ton...@us...> - 2008-03-08 04:58:59
|
Revision: 694 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=694&view=rev Author: tonytacker Date: 2008-03-07 20:58:56 -0800 (Fri, 07 Mar 2008) Log Message: ----------- improved output for best solutions Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java Modified: trunk/src/dl-learner/org/dllearner/gui/RunPanel.java =================================================================== --- trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-03-08 04:16:34 UTC (rev 693) +++ trunk/src/dl-learner/org/dllearner/gui/RunPanel.java 2008-03-08 04:58:56 UTC (rev 694) @@ -25,8 +25,10 @@ import java.awt.GridBagLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.util.List; import javax.swing.*; + /** * @author Tilo Hielscher * @@ -162,9 +164,10 @@ infoArea.setText(""); // best solutions - if (config.getLearningAlgorithm().getBestSolutions(5) != null) - infoArea.append("BestSolutions:\n" - + config.getLearningAlgorithm().getBestSolutions(5).toString() + "\n\n"); + if (config.getLearningAlgorithm().getBestSolutions(5) != null) { + infoArea.append("Best solutions: \n\n" + + listToString(config.getLearningAlgorithm().getBestSolutions(10)) + "\n"); + } // solution score // if (config.getLearningAlgorithm().getSolutionScore() != null) // infoArea.append("SolutionScore:\n" @@ -278,4 +281,19 @@ gbc.weightx = wx; gbc.weighty = wy; } + + /** + * Make a string from list, every entry in new line. + * + * @param listDescription + * it is the list. + * @return the string. + */ + public String listToString(List<?> list) { + String string = ""; + for (int i = 0; i < list.size(); i++) { + string += list.get(i) + "\n"; + } + return string; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |