Cosmetics

This commit is contained in:
Marcel Kronfeld 2007-12-17 14:05:52 +00:00
parent 25a28fd957
commit 1e8b14b0f1
8 changed files with 27 additions and 12 deletions

View File

@ -344,7 +344,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
xx.start(); xx.start();
} }
}; };
m_actKillAllHosts = new ExtAction("Kill &all server", "Kill all server", m_actKillAllHosts = new ExtAction("Kill &all servers", "Kill all servers",
KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK)) { KeyStroke.getKeyStroke(KeyEvent.VK_K, Event.CTRL_MASK)) {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
logMessage(e.getActionCommand()); logMessage(e.getActionCommand());

View File

@ -721,7 +721,7 @@ public class GenericObjectEditor implements PropertyEditor {
* appear possible given that the initialization string isn't supposed to * appear possible given that the initialization string isn't supposed to
* contain multiple statements. * contain multiple statements.
* *
* @return the java source code initialisation string * @return the java source code initialization string
*/ */
public String getJavaInitializationString() { public String getJavaInitializationString() {
return "new " + m_Object.getClass().getName() + "()"; return "new " + m_Object.getClass().getName() + "()";

View File

@ -34,8 +34,8 @@ public class PropertyDialog extends JEFrame {
/** /**
* *
*/ */
public PropertyDialog (PropertyEditor Editor,String Title, int x, int y) { public PropertyDialog (PropertyEditor editor,String Title, int x, int y) {
super(EVAHELP.cutClassName (Editor.getValue().getClass().getName())); // that was the long class name !! super(getFrameNameFromEditor(editor)); // that was the long class name !!
BasicResourceLoader loader = BasicResourceLoader.instance(); BasicResourceLoader loader = BasicResourceLoader.instance();
byte[] bytes = loader.getBytesFromResourceLocation(EvAClient.iconLocation); byte[] bytes = loader.getBytesFromResourceLocation(EvAClient.iconLocation);
try { try {
@ -50,13 +50,27 @@ public class PropertyDialog extends JEFrame {
} }
}); });
getContentPane().setLayout(new BorderLayout()); getContentPane().setLayout(new BorderLayout());
m_Editor = Editor; m_Editor = editor;
m_EditorComponent = Editor.getCustomEditor(); m_EditorComponent = editor.getCustomEditor();
getContentPane().add(m_EditorComponent, BorderLayout.CENTER); getContentPane().add(m_EditorComponent, BorderLayout.CENTER);
pack(); pack();
setLocation(x, y); setLocation(x, y);
setVisible(true); setVisible(true);
} }
protected static String getFrameNameFromEditor(PropertyEditor editor) {
return EVAHELP.cutClassName(editor.getValue().getClass().getName());
}
/**
* Update the name of the dialogue from an editor instance.
*
* @param editor
*/
public void updateFrameTitle(PropertyEditor editor) {
setTitle(getFrameNameFromEditor(editor));
}
/** /**
* *
*/ */

View File

@ -48,8 +48,10 @@ public class PropertyPanel extends JPanel {
int y = getLocationOnScreen().y; int y = getLocationOnScreen().y;
m_PropertyDialog = new PropertyDialog(m_PropertyEditor, EVAHELP.cutClassName(m_PropertyEditor.getClass().getName()) , x, y); m_PropertyDialog = new PropertyDialog(m_PropertyEditor, EVAHELP.cutClassName(m_PropertyEditor.getClass().getName()) , x, y);
} }
else else {
m_PropertyDialog.updateFrameTitle(m_PropertyEditor);
m_PropertyDialog.setVisible(true); m_PropertyDialog.setVisible(true);
}
} }
} }
}); });

View File

@ -117,7 +117,7 @@ public class SelectTournament implements InterfaceSelection, java.io.Serializabl
*/ */
public String globalInfo() { public String globalInfo() {
return "The tournament selection compares the raw fitness of n individuals and takes the best." + return "The tournament selection compares the raw fitness of n individuals and takes the best." +
"This is a single objective selecting method, it will select in respect to a random criteria."; "This is a single-objective method, it will select with respect to the first criterium in the multi-objective case.";
} }
/** You can choose the tournament size. /** You can choose the tournament size.

View File

@ -204,7 +204,6 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
double curBestFitness = Double.POSITIVE_INFINITY; double curBestFitness = Double.POSITIVE_INFINITY;
for (int i = 0; i < super.size(); i++) { for (int i = 0; i < super.size(); i++) {
//System.out.println("Fitness " + i + " " + ((AbstractEAIndividual)super.get(i)).getFitness(0));
if ((!((AbstractEAIndividual)super.get(i)).violatesConstraint()) && (((AbstractEAIndividual)super.get(i)).getFitness(0) < curBestFitness)) { if ((!((AbstractEAIndividual)super.get(i)).violatesConstraint()) && (((AbstractEAIndividual)super.get(i)).getFitness(0) < curBestFitness)) {
result = i; result = i;
curBestFitness = ((AbstractEAIndividual)super.get(i)).getFitness(0); curBestFitness = ((AbstractEAIndividual)super.get(i)).getFitness(0);
@ -405,7 +404,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
* @return description * @return description
*/ */
public String globalInfo() { public String globalInfo() {
return "A population stores all current soultions and is used to determine the optimizing progress."; return "A population stores the individuals of a generation.";
} }
/** This method allows you to set the population size /** This method allows you to set the population size

View File

@ -172,7 +172,7 @@ public class PopulationBasedIncrementalLearning implements InterfaceOptimizer, j
* @return description * @return description
*/ */
public String globalInfo() { public String globalInfo() {
return "The Population based incremental learing is based on a statistical distribution of bit positions."; return "The Population based incremental learning is based on a statistical distribution of bit positions. Please note: This optimizer requires a binary genotype!";
} }
/** This method will return a naming String /** This method will return a naming String
* @return The name of the algorithm * @return The name of the algorithm

View File

@ -113,7 +113,7 @@ public class PBILParameters implements InterfaceGOParameters, Serializable {
* @return description * @return description
*/ */
public String globalInfo() { public String globalInfo() {
return "Please note: This optimizer requires a BitSet as genotype!!"; return ((PopulationBasedIncrementalLearning)this.m_Optimizer).globalInfo();
} }
/** This methods allow you to set and get the Seed for the Random Number Generator. /** This methods allow you to set and get the Seed for the Random Number Generator.