Major code cleanup.

This commit is contained in:
2014-10-19 12:37:35 +02:00
parent f4b064e64a
commit d9cc88e60d
348 changed files with 594 additions and 1033 deletions

View File

@@ -94,7 +94,7 @@ public class OptimizerFactory {
* @param listener * @param listener
* @return An optimization algorithm that performs differential evolution. * @return An optimization algorithm that performs differential evolution.
*/ */
public static final DifferentialEvolution createDifferentialEvolution( public static DifferentialEvolution createDifferentialEvolution(
AbstractOptimizationProblem problem, int popsize, double f, AbstractOptimizationProblem problem, int popsize, double f,
double lambda, double CR, double lambda, double CR,
InterfacePopulationChangedEventListener listener) { InterfacePopulationChangedEventListener listener) {
@@ -136,7 +136,7 @@ public class OptimizerFactory {
* @param listener * @param listener
* @return An optimization algorithm that employs an evolution strategy. * @return An optimization algorithm that employs an evolution strategy.
*/ */
public static final EvolutionStrategies createEvolutionStrategy(int mu, public static EvolutionStrategies createEvolutionStrategy(int mu,
int lambda, boolean plus, InterfaceMutation mutationoperator, int lambda, boolean plus, InterfaceMutation mutationoperator,
double pm, InterfaceCrossover crossoveroperator, double pc, double pm, InterfaceCrossover crossoveroperator, double pc,
InterfaceSelection selection, AbstractOptimizationProblem problem, InterfaceSelection selection, AbstractOptimizationProblem problem,
@@ -164,7 +164,7 @@ public class OptimizerFactory {
* @param listener * @param listener
* @return An optimization algorithm that employs an IPOP-ES. * @return An optimization algorithm that employs an IPOP-ES.
*/ */
public static final EvolutionStrategyIPOP createEvolutionStrategyIPOP(int mu, public static EvolutionStrategyIPOP createEvolutionStrategyIPOP(int mu,
int lambda, boolean plus, InterfaceMutation mutationoperator, int lambda, boolean plus, InterfaceMutation mutationoperator,
double pm, InterfaceCrossover crossoveroperator, double pc, double incPopSizeFact, double stagThresh, double pm, InterfaceCrossover crossoveroperator, double pc, double incPopSizeFact, double stagThresh,
AbstractOptimizationProblem problem, InterfacePopulationChangedEventListener listener) { AbstractOptimizationProblem problem, InterfacePopulationChangedEventListener listener) {
@@ -175,7 +175,7 @@ public class OptimizerFactory {
return esIPOP; return esIPOP;
} }
private static final EvolutionStrategies createES(EvolutionStrategies theES, InterfaceMutation mutationoperator, private static EvolutionStrategies createES(EvolutionStrategies theES, InterfaceMutation mutationoperator,
double pm, InterfaceCrossover crossoveroperator, double pc, double pm, InterfaceCrossover crossoveroperator, double pc,
InterfaceSelection selection, AbstractOptimizationProblem problem, InterfaceSelection selection, AbstractOptimizationProblem problem,
InterfacePopulationChangedEventListener listener) { InterfacePopulationChangedEventListener listener) {
@@ -526,7 +526,7 @@ public class OptimizerFactory {
* *
* @return the default number of fitness call done before termination * @return the default number of fitness call done before termination
*/ */
public static final int getDefaultFitCalls() { public static int getDefaultFitCalls() {
return defaultFitCalls; return defaultFitCalls;
} }
@@ -1423,7 +1423,7 @@ public class OptimizerFactory {
es.setForceOrigPopSize(false); es.setForceOrigPopSize(false);
((EvolutionStrategyIPOP) es).setIncPopSizeFact(incLambdaFact); ((EvolutionStrategyIPOP) es).setIncPopSizeFact(incLambdaFact);
// Set CMA operator for mutation // Set CMA operator for mutation
AbstractEAIndividual indy = (AbstractEAIndividual) indyTemplate; AbstractEAIndividual indy = indyTemplate;
MutateESRankMuCMA cmaMut = new MutateESRankMuCMA(); MutateESRankMuCMA cmaMut = new MutateESRankMuCMA();
AbstractEAIndividual.setOperators(indy, cmaMut, 1., new CrossoverESDefault(), 0.); AbstractEAIndividual.setOperators(indy, cmaMut, 1., new CrossoverESDefault(), 0.);
} else { } else {

View File

@@ -278,7 +278,7 @@ public class OptimizerRunnable implements Runnable {
* @param multis * @param multis
*/ */
public void setMultiRuns(int multis) { public void setMultiRuns(int multis) {
((AbstractStatistics) proc.getStatistics()).getStatisticsParameter().setMultiRuns(multis); proc.getStatistics().getStatisticsParameter().setMultiRuns(multis);
} }
/** /**
@@ -287,6 +287,6 @@ public class OptimizerRunnable implements Runnable {
* @param addInfo * @param addInfo
*/ */
public void setOutputFullStatsToText(boolean addInfo) { public void setOutputFullStatsToText(boolean addInfo) {
((AbstractStatistics) proc.getStatistics()).getStatisticsParameter().setOutputAllFieldsAsText(addInfo); proc.getStatistics().getStatisticsParameter().setOutputAllFieldsAsText(addInfo);
} }
} }

View File

@@ -39,5 +39,4 @@ public class TestingCbnPostProc {
} }
} }
;
} }

View File

@@ -36,6 +36,5 @@ public class TestingGAB1 {
System.out.println(); System.out.println();
} }
;
} }

View File

@@ -40,5 +40,4 @@ public class TestingPlusCmaEs {
+ AbstractEAIndividual.getDefaultDataString(bestIndy)); + AbstractEAIndividual.getDefaultDataString(bestIndy));
} }
;
} }

View File

@@ -34,7 +34,7 @@ public class BeanInspector {
return false; return false;
} }
System.out.println("equalProperties: " + obj1.getClass().getName() + " " + obj2.getClass().getName()); System.out.println("equalProperties: " + obj1.getClass().getName() + " " + obj2.getClass().getName());
if (obj1.getClass().getName().equals(obj2.getClass().getName()) == false) { if (!obj1.getClass().getName().equals(obj2.getClass().getName())) {
System.out.println(""); System.out.println("");
return false; return false;
} }
@@ -76,14 +76,14 @@ public class BeanInspector {
Object value_1 = getter_1.invoke(obj1, args_1); Object value_1 = getter_1.invoke(obj1, args_1);
Object value_2 = getter_2.invoke(obj2, args_2); Object value_2 = getter_2.invoke(obj2, args_2);
BeansInside = true; BeansInside = true;
if (BeanInspector.equalProperties(value_1, value_2) == false) { if (!BeanInspector.equalProperties(value_1, value_2)) {
BeansEqual = false; BeansEqual = false;
} }
} catch (Exception e) { } catch (Exception e) {
System.out.println(" BeanTest.equalProperties " + e.getMessage()); System.out.println(" BeanTest.equalProperties " + e.getMessage());
} }
} }
if (BeansInside == true) { if (BeansInside) {
return BeansEqual; return BeansEqual;
} }
// here we have Integer or Double ... // here we have Integer or Double ...
@@ -154,7 +154,7 @@ public class BeanInspector {
if (obj instanceof String) { if (obj instanceof String) {
return (String) obj; return (String) obj;
} // directly return a string object } // directly return a string object
Class<? extends Object> type = obj.getClass(); Class<?> type = obj.getClass();
if (type.isArray()) { // handle the array case if (type.isArray()) { // handle the array case
StringBuffer sbuf = new StringBuffer(); StringBuffer sbuf = new StringBuffer();
@@ -524,11 +524,7 @@ public class BeanInspector {
*/ */
private static boolean isBoxableFrom(Class clz1, Class clz2) { private static boolean isBoxableFrom(Class clz1, Class clz2) {
Class box = getBoxedType(clz1); Class box = getBoxedType(clz1);
if (box != null && (clz2.isAssignableFrom(box))) { return box != null && (clz2.isAssignableFrom(box));
return true;
} else {
return false;
}
} }
/** /**
@@ -852,11 +848,8 @@ public class BeanInspector {
if (cls.isPrimitive()) { if (cls.isPrimitive()) {
return true; return true;
} }
if ((cls == Double.class) || (cls == Integer.class) || (cls == Boolean.class) || (cls == Character.class) || (cls == Void.class) return (cls == Double.class) || (cls == Integer.class) || (cls == Boolean.class) || (cls == Character.class) || (cls == Void.class)
|| (cls == Byte.class) || (cls == Short.class) || (cls == Long.class) || (cls == Float.class)) { || (cls == Byte.class) || (cls == Short.class) || (cls == Long.class) || (cls == Float.class);
return true;
}
return false;
} }
/** /**

View File

@@ -44,7 +44,7 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser
toolBar = new JToolBar(); toolBar = new JToolBar();
toolBar.setFloatable(false); toolBar.setFloatable(false);
moduleAdapter.addOptimizationStateListener((OptimizationStateListener) (this)); moduleAdapter.addOptimizationStateListener(this);
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
@@ -104,7 +104,6 @@ public class EvAModuleButtonPanelMaker implements OptimizationStateListener, Ser
scheduleButton = ToolBoxGui.createIconifiedButton("images/Server24.gif", "Schedule", true); scheduleButton = ToolBoxGui.createIconifiedButton("images/Server24.gif", "Schedule", true);
scheduleButton.setToolTipText("Schedule the currently configured optimization as a job."); scheduleButton.setToolTipText("Schedule the currently configured optimization as a job.");
//scheduleButton.setBorderPainted(false);
scheduleButton.addActionListener(new ActionListener() { scheduleButton.addActionListener(new ActionListener() {
@Override @Override

View File

@@ -57,16 +57,14 @@ public class HtmlDemo {
*/ */
public void show() { public void show() {
try { try {
URL url = null; URL url = ClassLoader.getSystemResource("html/" + name);
url = this.getClass().getClassLoader().getSystemResource("html/" + name);
try { try {
htmlEditorPane = new JEditorPane(url); htmlEditorPane = new JEditorPane(url);
} catch (java.io.IOException ioe) { } catch (java.io.IOException ioe) {
url = this.getClass().getClassLoader().getSystemResource("html/Default.html"); url = ClassLoader.getSystemResource("html/Default.html");
htmlEditorPane = new JEditorPane(url); htmlEditorPane = new JEditorPane(url);
} }
//htmlEditorPane = new JEditorPane(htmlDescription);
htmlEditorPane.setEditable(false); htmlEditorPane.setEditable(false);
htmlEditorPane.addHyperlinkListener(createHyperLinkListener()); htmlEditorPane.addHyperlinkListener(createHyperLinkListener());

View File

@@ -70,7 +70,7 @@ public final class JEFrameRegister {
public void setFocusToNext(JEFrame jeFrame) { public void setFocusToNext(JEFrame jeFrame) {
int idx = frameList.indexOf(jeFrame); int idx = frameList.indexOf(jeFrame);
idx = (idx + 1) % frameList.size(); idx = (idx + 1) % frameList.size();
JEFrame toset = ((JEFrame) frameList.get(idx)); JEFrame toset = frameList.get(idx);
toset.toFront(); toset.toFront();
} }

View File

@@ -1,13 +1,5 @@
package eva2.gui; package eva2.gui;
/*
* Title: EvA2
* Description:
* Copyright: Copyright (c) 2003
* Company: University of Tuebingen, Computer Architecture
* @author Holger Ulmer, Felix Streichert, Hannes Planatscher
*/
import eva2.gui.editor.GenericObjectEditor; import eva2.gui.editor.GenericObjectEditor;
import eva2.optimization.stat.OptimizationJobList; import eva2.optimization.stat.OptimizationJobList;
@@ -20,7 +12,6 @@ public class JParaPanel implements Serializable, PanelMaker {
protected String name = "undefined"; protected String name = "undefined";
protected Object localParameter; protected Object localParameter;
protected Object proxyParameter;
protected PropertyEditor propertyEditor; protected PropertyEditor propertyEditor;
/** /**
@@ -50,7 +41,7 @@ public class JParaPanel implements Serializable, PanelMaker {
} else { } else {
propertyEditor = new GenericObjectEditor(); propertyEditor = new GenericObjectEditor();
((GenericObjectEditor) (propertyEditor)).setClassType(localParameter.getClass()); ((GenericObjectEditor) (propertyEditor)).setClassType(localParameter.getClass());
((GenericObjectEditor) (propertyEditor)).setValue(localParameter); propertyEditor.setValue(localParameter);
((GenericObjectEditor) (propertyEditor)).disableOKCancel(); ((GenericObjectEditor) (propertyEditor)).disableOKCancel();
} }

View File

@@ -156,7 +156,7 @@ public class JTextEditorInternalFrame extends JDocFrame {
Action[] actions = textArea.getActions(); Action[] actions = textArea.getActions();
for (int i = 0; i < actions.length; i++) { for (int i = 0; i < actions.length; i++) {
hashActions.put((String) actions[i].getValue(Action.NAME), actions[i]); hashActions.put(actions[i].getValue(Action.NAME), actions[i]);
} }
mnuEdit = new JExtMenu("&Bearbeiten"); mnuEdit = new JExtMenu("&Bearbeiten");

View File

@@ -369,7 +369,7 @@ public class Main extends JFrame implements OptimizationStateListener {
setSize(800, 600); setSize(800, 600);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((int) ((screenSize.width - this.getWidth()) / 2), (int) ((screenSize.height - this.getHeight()) / 2.5)); setLocation((screenSize.width - this.getWidth()) / 2, (int) ((screenSize.height - this.getHeight()) / 2.5));
/* Create a new ConfigurationPanel (left side) */ /* Create a new ConfigurationPanel (left side) */
configurationPane = new JPanel(new GridBagLayout()); configurationPane = new JPanel(new GridBagLayout());

View File

@@ -376,7 +376,7 @@ public class OptimizationEditorPanel extends JPanel implements ItemListener {
*/ (genericObjectEditor.getValue().getClass().getName()); */ (genericObjectEditor.getValue().getClass().getName());
boolean found = false; boolean found = false;
for (int i = 0; i < comboBoxModel.getSize(); i++) { for (int i = 0; i < comboBoxModel.getSize(); i++) {
if (objectName.equals((String) comboBoxModel.getElementAt(i))) { if (objectName.equals(comboBoxModel.getElementAt(i))) {
found = true; found = true;
break; break;
} }
@@ -408,7 +408,7 @@ public class OptimizationEditorPanel extends JPanel implements ItemListener {
if ((e.getSource() == objectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) { if ((e.getSource() == objectChooser) && (e.getStateChange() == ItemEvent.SELECTED)) {
className = (String) objectChooser.getSelectedItem(); className = (String) objectChooser.getSelectedItem();
try { try {
Object n = (Object) Class.forName(className).newInstance(); Object n = Class.forName(className).newInstance();
genericObjectEditor.setValue(n); genericObjectEditor.setValue(n);
// TODO ? setObject(n); // TODO ? setObject(n);
} catch (Exception ex) { } catch (Exception ex) {

View File

@@ -50,7 +50,7 @@ public class PropertyDoubleArray implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyDoubleArray(this); return new PropertyDoubleArray(this);
} }
/** /**

View File

@@ -25,6 +25,6 @@ public class PropertyEpsilonConstraint implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyEpsilonConstraint(this); return new PropertyEpsilonConstraint(this);
} }
} }

View File

@@ -30,6 +30,6 @@ public class PropertyEpsilonThreshold implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyEpsilonThreshold(this); return new PropertyEpsilonThreshold(this);
} }
} }

View File

@@ -53,7 +53,7 @@ public class PropertyFilePath implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyFilePath(this); return new PropertyFilePath(this);
} }
/** /**

View File

@@ -21,7 +21,7 @@ public class PropertyIntArray implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyIntArray(this); return new PropertyIntArray(this);
} }
/** /**

View File

@@ -27,7 +27,7 @@ public class PropertyOptimizationObjectives implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyOptimizationObjectives(this); return new PropertyOptimizationObjectives(this);
} }
/** /**

View File

@@ -39,7 +39,7 @@ public class PropertyOptimizationObjectivesWithParam implements java.io.Serializ
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyOptimizationObjectivesWithParam(this); return new PropertyOptimizationObjectivesWithParam(this);
} }
/** /**

View File

@@ -36,7 +36,7 @@ public class PropertySelectableList<T> implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertySelectableList<T>(this); return new PropertySelectableList<T>(this);
} }
public void setObjects(T[] o) { public void setObjects(T[] o) {

View File

@@ -5,7 +5,6 @@ import eva2.tools.EVAHELP;
import eva2.util.annotation.Description; import eva2.util.annotation.Description;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.table.DefaultTableModel; import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
@@ -1119,10 +1118,7 @@ class PropertyCellEditor extends AbstractCellEditor implements TableCellEditor {
int selectedColumn = sourceTable.getSelectedColumn(); int selectedColumn = sourceTable.getSelectedColumn();
String columnName = sourceTable.getColumnName(selectedColumn); String columnName = sourceTable.getColumnName(selectedColumn);
/* If the columnName equals Key it holds the keys */ /* If the columnName equals Key it holds the keys */
if ("Key".equals(columnName)) { return !"Key".equals(columnName);
return false;
}
return true;
} }

View File

@@ -1,17 +1,4 @@
package eva2.gui; package eva2.gui;
/*
* Title: EvA2
* Description:
* Copyright: Copyright (c) 2003
* Company: University of Tuebingen, Computer Architecture
* @author Holger Ulmer, Felix Streichert, Hannes Planatscher
* @version: $Revision: 10 $
* $Date: 2006-01-18 11:02:22 +0100 (Wed, 18 Jan 2006) $
* $Author: streiche $
*/
/*==========================================================================*
* IMPORTS
*==========================================================================*/
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@@ -35,7 +22,6 @@ public class PropertySheetPanelStat extends JPanel implements Serializable {
* Creates the property sheet panel. * Creates the property sheet panel.
*/ */
public PropertySheetPanelStat() { public PropertySheetPanelStat() {
// setBorder(BorderFactory.createLineBorder(Color.red));
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
} }
@@ -113,10 +99,10 @@ class JCheckBoxFlag extends JCheckBox {
@Override @Override
public void itemStateChanged(ItemEvent evt) { public void itemStateChanged(ItemEvent evt) {
if (evt.getStateChange() == evt.SELECTED) { if (evt.getStateChange() == ItemEvent.SELECTED) {
JCheckBoxFlag.this.flag = true; JCheckBoxFlag.this.flag = true;
} }
if (evt.getStateChange() == evt.DESELECTED) { if (evt.getStateChange() == ItemEvent.DESELECTED) {
JCheckBoxFlag.this.flag = false; JCheckBoxFlag.this.flag = false;
} }
} }

View File

@@ -30,6 +30,6 @@ public class PropertyWeightedLPTchebycheff implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new PropertyWeightedLPTchebycheff(this); return new PropertyWeightedLPTchebycheff(this);
} }
} }

View File

@@ -6,8 +6,6 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;
import java.beans.PropertyEditor; import java.beans.PropertyEditor;

View File

@@ -44,7 +44,7 @@ public class EnumEditor extends PropertyEditorSupport {
public void setAsText(String text) throws IllegalArgumentException { public void setAsText(String text) throws IllegalArgumentException {
for (int i = 0; i < enumConstants.length; i++) { for (int i = 0; i < enumConstants.length; i++) {
if (text.equals(enumConstants[i].toString())) { if (text.equals(enumConstants[i].toString())) {
setValue((Enum) enumConstants[i]); setValue(enumConstants[i]);
return; return;
} }
} }

View File

@@ -27,13 +27,13 @@ public class GenericAreaEditor extends AbstractListSelectionEditor {
@Override @Override
protected String getElementName(int i) { protected String getElementName(int i) {
AbstractGPNode an = (AbstractGPNode) areaObject.getCompleteList().get(i); AbstractGPNode an = areaObject.getCompleteList().get(i);
return an.getName(); return an.getName();
} }
@Override @Override
protected boolean isElementSelected(int i) { protected boolean isElementSelected(int i) {
return ((Boolean) areaObject.getBlackList().get(i)).booleanValue(); return areaObject.getBlackList().get(i).booleanValue();
} }
@Override @Override

View File

@@ -352,7 +352,6 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
ListCellRenderer lcr = new DefaultListCellRenderer(); ListCellRenderer lcr = new DefaultListCellRenderer();
if (editor != null) { if (editor != null) {
if (editor instanceof GenericObjectEditor) { if (editor instanceof GenericObjectEditor) {
// ((GenericObjectEditor) editor).getCustomEditor();
((GenericObjectEditor) editor).setClassType(elementClass); ((GenericObjectEditor) editor).setClassType(elementClass);
} }
if (editor.isPaintable() && editor.supportsCustomEditor()) { if (editor.isPaintable() && editor.supportsCustomEditor()) {
@@ -416,6 +415,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
// Upper Button Panel // Upper Button Panel
JPanel combiUpperPanel = new JPanel(getButtonLayout(1, upperButtonList)); JPanel combiUpperPanel = new JPanel(getButtonLayout(1, upperButtonList));
// ToDo Figure out how to now show this on Job Pane
combiUpperPanel.add(view); combiUpperPanel.add(view);
for (JButton but : upperButtonList) { for (JButton but : upperButtonList) {
@@ -692,7 +692,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
rep = listModel.getSize() + " of " + EVAHELP.cutClassName(elementClass.getName()); rep = listModel.getSize() + " of " + EVAHELP.cutClassName(elementClass.getName());
Object maybeName = BeanInspector.callIfAvailable(listModel.get(0), "getName", new Object[]{}); Object maybeName = BeanInspector.callIfAvailable(listModel.get(0), "getName", new Object[]{});
if (maybeName != null) { if (maybeName != null) {
rep = rep + " (" + (String) maybeName + "...)"; rep = rep + " (" + maybeName + "...)";
} }
} }
gfx.drawString(rep, 2, fm.getHeight() + vpad - 3); gfx.drawString(rep, 2, fm.getHeight() + vpad - 3);

View File

@@ -40,8 +40,7 @@ class MyFocusListener implements FocusListener {
arrEditor.notifyFocusID(myID); arrEditor.notifyFocusID(myID);
} }
; }
};
/** /**

View File

@@ -79,7 +79,7 @@ public class GenericObjectEditor implements PropertyEditor {
try { try {
// a field allowing a class to indicate it doesnt want to be displayed // a field allowing a class to indicate it doesnt want to be displayed
Field f = clazz.getDeclaredField("hideFromGOE"); Field f = clazz.getDeclaredField("hideFromGOE");
if (f.getBoolean(clazz) == true) { if (f.getBoolean(clazz)) {
LOGGER.log(Level.FINEST, "Class {0} wants to be hidden from GOE.", clazz); LOGGER.log(Level.FINEST, "Class {0} wants to be hidden from GOE.", clazz);
continue; continue;
} }
@@ -275,7 +275,7 @@ public class GenericObjectEditor implements PropertyEditor {
try { try {
if (v.size() > 0) { if (v.size() > 0) {
setObject((Object) Class.forName((String) v.get(0)).newInstance()); setObject(Class.forName((String) v.get(0)).newInstance());
} }
} catch (Exception ex) { } catch (Exception ex) {
System.err.println("Exception in setDefaultValue !!!" + ex.getMessage()); System.err.println("Exception in setDefaultValue !!!" + ex.getMessage());

View File

@@ -167,7 +167,7 @@ public class DPointSetMultiIcon extends DComponent {
} else { } else {
DPoint result = new DPoint(xMI.getImage(minIndex), DPoint result = new DPoint(xMI.getImage(minIndex),
yMI.getImage(minIndex)); yMI.getImage(minIndex));
result.setIcon((DPointIcon) this.iconsMI.get(minIndex)); result.setIcon(this.iconsMI.get(minIndex));
return result; return result;
} }
@@ -256,7 +256,7 @@ public class DPointSetMultiIcon extends DComponent {
if ((i < this.iconsMI.size()) && (this.iconsMI.get(i) != null)) { if ((i < this.iconsMI.size()) && (this.iconsMI.get(i) != null)) {
g.setStroke(new BasicStroke()); g.setStroke(new BasicStroke());
g.translate(p2.x, p2.y); g.translate(p2.x, p2.y);
((DPointIcon) this.iconsMI.get(i)).paint(g); this.iconsMI.get(i).paint(g);
g.translate(-p2.x, -p2.y); g.translate(-p2.x, -p2.y);
g.setStroke(strokeMI); g.setStroke(strokeMI);
} else { } else {
@@ -287,7 +287,7 @@ public class DPointSetMultiIcon extends DComponent {
if (this.iconsMI.get(i) != null) { if (this.iconsMI.get(i) != null) {
g.setStroke(new BasicStroke()); g.setStroke(new BasicStroke());
g.translate(p.x, p.y); g.translate(p.x, p.y);
((DPointIcon) this.iconsMI.get(i)).paint(g); this.iconsMI.get(i).paint(g);
g.translate(-p.x, -p.y); g.translate(-p.x, -p.y);
g.setStroke(strokeMI); g.setStroke(strokeMI);
} else { } else {

View File

@@ -122,7 +122,7 @@ public class FunctionArea extends DArea implements Serializable {
if (isShowGraphToolTips()) { if (isShowGraphToolTips()) {
int gIndex = getNearestGraphIndex(event.getX(), event.getY()); int gIndex = getNearestGraphIndex(event.getX(), event.getY());
if (gIndex >= 0) { if (gIndex >= 0) {
DPoint pt = ((GraphPointSet) (pointSetContainer.get(gIndex))).getMedPoint(); DPoint pt = pointSetContainer.get(gIndex).getMedPoint();
Point pt2 = getDMeasures().getPoint(pt.x, pt.y); Point pt2 = getDMeasures().getPoint(pt.x, pt.y);
pt2.x += (5 * (gIndex % 7)); // slight shift depending on index pt2.x += (5 * (gIndex % 7)); // slight shift depending on index
// - easier distinction of very // - easier distinction of very
@@ -395,7 +395,7 @@ public class FunctionArea extends DArea implements Serializable {
if (index == -1) { if (index == -1) {
return; return;
} }
int GraphLabel = ((GraphPointSet) (this.pointSetContainer.get(index))).getGraphLabel(); int GraphLabel = this.pointSetContainer.get(index).getGraphLabel();
changeColorGraph(GraphLabel); changeColorGraph(GraphLabel);
updateLegend(); updateLegend();
} }
@@ -406,7 +406,7 @@ public class FunctionArea extends DArea implements Serializable {
public void recolorAllGraphsByIndex() { public void recolorAllGraphsByIndex() {
int index = 0; int index = 0;
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
GraphPointSet gps = ((GraphPointSet) (this.pointSetContainer.get(i))); GraphPointSet gps = this.pointSetContainer.get(i);
if (gps.getPointCount() > 0) { if (gps.getPointCount() > 0) {
gps.setColorByIndex(index); gps.setColorByIndex(index);
index++; index++;
@@ -466,7 +466,7 @@ public class FunctionArea extends DArea implements Serializable {
public void clearAll() { public void clearAll() {
this.removeAllDElements(); this.removeAllDElements();
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
((GraphPointSet) (pointSetContainer.get(i))).removeAllPoints(); pointSetContainer.get(i).removeAllPoints();
} }
pointSetContainer.clear(); pointSetContainer.clear();
if (getYScale() instanceof Exp) { if (getYScale() instanceof Exp) {
@@ -496,7 +496,7 @@ public class FunctionArea extends DArea implements Serializable {
if (index == -1) { if (index == -1) {
return; return;
} }
int GraphLabel = ((GraphPointSet) (this.pointSetContainer.get(index))).getGraphLabel(); int GraphLabel = this.pointSetContainer.get(index).getGraphLabel();
clearGraph(GraphLabel); clearGraph(GraphLabel);
updateLegend(); updateLegend();
} }
@@ -658,7 +658,7 @@ public class FunctionArea extends DArea implements Serializable {
} }
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
if (pointSetContainer.get(i) instanceof GraphPointSet) { if (pointSetContainer.get(i) instanceof GraphPointSet) {
GraphPointSet set = (GraphPointSet) pointSetContainer.get(i); GraphPointSet set = pointSetContainer.get(i);
DPointSet pset = set.getConnectedPointSet(); DPointSet pset = set.getConnectedPointSet();
// add column names // add column names
s[0] = s[0] + " t " + cleanBlanks(set.getInfoString(), '_'); s[0] = s[0] + " t " + cleanBlanks(set.getInfoString(), '_');
@@ -737,7 +737,7 @@ public class FunctionArea extends DArea implements Serializable {
} }
int minindex = getNearestGraphIndex(x, y); int minindex = getNearestGraphIndex(x, y);
if (minindex >= 0) { if (minindex >= 0) {
return ((GraphPointSet) (pointSetContainer.get(minindex))).getInfoString(); return pointSetContainer.get(minindex).getInfoString();
} else { } else {
return "none"; return "none";
} }
@@ -750,7 +750,7 @@ public class FunctionArea extends DArea implements Serializable {
} }
if (graphIndex >= 0 && (graphIndex < pointSetContainer.size())) { if (graphIndex >= 0 && (graphIndex < pointSetContainer.size())) {
return ((GraphPointSet) (pointSetContainer.get(graphIndex))).getInfoString(); return pointSetContainer.get(graphIndex).getInfoString();
} else { } else {
return "none"; return "none";
} }
@@ -771,7 +771,7 @@ public class FunctionArea extends DArea implements Serializable {
private GraphPointSet getGraphPointSet(int GraphLabel) { private GraphPointSet getGraphPointSet(int GraphLabel) {
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
if (pointSetContainer.get(i) instanceof GraphPointSet) { if (pointSetContainer.get(i) instanceof GraphPointSet) {
GraphPointSet xx = (GraphPointSet) (pointSetContainer.get(i)); GraphPointSet xx = pointSetContainer.get(i);
// System.out.println("looking at "+xx.getGraphLabel()); // System.out.println("looking at "+xx.getGraphLabel());
if (xx.getGraphLabel() == GraphLabel) { if (xx.getGraphLabel() == GraphLabel) {
// System.out.println("match!"); // System.out.println("match!");
@@ -799,7 +799,7 @@ public class FunctionArea extends DArea implements Serializable {
double dist = 0; double dist = 0;
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
if (pointSetContainer.get(i) instanceof GraphPointSet) { if (pointSetContainer.get(i) instanceof GraphPointSet) {
GraphPointSet pointset = (GraphPointSet) (pointSetContainer.get(i)); GraphPointSet pointset = pointSetContainer.get(i);
point2 = pointset.getNearestDPoint(point1); point2 = pointset.getNearestDPoint(point1);
if (point2 == null) { if (point2 == null) {
continue; continue;
@@ -883,7 +883,7 @@ public class FunctionArea extends DArea implements Serializable {
return ret; return ret;
} }
int minindex = getNearestGraphIndex(x, y); int minindex = getNearestGraphIndex(x, y);
ret = ((GraphPointSet) (pointSetContainer.get(minindex))).isStatisticsGraph(); ret = pointSetContainer.get(minindex).isStatisticsGraph();
return ret; return ret;
} }
@@ -893,7 +893,7 @@ public class FunctionArea extends DArea implements Serializable {
*/ */
public void jump() { public void jump() {
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
((GraphPointSet) (pointSetContainer.get(i))).jump(); pointSetContainer.get(i).jump();
} }
} }
@@ -914,7 +914,7 @@ public class FunctionArea extends DArea implements Serializable {
System.out.println(""); System.out.println("");
System.out.println("GraphPointSet No " + i); System.out.println("GraphPointSet No " + i);
ret[i] = ((GraphPointSet) pointSetContainer.get(i)).printPoints(); ret[i] = pointSetContainer.get(i).printPoints();
} }
return ret; return ret;
@@ -928,7 +928,7 @@ public class FunctionArea extends DArea implements Serializable {
System.out.println(""); System.out.println("");
System.out.println("GraphPointSet No " + i); System.out.println("GraphPointSet No " + i);
return ((GraphPointSet) pointSetContainer.get(i)).printPoints(); return pointSetContainer.get(i).printPoints();
// } // }
} }
@@ -942,7 +942,7 @@ public class FunctionArea extends DArea implements Serializable {
if (index == -1 || point == null) { if (index == -1 || point == null) {
return; return;
} }
GraphPointSet pointset = (GraphPointSet) (this.pointSetContainer.get(index)); GraphPointSet pointset = this.pointSetContainer.get(index);
pointset.removePoint(point); pointset.removePoint(point);
} }
@@ -1080,7 +1080,7 @@ public class FunctionArea extends DArea implements Serializable {
} }
if (graphIndex >= 0 && (graphIndex < pointSetContainer.size())) { if (graphIndex >= 0 && (graphIndex < pointSetContainer.size())) {
GraphPointSet gps = ((GraphPointSet) (pointSetContainer.get(graphIndex))); GraphPointSet gps = pointSetContainer.get(graphIndex);
gps.setInfoString(newName); gps.setInfoString(newName);
updateLegend(); updateLegend();
return true; return true;

View File

@@ -194,7 +194,7 @@ public class GraphPointSet {
int[] index = new int[pointSetContainer.size()]; int[] index = new int[pointSetContainer.size()];
int[] GraphSize = new int[pointSetContainer.size()]; int[] GraphSize = new int[pointSetContainer.size()];
for (int i = 0; i < pointSetContainer.size(); i++) { for (int i = 0; i < pointSetContainer.size(); i++) {
GraphSize[i] = ((PointSet) pointSetContainer.get(i)).getSize(); GraphSize[i] = pointSetContainer.get(i).getSize();
if (GraphSize[i] <= 0) { if (GraphSize[i] <= 0) {
System.err.println("Warning: invalid graph size of " System.err.println("Warning: invalid graph size of "
+ GraphSize[i] + " at " + i + GraphSize[i] + " at " + i

View File

@@ -97,7 +97,7 @@ class PlotContainer extends ArrayList<GraphWindow> {
public boolean containsName(String name) { public boolean containsName(String name) {
GraphWindow temp; GraphWindow temp;
for (int i = 0; i < size(); i++) { for (int i = 0; i < size(); i++) {
temp = (GraphWindow) (get(i)); temp = get(i);
if (name.equals(temp.getName())) { if (name.equals(temp.getName())) {
return true; return true;
} }
@@ -123,7 +123,7 @@ class PlotContainer extends ArrayList<GraphWindow> {
} }
GraphWindow temp; GraphWindow temp;
for (int i = 0; i < size(); i++) { for (int i = 0; i < size(); i++) {
temp = (GraphWindow) (get(i)); temp = get(i);
if (name.equals(temp.getName())) { if (name.equals(temp.getName())) {
actualPlot = temp; actualPlot = temp;
return actualPlot; return actualPlot;

View File

@@ -69,7 +69,7 @@ public class ModuleServer {
Method[] methods = module.getDeclaredMethods(); Method[] methods = module.getDeclaredMethods();
for (Method method : methods) { for (Method method : methods) {
if (method.getName().equals("getName")) { if (method.getName().equals("getName")) {
String name = (String) method.invoke((Object[]) null, (Object[]) null); String name = (String) method.invoke(null, (Object[]) null);
if (name != null) { if (name != null) {
moduleNameList.add(name); moduleNameList.add(name);
} else { } else {
@@ -107,7 +107,7 @@ public class ModuleServer {
for (Method method : methods) { for (Method method : methods) {
if (method.getName().equals("getName")) { if (method.getName().equals("getName")) {
moduleName = (String) method.invoke((Object[]) null, (Object[]) null); moduleName = (String) method.invoke(null, (Object[]) null);
} }
} }
} catch (Exception ex) { } catch (Exception ex) {

View File

@@ -1,5 +1,5 @@
package eva2.optimization.enums; package eva2.optimization.enums;
public enum ESMutationInitialSigma { public enum ESMutationInitialSigma {
halfRange, quarterRange, avgInitialDistance, userDefined; halfRange, quarterRange, avgInitialDistance, userDefined
} }

View File

@@ -1,5 +1,5 @@
package eva2.optimization.enums; package eva2.optimization.enums;
public enum MutateESCrossoverTypeEnum { public enum MutateESCrossoverTypeEnum {
none, intermediate, discrete; none, intermediate, discrete
} }

View File

@@ -1,5 +1,5 @@
package eva2.optimization.enums; package eva2.optimization.enums;
public enum PostProcessMethod { public enum PostProcessMethod {
hillClimber, nelderMead, cmaES; hillClimber, nelderMead, cmaES
} }

View File

@@ -575,7 +575,7 @@ public class MOCCOStandalone implements InterfaceStandaloneOptimization, Interfa
double y = x / (double) ((EvaluationTerminator) this.state.terminator).getFitnessCalls(); double y = x / (double) ((EvaluationTerminator) this.state.terminator).getFitnessCalls();
currentProgress = (int) (population.getFunctionCalls() * y); currentProgress = (int) (population.getFunctionCalls() * y);
} else { } else {
currentProgress = (int) (0); currentProgress = 0;
} }
updateStatus("Optimizing...", currentProgress); updateStatus("Optimizing...", currentProgress);
} else { } else {

View File

@@ -308,7 +308,7 @@ public class StandaloneOptimization implements InterfaceStandaloneOptimization,
((GAIndividualDoubleData) tmpIndy).setCrossoverOperator(new CrossoverGAGINPoint()); ((GAIndividualDoubleData) tmpIndy).setCrossoverOperator(new CrossoverGAGINPoint());
((GAIndividualDoubleData) tmpIndy).setCrossoverProbability(1.0); ((GAIndividualDoubleData) tmpIndy).setCrossoverProbability(1.0);
((GAIndividualDoubleData) tmpIndy).setMutationProbability(1.0); ((GAIndividualDoubleData) tmpIndy).setMutationProbability(1.0);
((F1Problem) problem).setEAIndividual(tmpIndy); problem.setEAIndividual(tmpIndy);
//((FGRNInferringProblem)this.problem).setStructreSkelInterval(1); //((FGRNInferringProblem)this.problem).setStructreSkelInterval(1);
this.optimizationParameters.getOptimizer().setProblem(problem); this.optimizationParameters.getOptimizer().setProblem(problem);
this.optimizationParameters.getOptimizer().addPopulationChangedEventListener(this); this.optimizationParameters.getOptimizer().addPopulationChangedEventListener(this);
@@ -324,7 +324,7 @@ public class StandaloneOptimization implements InterfaceStandaloneOptimization,
F1Problem problem = new F1Problem(); F1Problem problem = new F1Problem();
tmpIndy = new ESIndividualDoubleData(); tmpIndy = new ESIndividualDoubleData();
((AbstractEAIndividual) tmpIndy).setMutationOperator(new MutateESLocal()); ((AbstractEAIndividual) tmpIndy).setMutationOperator(new MutateESLocal());
((F1Problem) problem).setEAIndividual(tmpIndy); problem.setEAIndividual(tmpIndy);
//((FGRNInferringProblem)this.problem).setUseHEigenMatrix(true); //((FGRNInferringProblem)this.problem).setUseHEigenMatrix(true);
//((FGRNInferringProblem)this.problem).setUseOnlyPositiveNumbers(true); //((FGRNInferringProblem)this.problem).setUseOnlyPositiveNumbers(true);
this.optimizationParameters.getOptimizer().setProblem(problem); this.optimizationParameters.getOptimizer().setProblem(problem);

View File

@@ -60,12 +60,12 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ESIndividualBinaryData(this); return new ESIndividualBinaryData(this);
} }
/** /**

View File

@@ -61,12 +61,12 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ESIndividualDoubleData(this); return new ESIndividualDoubleData(this);
} }
/** /**

View File

@@ -56,12 +56,12 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ESIndividualIntegerData(this); return new ESIndividualIntegerData(this);
} }
/** /**

View File

@@ -72,13 +72,13 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ESIndividualPermutationData(this); return new ESIndividualPermutationData(this);
} }
/** /**

View File

@@ -43,12 +43,12 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GAESIndividualBinaryDoubleData(this); return new GAESIndividualBinaryDoubleData(this);
} }
/** /**

View File

@@ -58,12 +58,12 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GAIndividualBinaryData(this); return new GAIndividualBinaryData(this);
} }
/** /**

View File

@@ -68,12 +68,12 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GAIndividualDoubleData(this); return new GAIndividualDoubleData(this);
} }
/** /**

View File

@@ -67,12 +67,12 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GAIndividualIntegerData(this); return new GAIndividualIntegerData(this);
} }

View File

@@ -40,12 +40,12 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GAPIndividualProgramData(this); return new GAPIndividualProgramData(this);
} }
/** /**

View File

@@ -104,12 +104,12 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GEIndividualProgramData(this); return new GEIndividualProgramData(this);
} }
/** /**

View File

@@ -66,12 +66,12 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GIIndividualIntegerData(this); return new GIIndividualIntegerData(this);
} }

View File

@@ -40,12 +40,12 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GIOBGAIndividualIntegerPermutationData(this); return new GIOBGAIndividualIntegerPermutationData(this);
} }
/** /**

View File

@@ -75,12 +75,12 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
for (int i = 0; i < this.fitness.length; i++) { for (int i = 0; i < this.fitness.length; i++) {
this.fitness[i] = individual.fitness[i]; this.fitness[i] = individual.fitness[i];
} }
cloneAEAObjects((AbstractEAIndividual) individual); cloneAEAObjects(individual);
} }
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPIndividualProgramData(this); return new GPIndividualProgramData(this);
} }
/** /**
@@ -328,11 +328,11 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
} else { } else {
AbstractGPNode parent = nodeToMutate.getParent(); AbstractGPNode parent = nodeToMutate.getParent();
if (checkMaxDepth && (nodeToMutate.getDepth() == maxAllowedDepth)) { // mutate with a constant if (checkMaxDepth && (nodeToMutate.getDepth() == maxAllowedDepth)) { // mutate with a constant
AbstractGPNode newNode = (AbstractGPNode) (((AbstractGPNode) this.gpArea[i].getRandomNodeWithArity(0).clone())); AbstractGPNode newNode = ((AbstractGPNode) this.gpArea[i].getRandomNodeWithArity(0).clone());
newNode.setDepth(nodeToMutate.getDepth()); newNode.setDepth(nodeToMutate.getDepth());
parent.setNode(newNode, nodeToMutate); parent.setNode(newNode, nodeToMutate);
} else { } else {
AbstractGPNode newNode = (AbstractGPNode) (((AbstractGPNode) this.gpArea[i].getRandomNode().clone())); AbstractGPNode newNode = ((AbstractGPNode) this.gpArea[i].getRandomNode().clone());
newNode.setDepth(nodeToMutate.getDepth()); newNode.setDepth(nodeToMutate.getDepth());
newNode.initGrow(this.gpArea[i], this.maxAllowedDepth); newNode.initGrow(this.gpArea[i], this.maxAllowedDepth);
parent.setNode(newNode, nodeToMutate); parent.setNode(newNode, nodeToMutate);

View File

@@ -592,19 +592,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
* @return True if MaxDepth is violated * @return True if MaxDepth is violated
*/ */
public boolean isMaxDepthViolated(int maxDepth) { public boolean isMaxDepthViolated(int maxDepth) {
if (maxDepth < this.getMaxDepth()) { return maxDepth < this.getMaxDepth();
return true;
} else {
return false;
}
// if (depth > this.depth) return false;
// else {
// boolean result = true;
// for (int i = 0; i < this.nodes.length; i++) {
// result = result & this.nodes[i].isMaxDepthViolated(depth);
// }
// return result;
// }
} }
/** /**

View File

@@ -126,7 +126,7 @@ public class GPArea implements java.io.Serializable {
public void compileReducedList() { public void compileReducedList() {
this.reducedList = new ArrayList<AbstractGPNode>(); this.reducedList = new ArrayList<AbstractGPNode>();
for (int i = 0; i < this.completeList.size(); i++) { for (int i = 0; i < this.completeList.size(); i++) {
if (((Boolean) (this.blackList.get(i))).booleanValue()) { if (this.blackList.get(i).booleanValue()) {
this.reducedList.add(this.completeList.get(i)); this.reducedList.add(this.completeList.get(i));
} }
} }
@@ -141,14 +141,14 @@ public class GPArea implements java.io.Serializable {
public AbstractGPNode getRandomNodeWithArity(int targetarity) { public AbstractGPNode getRandomNodeWithArity(int targetarity) {
ArrayList<AbstractGPNode> tmpArray = new ArrayList<AbstractGPNode>(); ArrayList<AbstractGPNode> tmpArray = new ArrayList<AbstractGPNode>();
for (int i = 0; i < this.reducedList.size(); i++) { for (int i = 0; i < this.reducedList.size(); i++) {
if (((AbstractGPNode) this.reducedList.get(i)).getArity() == targetarity) { if (this.reducedList.get(i).getArity() == targetarity) {
tmpArray.add(this.reducedList.get(i)); tmpArray.add(this.reducedList.get(i));
} }
} }
if (tmpArray.size() == 0) { if (tmpArray.size() == 0) {
return null; return null;
} else { } else {
return (AbstractGPNode) tmpArray.get(RNG.randomInt(0, tmpArray.size() - 1)); return tmpArray.get(RNG.randomInt(0, tmpArray.size() - 1));
} }
} }
@@ -159,7 +159,7 @@ public class GPArea implements java.io.Serializable {
if (this.reducedList.size() == 0) { if (this.reducedList.size() == 0) {
return null; return null;
} else { } else {
return (AbstractGPNode) this.reducedList.get(RNG.randomInt(0, this.reducedList.size() - 1)); return this.reducedList.get(RNG.randomInt(0, this.reducedList.size() - 1));
} }
} }
@@ -169,14 +169,14 @@ public class GPArea implements java.io.Serializable {
public AbstractGPNode getRandomNonTerminal() { public AbstractGPNode getRandomNonTerminal() {
ArrayList<AbstractGPNode> tmpArray = new ArrayList<AbstractGPNode>(); ArrayList<AbstractGPNode> tmpArray = new ArrayList<AbstractGPNode>();
for (int i = 0; i < this.reducedList.size(); i++) { for (int i = 0; i < this.reducedList.size(); i++) {
if (((AbstractGPNode) this.reducedList.get(i)).getArity() > 0) { if (this.reducedList.get(i).getArity() > 0) {
tmpArray.add(this.reducedList.get(i)); tmpArray.add(this.reducedList.get(i));
} }
} }
if (tmpArray.size() == 0) { if (tmpArray.size() == 0) {
return null; return null;
} else { } else {
return (AbstractGPNode) tmpArray.get(RNG.randomInt(0, tmpArray.size() - 1)); return tmpArray.get(RNG.randomInt(0, tmpArray.size() - 1));
} }
} }

View File

@@ -32,7 +32,7 @@ public class GPNodeAbs extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeAbs(this); return new GPNodeAbs(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeAdd(this); return new GPNodeAdd(this);
} }
/** /**

View File

@@ -36,7 +36,7 @@ public class GPNodeCos extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeCos(this); return new GPNodeCos(this);
} }
/** /**

View File

@@ -38,7 +38,7 @@ public class GPNodeDiv extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeDiv(this); return new GPNodeDiv(this);
} }
/** /**

View File

@@ -36,7 +36,7 @@ public class GPNodeExp extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeExp(this); return new GPNodeExp(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeFlowExec2 extends AbstractGPNode implements java.io.Serializa
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeFlowExec2(this); return new GPNodeFlowExec2(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeFlowExec3 extends AbstractGPNode implements java.io.Serializa
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeFlowExec3(this); return new GPNodeFlowExec3(this);
} }
/** /**

View File

@@ -38,10 +38,7 @@ public class GPNodeInput extends AbstractGPNode implements java.io.Serializable
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj instanceof GPNodeInput) { if (obj instanceof GPNodeInput) {
GPNodeInput node = (GPNodeInput) obj; GPNodeInput node = (GPNodeInput) obj;
if (!this.identifier.equalsIgnoreCase(node.identifier)) { return this.identifier.equalsIgnoreCase(node.identifier);
return false;
}
return true;
} else { } else {
return false; return false;
} }
@@ -64,7 +61,7 @@ public class GPNodeInput extends AbstractGPNode implements java.io.Serializable
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeInput(this); return new GPNodeInput(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeMult extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeMult(this); return new GPNodeMult(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeNeg extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeNeg(this); return new GPNodeNeg(this);
} }
/** /**

View File

@@ -20,6 +20,6 @@ public class GPNodeOne extends GPNodeConst implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeOne(this); return new GPNodeOne(this);
} }
} }

View File

@@ -39,10 +39,7 @@ public class GPNodeOutput extends AbstractGPNode implements java.io.Serializable
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj instanceof GPNodeOutput) { if (obj instanceof GPNodeOutput) {
GPNodeOutput node = (GPNodeOutput) obj; GPNodeOutput node = (GPNodeOutput) obj;
if (!this.identifier.equalsIgnoreCase(node.identifier)) { return this.identifier.equalsIgnoreCase(node.identifier);
return false;
}
return true;
} else { } else {
return false; return false;
} }
@@ -65,7 +62,7 @@ public class GPNodeOutput extends AbstractGPNode implements java.io.Serializable
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeOutput(this); return new GPNodeOutput(this);
} }
/** /**

View File

@@ -20,7 +20,7 @@ public class GPNodePi extends GPNodeConst implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodePi(this); return new GPNodePi(this);
} }
/** /**

View File

@@ -36,7 +36,7 @@ public class GPNodePow2 extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodePow2(this); return new GPNodePow2(this);
} }
/** /**

View File

@@ -36,7 +36,7 @@ public class GPNodePow3 extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodePow3(this); return new GPNodePow3(this);
} }
/** /**

View File

@@ -28,7 +28,7 @@ public class GPNodeProd extends AbstractGPNode implements java.io.Serializable {
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeProd(this); return new GPNodeProd(this);
} }
@Override @Override

View File

@@ -36,7 +36,7 @@ public class GPNodeSin extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeSin(this); return new GPNodeSin(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeSqrt extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeSqrt(this); return new GPNodeSqrt(this);
} }
/** /**

View File

@@ -37,7 +37,7 @@ public class GPNodeSub extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeSub(this); return new GPNodeSub(this);
} }
/** /**

View File

@@ -33,7 +33,7 @@ public class GPNodeSum extends AbstractGPNode implements java.io.Serializable {
*/ */
@Override @Override
public Object clone() { public Object clone() {
return (Object) new GPNodeSum(this); return new GPNodeSum(this);
} }
/** /**

View File

@@ -97,7 +97,7 @@ public class MOCCOProblemInitialization extends MOCCOPhase implements InterfaceP
mocco.parameterPanel.removeAll(); mocco.parameterPanel.removeAll();
Object n = null; Object n = null;
try { try {
n = (Object) Class.forName(className).newInstance(); n = Class.forName(className).newInstance();
} catch (Exception ex) { } catch (Exception ex) {
} }
mocco.state.originalProblem = (InterfaceOptimizationProblem) n; mocco.state.originalProblem = (InterfaceOptimizationProblem) n;

View File

@@ -90,11 +90,11 @@ public class DEParameters extends AbstractOptimizationParameters implements Inte
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((DifferentialEvolution) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((DifferentialEvolution) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -95,11 +95,11 @@ public class EPParameters extends AbstractOptimizationParameters implements Inte
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((EvolutionaryProgramming) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((EvolutionaryProgramming) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -93,11 +93,11 @@ public class GAParameters extends AbstractOptimizationParameters implements Inte
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((GeneticAlgorithm) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((GeneticAlgorithm) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -83,7 +83,7 @@ public class GenericModuleAdapter extends AbstractModuleAdapter implements Seria
} }
EvATabbedFrameMaker frmMkr = new EvATabbedFrameMaker(); EvATabbedFrameMaker frmMkr = new EvATabbedFrameMaker();
InterfaceStatisticsParameter Stat = ((StatisticsWithGUI) statisticsModule).getStatisticsParameter(); InterfaceStatisticsParameter Stat = statisticsModule.getStatisticsParameter();
EvAModuleButtonPanelMaker ButtonPanel = new EvAModuleButtonPanelMaker(remoteModuleAdapter, ((Processor) processor).isOptimizationRunning()); EvAModuleButtonPanelMaker ButtonPanel = new EvAModuleButtonPanelMaker(remoteModuleAdapter, ((Processor) processor).isOptimizationRunning());
ButtonPanel.setHelperFilename(helperFilename); ButtonPanel.setHelperFilename(helperFilename);
frmMkr.addPanelMaker(ButtonPanel); frmMkr.addPanelMaker(ButtonPanel);
@@ -110,7 +110,7 @@ public class GenericModuleAdapter extends AbstractModuleAdapter implements Seria
public void performedStart(String infoString) { public void performedStart(String infoString) {
super.performedStart(infoString); super.performedStart(infoString);
OptimizationJob job = scheduleJob(); OptimizationJob job = scheduleJob();
((AbstractStatistics) (((Processor) processor).getStatistics())).addDataListener(job); ((Processor) processor).getStatistics().addDataListener(job);
} }
@Override @Override

View File

@@ -90,11 +90,11 @@ public class HCParameters extends AbstractOptimizationParameters implements Inte
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((HillClimbing) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((HillClimbing) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -86,11 +86,11 @@ public class MCParameters extends AbstractOptimizationParameters implements Inte
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((MonteCarloSearch) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((MonteCarloSearch) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -76,11 +76,11 @@ public class MOEAParameters extends AbstractOptimizationParameters implements In
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((MultiObjectiveEA) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((MultiObjectiveEA) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {
@@ -146,21 +146,21 @@ public class MOEAParameters extends AbstractOptimizationParameters implements In
* @return The current optimizing method * @return The current optimizing method
*/ */
public int getArchiveSize() { public int getArchiveSize() {
Population archive = ((MultiObjectiveEA) this.optimizer).getPopulation().getArchive(); Population archive = this.optimizer.getPopulation().getArchive();
if (archive == null) { if (archive == null) {
archive = new Population(); archive = new Population();
((MultiObjectiveEA) this.optimizer).getPopulation().SetArchive(archive); this.optimizer.getPopulation().SetArchive(archive);
} }
return ((MultiObjectiveEA) this.optimizer).getArchiveSize(); return ((MultiObjectiveEA) this.optimizer).getArchiveSize();
} }
public void setArchiveSize(int b) { public void setArchiveSize(int b) {
Population archive = ((MultiObjectiveEA) this.optimizer).getPopulation().getArchive(); Population archive = this.optimizer.getPopulation().getArchive();
if (archive == null) { if (archive == null) {
archive = new Population(); archive = new Population();
((MultiObjectiveEA) this.optimizer).getPopulation().SetArchive(archive); this.optimizer.getPopulation().SetArchive(archive);
} }
((MultiObjectiveEA) this.optimizer).getPopulation().getArchive().setTargetSize(b); this.optimizer.getPopulation().getArchive().setTargetSize(b);
} }
public String archiveSizeTipText() { public String archiveSizeTipText() {

View File

@@ -81,11 +81,11 @@ public class PBILParameters extends AbstractOptimizationParameters implements In
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((PopulationBasedIncrementalLearning) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((PopulationBasedIncrementalLearning) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -81,11 +81,11 @@ public class PSOParameters extends AbstractOptimizationParameters implements Int
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((ParticleSwarmOptimization) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((ParticleSwarmOptimization) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -303,8 +303,8 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
// is called recursively. // is called recursively.
if (controllerOrSubControllable instanceof InterfaceParameterControl) { if (controllerOrSubControllable instanceof InterfaceParameterControl) {
args[0] = instance; args[0] = instance;
if (!((InterfaceParameterControl) controllerOrSubControllable instanceof ConstantParameters)) { if (!(controllerOrSubControllable instanceof ConstantParameters)) {
BeanInspector.callIfAvailable((InterfaceParameterControl) controllerOrSubControllable, methodName, args); BeanInspector.callIfAvailable(controllerOrSubControllable, methodName, args);
} }
} else { } else {
args[0] = controllerOrSubControllable; args[0] = controllerOrSubControllable;
@@ -312,8 +312,8 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
} }
} }
} else if (paramCtrlReturn instanceof InterfaceParameterControl) { } else if (paramCtrlReturn instanceof InterfaceParameterControl) {
if (!((InterfaceParameterControl) paramCtrlReturn instanceof ConstantParameters)) { if (!(paramCtrlReturn instanceof ConstantParameters)) {
BeanInspector.callIfAvailable((InterfaceParameterControl) paramCtrlReturn, methodName, args); BeanInspector.callIfAvailable(paramCtrlReturn, methodName, args);
} }
} }
} }
@@ -384,7 +384,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
public void registerPopulationStateChanged(Object source, String name) { public void registerPopulationStateChanged(Object source, String name) {
if (name.equals(Population.NEXT_GENERATION_PERFORMED)) { if (name.equals(Population.NEXT_GENERATION_PERFORMED)) {
statistics.createNextGenerationPerformed( statistics.createNextGenerationPerformed(
(PopulationInterface) this.optimizationParameters.getOptimizer().getPopulation(), this.optimizationParameters.getOptimizer().getPopulation(),
this.optimizationParameters.getOptimizer(), this.optimizationParameters.getOptimizer(),
getInformerList()); getInformerList());
if (optimizationStateListener != null) { if (optimizationStateListener != null) {
@@ -474,7 +474,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
} }
PostProcess.checkAccuracy((AbstractOptimizationProblem) optimizationParameters.getProblem(), resultPop, ppp.getAccuracies(), ppp.getAccAssumeConv(), PostProcess.checkAccuracy((AbstractOptimizationProblem) optimizationParameters.getProblem(), resultPop, ppp.getAccuracies(), ppp.getAccAssumeConv(),
-1, ppp.getAccMaxEval(), (SolutionHistogram[]) null, true, listener); -1, ppp.getAccMaxEval(), null, true, listener);
resultPop = PostProcess.postProcess(ppp, resultPop, (AbstractOptimizationProblem) optimizationParameters.getProblem(), listener); resultPop = PostProcess.postProcess(ppp, resultPop, (AbstractOptimizationProblem) optimizationParameters.getProblem(), listener);
resultPopulation = resultPop; resultPopulation = resultPop;

View File

@@ -83,11 +83,11 @@ public class SAParameters extends AbstractOptimizationParameters implements Seri
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((SimulatedAnnealing) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((SimulatedAnnealing) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -84,11 +84,11 @@ public class SSGAParameters extends AbstractOptimizationParameters implements In
* @return The population of current solutions to a given problem. * @return The population of current solutions to a given problem.
*/ */
public Population getPopulation() { public Population getPopulation() {
return ((SteadyStateGA) this.optimizer).getPopulation(); return this.optimizer.getPopulation();
} }
public void setPopulation(Population pop) { public void setPopulation(Population pop) {
((SteadyStateGA) this.optimizer).setPopulation(pop); this.optimizer.setPopulation(pop);
} }
public String populationTipText() { public String populationTipText() {

View File

@@ -68,11 +68,7 @@ public abstract class AbstractArchiving implements InterfaceArchiving, java.io.S
tmpFitness = ((AbstractEAIndividual) archive.get(i)).getFitness(); tmpFitness = ((AbstractEAIndividual) archive.get(i)).getFitness();
try { try {
for (int j = 0; j < indyFitness.length; j++) { for (int j = 0; j < indyFitness.length; j++) {
if (indyFitness[j] <= tmpFitness[j]) { isDominating &= indyFitness[j] <= tmpFitness[j];
isDominating &= true;
} else {
isDominating &= false;
}
} }
} catch (java.lang.ArrayIndexOutOfBoundsException e) { } catch (java.lang.ArrayIndexOutOfBoundsException e) {
//System.out.println("-------addIndividualToArchive-------("+indyFitness.length+"/"+tmpFitness.length+")"); //System.out.println("-------addIndividualToArchive-------("+indyFitness.length+"/"+tmpFitness.length+")");

View File

@@ -20,7 +20,7 @@ public class ArchivingAllDominating extends AbstractArchiving implements java.io
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingAllDominating(this); return new ArchivingAllDominating(this);
} }
/** /**

View File

@@ -35,7 +35,7 @@ public class ArchivingMaxiMin implements InterfaceArchiving, java.io.Serializabl
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingMaxiMin(this); return new ArchivingMaxiMin(this);
} }
/** /**

View File

@@ -20,7 +20,7 @@ public class ArchivingNSGA extends AbstractArchiving implements java.io.Serializ
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingNSGA(this); return new ArchivingNSGA(this);
} }
/** /**

View File

@@ -26,7 +26,7 @@ public class ArchivingNSGAII extends ArchivingNSGA implements java.io.Serializab
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingNSGAII(this); return new ArchivingNSGAII(this);
} }
/** /**

View File

@@ -28,7 +28,7 @@ public class ArchivingPESAII extends AbstractArchiving implements java.io.Serial
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingPESAII(this); return new ArchivingPESAII(this);
} }
/** /**

View File

@@ -29,7 +29,7 @@ public class ArchivingSPEAII extends AbstractArchiving implements java.io.Serial
@Override @Override
public Object clone() { public Object clone() {
return (Object) new ArchivingSPEAII(this); return new ArchivingSPEAII(this);
} }
/** /**

View File

@@ -17,7 +17,7 @@ public class InformationRetrievalInserting implements InterfaceInformationRetrie
@Override @Override
public Object clone() { public Object clone() {
return (Object) new InformationRetrievalInserting(this); return new InformationRetrievalInserting(this);
} }
/** /**

View File

@@ -21,7 +21,7 @@ public class InformationRetrievalNone implements InterfaceInformationRetrieval,
@Override @Override
public Object clone() { public Object clone() {
return (Object) new InformationRetrievalNone(this); return new InformationRetrievalNone(this);
} }
/** /**

View File

@@ -17,7 +17,7 @@ public class InformationRetrievalReplacing implements InterfaceInformationRetrie
@Override @Override
public Object clone() { public Object clone() {
return (Object) new InformationRetrievalReplacing(this); return new InformationRetrievalReplacing(this);
} }
/** /**

View File

@@ -21,7 +21,7 @@ public class RemoveSurplusIndividualsDynamicHyperCube implements InterfaceRemove
@Override @Override
public Object clone() { public Object clone() {
return (Object) new RemoveSurplusIndividualsDynamicHyperCube(this); return new RemoveSurplusIndividualsDynamicHyperCube(this);
} }
/** /**

View File

@@ -21,7 +21,7 @@ public class RemoveSurplusIndividualsSMetric implements InterfaceRemoveSurplusIn
@Override @Override
public Object clone() { public Object clone() {
return (Object) new RemoveSurplusIndividualsSMetric(this); return new RemoveSurplusIndividualsSMetric(this);
} }
/** /**

Some files were not shown because too many files have changed in this diff Show More