Merging MK revs. 488,489;
Moving EvAProperties from client to EvAInfo.
This commit is contained in:
parent
af72d1da39
commit
c99335c3e9
@ -1,5 +1,10 @@
|
|||||||
package eva2;
|
package eva2;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import eva2.tools.BasicResourceLoader;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main product and version information strings.
|
* Main product and version information strings.
|
||||||
*
|
*
|
||||||
@ -68,10 +73,11 @@ package eva2;
|
|||||||
* @author mkron
|
* @author mkron
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class EvAInfo {
|
public class EvAInfo {
|
||||||
public static final String productName = "EvA2";
|
public static final String productName = "EvA2";
|
||||||
public static final String productLongName = "Evolutionary Algorithms Workbench 2";
|
public static final String productLongName = "Evolutionary Algorithms Workbench 2";
|
||||||
public static final String versionNum = new String ("2.043");
|
// public static final String fullVersion = "2.043"; // moved to EvA2.props!
|
||||||
public static final String url = "http://www.ra.cs.uni-tuebingen.de/software/EvA2";
|
public static final String url = "http://www.ra.cs.uni-tuebingen.de/software/EvA2";
|
||||||
|
|
||||||
public static final String propertyFile = "resources/EvA2.props";
|
public static final String propertyFile = "resources/EvA2.props";
|
||||||
@ -83,4 +89,48 @@ public class EvAInfo {
|
|||||||
public static final String infoTitle = productName+" Information";
|
public static final String infoTitle = productName+" Information";
|
||||||
public static final String copyrightYear = "2010";
|
public static final String copyrightYear = "2010";
|
||||||
|
|
||||||
|
////////////// Property handling...
|
||||||
|
|
||||||
|
private static Properties EVA_PROPERTIES;
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
EVA_PROPERTIES = BasicResourceLoader.readProperties(EvAInfo.propertyFile);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
System.err.println("ERROR! Could not read the configuration file "+ EvAInfo.propertyFile);
|
||||||
|
System.err.println(ex.getMessage());
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
File f=new File(EvAInfo.iconLocation);
|
||||||
|
if (!f.exists()) {
|
||||||
|
System.err.println("Error: Could not find EvA2 resources. Did you copy the resources folder to working directory?");
|
||||||
|
System.exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getProperty(String key) {
|
||||||
|
String myVal = EVA_PROPERTIES.getProperty(key);
|
||||||
|
return myVal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Properties getProperties() {
|
||||||
|
return EVA_PROPERTIES;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setProperty(String key, String value) {
|
||||||
|
EVA_PROPERTIES.setProperty(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getVersion() {
|
||||||
|
String version = getProperty("EvA2Version");
|
||||||
|
if (version==null) System.err.println("ERROR, missing property EvA2Version!");
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String propDefaultModule() {
|
||||||
|
return getProperty("DefaultModule");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String propShowModules() {
|
||||||
|
return getProperty("ShowModules");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ public class ClassPreloader implements Runnable {
|
|||||||
if (clsNames !=null) {
|
if (clsNames !=null) {
|
||||||
for (int i = 0; i < clsNames.length; i++) {
|
for (int i = 0; i < clsNames.length; i++) {
|
||||||
if (TRACE) System.out.println("Preloading " + clsNames[i]);
|
if (TRACE) System.out.println("Preloading " + clsNames[i]);
|
||||||
GenericObjectEditor.getClassesFromClassPath(clsNames[i]);
|
GenericObjectEditor.getClassesFromClassPath(clsNames[i], null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,6 @@ import eva2.tools.jproxy.RemoteStateListener;
|
|||||||
public class EvAClient implements RemoteStateListener, Serializable {
|
public class EvAClient implements RemoteStateListener, Serializable {
|
||||||
private final int splashScreenTime = 1500;
|
private final int splashScreenTime = 1500;
|
||||||
private final int maxWindowMenuLength = 30;
|
private final int maxWindowMenuLength = 30;
|
||||||
private static Properties EVA_PROPERTIES;
|
|
||||||
|
|
||||||
public static boolean TRACE = false;
|
public static boolean TRACE = false;
|
||||||
|
|
||||||
@ -146,31 +145,6 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
} else return false;
|
} else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getProperty(String key) {
|
|
||||||
String myVal = EVA_PROPERTIES.getProperty(key);
|
|
||||||
return myVal;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Properties getProperties() {
|
|
||||||
return EVA_PROPERTIES;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setProperty(String key, String value) {
|
|
||||||
EVA_PROPERTIES.setProperty(key, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Statically loading Properties.
|
|
||||||
*/
|
|
||||||
static {
|
|
||||||
try {
|
|
||||||
EVA_PROPERTIES = BasicResourceLoader.readProperties(EvAInfo.propertyFile);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
System.err.println("Could not read the configuration file "+ EvAInfo.propertyFile);
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor of GUI of EvA2.
|
* Constructor of GUI of EvA2.
|
||||||
* Works as client for the EvA2 server.
|
* Works as client for the EvA2 server.
|
||||||
@ -298,7 +272,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
*/
|
*/
|
||||||
private void init(String hostName, String paramsFile, final Window parent) {
|
private void init(String hostName, String paramsFile, final Window parent) {
|
||||||
//EVA_EDITOR_PROPERTIES
|
//EVA_EDITOR_PROPERTIES
|
||||||
useDefaultModule = getProperty("DefaultModule");
|
useDefaultModule = EvAInfo.propDefaultModule();
|
||||||
|
|
||||||
if (useDefaultModule != null) {
|
if (useDefaultModule != null) {
|
||||||
useDefaultModule = useDefaultModule.trim();
|
useDefaultModule = useDefaultModule.trim();
|
||||||
@ -312,7 +286,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
try {
|
try {
|
||||||
m_Frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes));
|
m_Frame.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes));
|
||||||
} catch (java.lang.NullPointerException e) {
|
} catch (java.lang.NullPointerException e) {
|
||||||
System.out.println("Could not find EvA2 icon, please move resources folder to working directory!");
|
System.err.println("Could not find EvA2 icon, please move resources folder to working directory!");
|
||||||
}
|
}
|
||||||
// m_Frame.setTitle(EvAInfo.productName + " workbench");
|
// m_Frame.setTitle(EvAInfo.productName + " workbench");
|
||||||
|
|
||||||
@ -328,7 +302,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
m_ProgressBar = new JProgressBar();
|
m_ProgressBar = new JProgressBar();
|
||||||
m_Frame.getContentPane().add(m_ProgressBar, BorderLayout.SOUTH);
|
m_Frame.getContentPane().add(m_ProgressBar, BorderLayout.SOUTH);
|
||||||
|
|
||||||
if (getProperty("ShowModules") != null) showLoadModules = true;
|
if (EvAInfo.propShowModules() != null) showLoadModules = true;
|
||||||
else showLoadModules = false; // may be set to true again if default module couldnt be loaded
|
else showLoadModules = false; // may be set to true again if default module couldnt be loaded
|
||||||
|
|
||||||
createActions();
|
createActions();
|
||||||
@ -424,7 +398,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
sbuf.append(" - ");
|
sbuf.append(" - ");
|
||||||
sbuf.append(EvAInfo.productLongName);
|
sbuf.append(EvAInfo.productLongName);
|
||||||
sbuf.append(" - Version ");
|
sbuf.append(" - Version ");
|
||||||
sbuf.append(EvAInfo.versionNum);
|
sbuf.append(EvAInfo.getVersion());
|
||||||
sbuf.append("\n");
|
sbuf.append("\n");
|
||||||
sbuf.append("License: ");
|
sbuf.append("License: ");
|
||||||
sbuf.append(EvAInfo.LGPLFile);
|
sbuf.append(EvAInfo.LGPLFile);
|
||||||
@ -885,7 +859,7 @@ public class EvAClient implements RemoteStateListener, Serializable {
|
|||||||
"\n University of Tübingen\n Chair for Computer Architecture\n " +
|
"\n University of Tübingen\n Chair for Computer Architecture\n " +
|
||||||
"M. Kronfeld, H. Planatscher, M. de Paly, A. Dräger, F. Streichert, H. Ulmer\n " +
|
"M. Kronfeld, H. Planatscher, M. de Paly, A. Dräger, F. Streichert, H. Ulmer\n " +
|
||||||
// "H. Ulmer & F. Streichert & H. Planatscher & M. de Paly & M. Kronfeld\n" +
|
// "H. Ulmer & F. Streichert & H. Planatscher & M. de Paly & M. Kronfeld\n" +
|
||||||
"Prof. Dr. Andreas Zell \n (c) " + EvAInfo.copyrightYear + "\n Version " + EvAInfo.versionNum +
|
"Prof. Dr. Andreas Zell \n (c) " + EvAInfo.copyrightYear + "\n Version " + EvAInfo.getVersion()+
|
||||||
"\n URL: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
"\n URL: " + EvAInfo.url, EvAInfo.infoTitle, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,21 +15,17 @@ package eva2.client;
|
|||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
|
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.rmi.registry.Registry;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
|
import eva2.EvAInfo;
|
||||||
import eva2.gui.LogPanel;
|
import eva2.gui.LogPanel;
|
||||||
import eva2.server.EvAMainAdapter;
|
import eva2.server.EvAMainAdapter;
|
||||||
import eva2.server.EvAMainAdapterImpl;
|
import eva2.server.EvAMainAdapterImpl;
|
||||||
import eva2.server.RMIServerEvA;
|
|
||||||
import eva2.server.modules.ModuleAdapter;
|
import eva2.server.modules.ModuleAdapter;
|
||||||
import eva2.tools.jproxy.ComAdapter;
|
import eva2.tools.jproxy.ComAdapter;
|
||||||
import eva2.tools.jproxy.MainAdapter;
|
import eva2.tools.jproxy.MainAdapter;
|
||||||
import eva2.tools.jproxy.MainAdapterClient;
|
import eva2.tools.jproxy.MainAdapterClient;
|
||||||
import eva2.tools.jproxy.MainAdapterClientImpl;
|
|
||||||
import eva2.tools.jproxy.RMIConnection;
|
import eva2.tools.jproxy.RMIConnection;
|
||||||
import eva2.tools.jproxy.RMIInvocationHandler;
|
import eva2.tools.jproxy.RMIInvocationHandler;
|
||||||
import eva2.tools.jproxy.RMIProxyLocal;
|
|
||||||
|
|
||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* CLASS DECLARATION
|
* CLASS DECLARATION
|
||||||
@ -54,7 +50,7 @@ public class EvAComAdapter extends ComAdapter {
|
|||||||
public static EvAComAdapter getInstance() {
|
public static EvAComAdapter getInstance() {
|
||||||
if (m_instance==null) {
|
if (m_instance==null) {
|
||||||
m_instance = new EvAComAdapter();
|
m_instance = new EvAComAdapter();
|
||||||
m_instance.addServersFromProperties(EvAClient.getProperties());
|
m_instance.addServersFromProperties(EvAInfo.getProperties());
|
||||||
}
|
}
|
||||||
return (EvAComAdapter)m_instance;
|
return (EvAComAdapter)m_instance;
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package eva2.gui;
|
|||||||
|
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Component;
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
@ -11,24 +12,22 @@ import java.awt.event.ItemListener;
|
|||||||
import java.beans.PropertyChangeEvent;
|
import java.beans.PropertyChangeEvent;
|
||||||
import java.beans.PropertyChangeListener;
|
import java.beans.PropertyChangeListener;
|
||||||
import java.beans.PropertyChangeSupport;
|
import java.beans.PropertyChangeSupport;
|
||||||
import java.io.BufferedInputStream;
|
import java.lang.reflect.Method;
|
||||||
import java.io.BufferedOutputStream;
|
import java.lang.reflect.Modifier;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.ObjectInputStream;
|
|
||||||
import java.io.ObjectOutputStream;
|
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.DefaultComboBoxModel;
|
import javax.swing.DefaultComboBoxModel;
|
||||||
import javax.swing.JButton;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JComboBox;
|
import javax.swing.JComboBox;
|
||||||
import javax.swing.JFileChooser;
|
import javax.swing.JList;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.plaf.basic.BasicComboBoxRenderer;
|
||||||
|
|
||||||
import eva2.server.go.tools.FileTools;
|
import eva2.server.go.tools.FileTools;
|
||||||
import eva2.tools.EVAHELP;
|
import eva2.tools.EVAHELP;
|
||||||
@ -58,8 +57,10 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
/** edit source button */
|
/** edit source button */
|
||||||
// private JButton m_editSourceBut;
|
// private JButton m_editSourceBut;
|
||||||
/** Creates the GUI editor component */
|
/** Creates the GUI editor component */
|
||||||
private Vector<String> m_ClassesLongName;
|
// private Vector<String> m_ClassesLongName;
|
||||||
private GenericObjectEditor m_goe = null;
|
private GenericObjectEditor m_goe = null;
|
||||||
|
private boolean withComboBoxToolTips = true; // should tool tips for the combo box be created?
|
||||||
|
private int tipMaxLen = 100; // maximum length of tool tip
|
||||||
// private String[] m_ClassesShortName;
|
// private String[] m_ClassesShortName;
|
||||||
// private SourceCodeEditor m_SourceCodeEditor;
|
// private SourceCodeEditor m_SourceCodeEditor;
|
||||||
// private PropertyDialog m_SourceCodeEditorFrame;
|
// private PropertyDialog m_SourceCodeEditorFrame;
|
||||||
@ -256,21 +257,42 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
*/
|
*/
|
||||||
protected void updateClassType() {
|
protected void updateClassType() {
|
||||||
if (TRACE) System.out.println("# updating class "+m_goe.getClassType().getName());
|
if (TRACE) System.out.println("# updating class "+m_goe.getClassType().getName());
|
||||||
|
Vector<String> classesLongNames;
|
||||||
|
ArrayList<Class<?>> instances = new ArrayList<Class<?>>(5);
|
||||||
if (Proxy.isProxyClass(m_goe.getClassType())) {
|
if (Proxy.isProxyClass(m_goe.getClassType())) {
|
||||||
if (TRACE) System.out.println("PROXY! original was " + ((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_goe.getValue()))).getOriginalClass().getName());
|
if (TRACE) System.out.println("PROXY! original was " + ((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_goe.getValue()))).getOriginalClass().getName());
|
||||||
m_ClassesLongName = new Vector<String>(GenericObjectEditor.getClassesFromProperties(((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_goe.getValue()))).getOriginalClass().getName()));
|
classesLongNames = new Vector<String>(GenericObjectEditor.getClassesFromProperties(((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_goe.getValue()))).getOriginalClass().getName(), null));
|
||||||
} else {
|
} else {
|
||||||
m_ClassesLongName = new Vector<String>(GenericObjectEditor.getClassesFromProperties(m_goe.getClassType().getName()));
|
classesLongNames = new Vector<String>(GenericObjectEditor.getClassesFromProperties(m_goe.getClassType().getName(), instances));
|
||||||
}
|
}
|
||||||
m_ObjectChooser.setModel(new DefaultComboBoxModel(m_ClassesLongName));
|
if (classesLongNames.size() > 1) {
|
||||||
if (m_ClassesLongName.size() > 1) // testhu
|
m_ObjectChooser.setModel(new DefaultComboBoxModel(classesLongNames));
|
||||||
|
if (withComboBoxToolTips) m_ObjectChooser.setRenderer(new ToolTipComboBoxRenderer(collectComboToolTips(instances, tipMaxLen) ));
|
||||||
add(m_ObjectChooser, BorderLayout.NORTH);
|
add(m_ObjectChooser, BorderLayout.NORTH);
|
||||||
else
|
} else remove(m_ObjectChooser);
|
||||||
remove(m_ObjectChooser);
|
|
||||||
if (TRACE) System.out.println("# done updating class "+m_goe.getClassType().getName());
|
if (TRACE) System.out.println("# done updating class "+m_goe.getClassType().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String[] collectComboToolTips(List<Class<?>> instances, int maxLen) {
|
||||||
|
String[] tips = new String[instances.size()];
|
||||||
|
for (int i=0; i<tips.length; i++) {
|
||||||
|
tips[i]=null;
|
||||||
|
Class[] classParams = new Class[]{};
|
||||||
|
try {
|
||||||
|
String tip=null;
|
||||||
|
Method giMeth = instances.get(i).getDeclaredMethod("globalInfo", classParams);
|
||||||
|
if (Modifier.isStatic(giMeth.getModifiers())) {
|
||||||
|
tip = (String)giMeth.invoke(null, (Object[])null);
|
||||||
|
}
|
||||||
|
if (tip!=null) {
|
||||||
|
if (tip.length()<=maxLen) tips[i]=tip;
|
||||||
|
else tips[i] = tip.substring(0,maxLen-2)+"..";
|
||||||
|
}
|
||||||
|
} catch (Exception e) {}
|
||||||
|
}
|
||||||
|
return tips;
|
||||||
|
}
|
||||||
|
|
||||||
protected void updateChooser() {
|
protected void updateChooser() {
|
||||||
String objectName = /*EVAHELP.cutClassName*/ (m_goe.getValue().getClass().getName());
|
String objectName = /*EVAHELP.cutClassName*/ (m_goe.getValue().getClass().getName());
|
||||||
boolean found = false;
|
boolean found = false;
|
||||||
@ -386,5 +408,32 @@ public class GOEPanel extends JPanel implements ItemListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // end of inner class
|
}
|
||||||
|
|
||||||
|
class ToolTipComboBoxRenderer extends BasicComboBoxRenderer {
|
||||||
|
private static final long serialVersionUID = -5781643352198561208L;
|
||||||
|
String[] toolTips = null;
|
||||||
|
|
||||||
|
public ToolTipComboBoxRenderer(String[] tips) {
|
||||||
|
super();
|
||||||
|
toolTips=tips;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Component getListCellRendererComponent(JList list, Object value,
|
||||||
|
int index, boolean isSelected, boolean cellHasFocus) {
|
||||||
|
if (isSelected) {
|
||||||
|
setBackground(list.getSelectionBackground());
|
||||||
|
setForeground(list.getSelectionForeground());
|
||||||
|
if ((toolTips!=null) && (index >= 0)) {
|
||||||
|
if (toolTips[index]!=null) list.setToolTipText(toolTips[index]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setBackground(list.getBackground());
|
||||||
|
setForeground(list.getForeground());
|
||||||
|
}
|
||||||
|
setFont(list.getFont());
|
||||||
|
setText((value == null) ? "" : value.toString());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -53,14 +53,14 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
/**
|
/**
|
||||||
* Read the classes available for user selection from the properties or the classpath respectively
|
* Read the classes available for user selection from the properties or the classpath respectively
|
||||||
*/
|
*/
|
||||||
public static ArrayList<String> getClassesFromProperties(String className) {
|
public static ArrayList<String> getClassesFromProperties(String className, ArrayList<Class<?>> instances) {
|
||||||
if (TRACE) System.out.println("getClassesFromProperties - requesting className: "+className);
|
if (TRACE) System.out.println("getClassesFromProperties - requesting className: "+className);
|
||||||
|
|
||||||
// Try to read the predefined classes from the props file.
|
// Try to read the predefined classes from the props file.
|
||||||
String typeOptions = EvAClient.getProperty(className);
|
String typeOptions = EvAInfo.getProperty(className);
|
||||||
if (typeOptions == null) {
|
if (typeOptions == null) {
|
||||||
// If none are defined, all assignable classes are searched the hard way, using the ReflectPackage
|
// If none are defined, all assignable classes are searched the hard way, using the ReflectPackage
|
||||||
return getClassesFromClassPath(className);
|
return getClassesFromClassPath(className, instances);
|
||||||
} else {
|
} else {
|
||||||
StringTokenizer st = new StringTokenizer(typeOptions, ", ");
|
StringTokenizer st = new StringTokenizer(typeOptions, ", ");
|
||||||
ArrayList<String> classes = new ArrayList<String>();
|
ArrayList<String> classes = new ArrayList<String>();
|
||||||
@ -68,7 +68,8 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
String current = st.nextToken().trim();
|
String current = st.nextToken().trim();
|
||||||
//System.out.println("current ="+current);
|
//System.out.println("current ="+current);
|
||||||
try {
|
try {
|
||||||
Class.forName(current); // test for instantiability
|
Class<?> clz = Class.forName(current); // test for instantiability
|
||||||
|
if (instances!=null) instances.add(clz);
|
||||||
classes.add(current);
|
classes.add(current);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
System.err.println("Couldn't load class with name: " + current);
|
System.err.println("Couldn't load class with name: " + current);
|
||||||
@ -90,7 +91,7 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
* @param className
|
* @param className
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static ArrayList<String> getClassesFromClassPath(String className) {
|
public static ArrayList<String> getClassesFromClassPath(String className, ArrayList<Class<?>> instances) {
|
||||||
ArrayList<String> classes = new ArrayList<String>();
|
ArrayList<String> classes = new ArrayList<String>();
|
||||||
Class<?>[] clsArr;
|
Class<?>[] clsArr;
|
||||||
clsArr=ReflectPackage.getAssignableClasses(className, true, true);
|
clsArr=ReflectPackage.getAssignableClasses(className, true, true);
|
||||||
@ -119,6 +120,7 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
try {
|
try {
|
||||||
Class<?>[] params = new Class[0];
|
Class<?>[] params = new Class[0];
|
||||||
class1.getConstructor(params);
|
class1.getConstructor(params);
|
||||||
|
if (instances!=null) instances.add(class1);
|
||||||
classes.add(class1.getName());
|
classes.add(class1.getName());
|
||||||
} catch (NoSuchMethodException e) {
|
} catch (NoSuchMethodException e) {
|
||||||
System.err.println("GOE warning: Class " + class1.getName() + " has no default constructor, skipping...");
|
System.err.println("GOE warning: Class " + class1.getName() + " has no default constructor, skipping...");
|
||||||
@ -264,9 +266,9 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
Vector<String> v=null;
|
Vector<String> v=null;
|
||||||
if (Proxy.isProxyClass(m_ClassType)) {
|
if (Proxy.isProxyClass(m_ClassType)) {
|
||||||
if (TRACE) System.out.println("PROXY! original was " + ((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_Object))).getOriginalClass().getName());
|
if (TRACE) System.out.println("PROXY! original was " + ((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_Object))).getOriginalClass().getName());
|
||||||
v = new Vector<String>(getClassesFromProperties(((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_Object))).getOriginalClass().getName()));
|
v = new Vector<String>(getClassesFromProperties(((RMIProxyLocal)Proxy.getInvocationHandler(((Proxy)m_Object))).getOriginalClass().getName(), null));
|
||||||
} else {
|
} else {
|
||||||
v = new Vector<String>(getClassesFromProperties(m_ClassType.getName()));
|
v = new Vector<String>(getClassesFromProperties(m_ClassType.getName(), null));
|
||||||
}
|
}
|
||||||
|
|
||||||
// v = new Vector<String>(getClassesFromProperties(m_ClassType.getName()));
|
// v = new Vector<String>(getClassesFromProperties(m_ClassType.getName()));
|
||||||
@ -288,7 +290,7 @@ public class GenericObjectEditor implements PropertyEditor {
|
|||||||
public void setValue(Object o) {
|
public void setValue(Object o) {
|
||||||
//System.err.println("setValue()" + m_ClassType.toString());
|
//System.err.println("setValue()" + m_ClassType.toString());
|
||||||
|
|
||||||
if (m_ClassType == null) {
|
if (o==null || m_ClassType == null) {
|
||||||
System.err.println("No ClassType set up for GenericObjectEditor!!");
|
System.err.println("No ClassType set up for GenericObjectEditor!!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -776,7 +776,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
|
|||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
}
|
}
|
||||||
if (TRACE) System.out.println("# cmp " + BeanInspector.toString(o) + "\n# vs. " + BeanInspector.toString(m_Values[i]));
|
if (TRACE) System.out.println("# cmp " + BeanInspector.toString(o) + "\n# vs. " + BeanInspector.toString(m_Values[i]));
|
||||||
if (o == m_Values[i] && (BeanInspector.isJavaPrimitive(o.getClass()))) {
|
if ((o!=null) && o == m_Values[i] && (BeanInspector.isJavaPrimitive(o.getClass()))) {
|
||||||
// The property is equal to its old value.
|
// The property is equal to its old value.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ package eva2.server;
|
|||||||
/*==========================================================================*
|
/*==========================================================================*
|
||||||
* IMPORTS
|
* IMPORTS
|
||||||
*==========================================================================*/
|
*==========================================================================*/
|
||||||
import eva2.client.EvAClient;
|
import eva2.EvAInfo;
|
||||||
import eva2.server.modules.ModuleAdapter;
|
import eva2.server.modules.ModuleAdapter;
|
||||||
import eva2.tools.jproxy.MainAdapterClient;
|
import eva2.tools.jproxy.MainAdapterClient;
|
||||||
import eva2.tools.jproxy.MainAdapterImpl;
|
import eva2.tools.jproxy.MainAdapterImpl;
|
||||||
@ -27,7 +27,7 @@ public class EvAMainAdapterImpl extends MainAdapterImpl implements EvAMainAdapte
|
|||||||
|
|
||||||
public EvAMainAdapterImpl() {
|
public EvAMainAdapterImpl() {
|
||||||
super();
|
super();
|
||||||
m_ModulServer = new ModuleServer(EvAClient.getProperties());
|
m_ModulServer = new ModuleServer(EvAInfo.getProperties());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getModuleNameList() {
|
public String[] getModuleNameList() {
|
||||||
|
@ -41,7 +41,7 @@ public class EvAServer {
|
|||||||
// m_InsideClient = insideClient;
|
// m_InsideClient = insideClient;
|
||||||
// m_Restart = Restart;
|
// m_Restart = Restart;
|
||||||
System.out.println ("*******************************************************************************");
|
System.out.println ("*******************************************************************************");
|
||||||
System.out.println ("This is EvA Server Version: "+ EvAInfo.versionNum);
|
System.out.println ("This is EvA Server Version: "+ EvAInfo.getVersion());
|
||||||
//System.out.println ("Java Version: " + System.getProperty("java.version") );
|
//System.out.println ("Java Version: " + System.getProperty("java.version") );
|
||||||
System.out.println ("*******************************************************************************");
|
System.out.println ("*******************************************************************************");
|
||||||
m_UserName = System.getProperty("user.name");
|
m_UserName = System.getProperty("user.name");
|
||||||
|
@ -181,7 +181,8 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
|
|||||||
}
|
}
|
||||||
if ((object != null) && (editor != null)) paraPanel.registerEditor(object, editor);
|
if ((object != null) && (editor != null)) paraPanel.registerEditor(object, editor);
|
||||||
this.m_O1 = (paraPanel.makePanel());
|
this.m_O1 = (paraPanel.makePanel());
|
||||||
EvAClient.setProperty("eva2.server.oa.go.Tools.InterfaceTest", "eva2.server.oa.go.Tools.Test1,eva2.server.oa.go.Tools.Test2");
|
// TODO this is defunct anyways... (MK, 2010-03)
|
||||||
|
// EvAClient.setProperty("eva2.server.oa.go.Tools.InterfaceTest", "eva2.server.oa.go.Tools.Test1,eva2.server.oa.go.Tools.Test2");
|
||||||
this.m_OptionsPanel = new JTabbedPane();
|
this.m_OptionsPanel = new JTabbedPane();
|
||||||
JParaPanel paraPanel2 = new JParaPanel(this.m_GO, "MyGUI");
|
JParaPanel paraPanel2 = new JParaPanel(this.m_GO, "MyGUI");
|
||||||
this.m_O2 = (paraPanel2.makePanel());
|
this.m_O2 = (paraPanel2.makePanel());
|
||||||
@ -624,7 +625,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a simple example framework for Evolutionary Algorithms.";
|
return "This is a simple example framework for Evolutionary Algorithms.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ public interface InterfaceGOParameters {
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo();
|
// public String globalInfo();
|
||||||
|
|
||||||
/** This method allows you to serialize the current parameters into a *.ser file
|
/** This method allows you to serialize the current parameters into a *.ser file
|
||||||
*/
|
*/
|
||||||
|
@ -612,15 +612,15 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
|
|||||||
boolean result = true;
|
boolean result = true;
|
||||||
int i=0;
|
int i=0;
|
||||||
while (result && (i < fit1.length) && (i < fit2.length)) {
|
while (result && (i < fit1.length) && (i < fit2.length)) {
|
||||||
if (firstIsFiniteAndLarger(fit1[i], fit2[i])) result = false;
|
if (firstIsFiniteAndLargerOrEqual(fit1[i], fit2[i])) result = false;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean firstIsFiniteAndLarger(double a, double b) {
|
private static boolean firstIsFiniteAndLargerOrEqual(double a, double b) {
|
||||||
if (Double.isNaN(a) || Double.isInfinite(a)) return false;
|
if (Double.isNaN(a) || Double.isInfinite(a)) return false;
|
||||||
else return (a > b);
|
else return (a >= b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -160,7 +160,7 @@ public class AbstractEAIndividualComparator implements Comparator<Object>, Seria
|
|||||||
return "Activate preference of feasible individuals in any comparison acc. to Deb's rules.";
|
return "Activate preference of feasible individuals in any comparison acc. to Deb's rules.";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "A comparator class for general EA individuals. Compares individuals based on their fitness in context of minimization.";
|
return "A comparator class for general EA individuals. Compares individuals based on their fitness in context of minimization.";
|
||||||
}
|
}
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -270,7 +270,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an ES individual adopted to optimize binary values.";
|
return "This is an ES individual adopted to optimize binary values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an ES individual suited to optimize double values.";
|
return "This is an ES individual suited to optimize double values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an ES individual suited to optimize integer values.";
|
return "This is an ES individual suited to optimize integer values.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -360,7 +360,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an ES individual suited to optimize permutations.";
|
return "This is an ES individual suited to optimize permutations.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a mixed data type combining a BitSet and a real-valued vector.";
|
return "This is a mixed data type combining a BitSet and a real-valued vector.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GA individual suited to optimize binary values.";
|
return "This is a GA individual suited to optimize binary values.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GA individual suited to optimize double values.";
|
return "This is a GA individual suited to optimize double values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -392,7 +392,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GA individual suited to optimize int values.";
|
return "This is a GA individual suited to optimize int values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -596,7 +596,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GE individual suited to optimize programs.";
|
return "This is a GE individual suited to optimize programs.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GI individual suited to optimize int values.";
|
return "This is a GI individual suited to optimize int values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,7 +308,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a mixed data type combining an integer vector with a permutation vector.";
|
return "This is a mixed data type combining an integer vector with a permutation vector.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GP individual suited to optimize Koza style program trees.";
|
return "This is a GP individual suited to optimize Koza style program trees.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a GA individual coding permutations.";
|
return "This is a GA individual coding permutations.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
|
|||||||
* @return a list of available AbstractGPNode implementations
|
* @return a list of available AbstractGPNode implementations
|
||||||
*/
|
*/
|
||||||
public static Vector<AbstractGPNode> getNodeTypes() {
|
public static Vector<AbstractGPNode> getNodeTypes() {
|
||||||
ArrayList<String>cls = GenericObjectEditor.getClassesFromClassPath(AbstractGPNode.class.getCanonicalName());
|
ArrayList<String>cls = GenericObjectEditor.getClassesFromClassPath(AbstractGPNode.class.getCanonicalName(), null);
|
||||||
Vector<AbstractGPNode> nodeTypes = new Vector<AbstractGPNode>(cls.size());
|
Vector<AbstractGPNode> nodeTypes = new Vector<AbstractGPNode>(cls.size());
|
||||||
for (int i=0; i<cls.size(); i++) {
|
for (int i=0; i<cls.size(); i++) {
|
||||||
try {
|
try {
|
||||||
|
@ -67,7 +67,7 @@ public class ArchivingAllDominating extends AbstractArchiving implements java.io
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a straightforward strategy, which selects all dominating individuals (very prone to generate OutOfMemory errors).";
|
return "This is a straightforward strategy, which selects all dominating individuals (very prone to generate OutOfMemory errors).";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -85,7 +85,7 @@ public class ArchivingMaxiMin implements InterfaceArchiving, java.io.Serializabl
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Maxi Min Archiving.";
|
return "Maxi Min Archiving.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
@ -185,7 +185,7 @@ public class ArchivingMaxiMin implements InterfaceArchiving, java.io.Serializabl
|
|||||||
// /** This method returns a global info string
|
// /** This method returns a global info string
|
||||||
// * @return description
|
// * @return description
|
||||||
// */
|
// */
|
||||||
// public String globalInfo() {
|
// public static String globalInfo() {
|
||||||
// return "Maxi Min Archiving.";
|
// return "Maxi Min Archiving.";
|
||||||
// }
|
// }
|
||||||
// /** This method will return a naming String
|
// /** This method will return a naming String
|
||||||
|
@ -58,7 +58,7 @@ public class ArchivingNSGA extends AbstractArchiving implements java.io.Serializ
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Non-dominating sorting GA revision 1.0.";
|
return "Non-dominating sorting GA revision 1.0.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -178,7 +178,7 @@ public class ArchivingNSGAII extends ArchivingNSGA implements java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Non-dominating sorting GA revision 2.0.";
|
return "Non-dominating sorting GA revision 2.0.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -267,7 +267,7 @@ public class ArchivingPESAII extends AbstractArchiving implements java.io.Serial
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Pareto Envelope-based Selection Algorithm revision 2.0.";
|
return "Pareto Envelope-based Selection Algorithm revision 2.0.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -548,7 +548,7 @@ public class ArchivingSPEAII extends AbstractArchiving implements java.io.Serial
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Strength Pareto EA revision 2.0. The variable k to calculate the k-th distance is given by max(2, sqrt(archive.size())).";
|
return "Strength Pareto EA revision 2.0. The variable k to calculate the k-th distance is given by max(2, sqrt(archive.size())).";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -47,7 +47,7 @@ public class InformationRetrievalInserting implements InterfaceInformationRetrie
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This Information Retrieval will insert the archive into current population by replacing random individuals if necessary.";
|
return "This Information Retrieval will insert the archive into current population by replacing random individuals if necessary.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -36,7 +36,7 @@ public class InformationRetrievalNone implements InterfaceInformationRetrieval,
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This implements a deactivated Information Retrieval.";
|
return "This implements a deactivated Information Retrieval.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -47,7 +47,7 @@ public class InformationRetrievalReplacing implements InterfaceInformationRetrie
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This Information Retrieval will replace the current population by the archive.";
|
return "This Information Retrieval will replace the current population by the archive.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -477,7 +477,7 @@ public class ClassificationSelfOrganizingMaps implements java.io.Serializable, I
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The Self-Organizing Maps, have been proposed by Kohonen (read this book on SOMs for further details).";
|
return "The Self-Organizing Maps, have been proposed by Kohonen (read this book on SOMs for further details).";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ public class ClusteringDensityBased implements InterfaceClustering, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "A density-based clustering algorithm (DBSCAN).";
|
return "A density-based clustering algorithm (DBSCAN).";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
132
src/eva2/server/go/operators/cluster/ClusteringDynPeakIdent.java
Normal file
132
src/eva2/server/go/operators/cluster/ClusteringDynPeakIdent.java
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
package eva2.server.go.operators.cluster;
|
||||||
|
|
||||||
|
import eva2.gui.BeanInspector;
|
||||||
|
import eva2.server.go.individuals.AbstractEAIndividual;
|
||||||
|
import eva2.server.go.operators.distancemetric.InterfaceDistanceMetric;
|
||||||
|
import eva2.server.go.operators.distancemetric.PhenotypeMetric;
|
||||||
|
import eva2.server.go.populations.Population;
|
||||||
|
import eva2.tools.Pair;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clustering using the DPI mechanism (dynamic peak identification).
|
||||||
|
* Collect a number of peaks, which are the fittest individuals
|
||||||
|
* which are not dominated by other individuals within a certain distance.
|
||||||
|
* The remaining individuals are assigned to a peak if they have a distance
|
||||||
|
* smaller than rho to that peak.
|
||||||
|
* The number of expected peaks (clusters) must be predefined.
|
||||||
|
* Note that the returned number of clusters may be smaller than q.
|
||||||
|
*
|
||||||
|
* @author mkron
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ClusteringDynPeakIdent implements InterfaceClustering, java.io.Serializable {
|
||||||
|
private static final boolean TRACE=true;
|
||||||
|
private int numNiches;
|
||||||
|
private double nicheRadius;
|
||||||
|
private boolean strictNicheRadius=true; // if false, all individuals are clustered to the closest niche, otherwise some remain unclustered (those which are further than the nicheRadius from any peak)
|
||||||
|
InterfaceDistanceMetric metric = new PhenotypeMetric();
|
||||||
|
|
||||||
|
public ClusteringDynPeakIdent(int numNs, double nicheRad) {
|
||||||
|
this.numNiches = numNs;
|
||||||
|
this.nicheRadius = nicheRad;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ClusteringDynPeakIdent(ClusteringDynPeakIdent o) {
|
||||||
|
this(o.numNiches, o.nicheRadius);
|
||||||
|
metric = o.metric;
|
||||||
|
this.strictNicheRadius = o.strictNicheRadius;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object clone() {
|
||||||
|
return new ClusteringDynPeakIdent(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] associateLoners(Population loners, Population[] species,
|
||||||
|
Population referenceSet) {
|
||||||
|
Population bests = new Population(species.length);
|
||||||
|
for (int i=0; i<species.length; i++) bests.add(species[i].getBestEAIndividual());
|
||||||
|
return assignLeaders(loners, bests);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Assign a set of "lone" individuals to a set of leaders. Returns a vector
|
||||||
|
* of ints which indicate for every loner the index of the associated leader.
|
||||||
|
* An index may be -1 if no leader is closer than the niche threshold AND strictNicheRadius
|
||||||
|
* is true.
|
||||||
|
*
|
||||||
|
* @param loners
|
||||||
|
* @param bests
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected int[] assignLeaders(Population loners, Population bests) {
|
||||||
|
int[] assoc = new int[loners.size()];
|
||||||
|
for (int i=0; i<loners.size(); i++) {
|
||||||
|
// check distances to best indies per species
|
||||||
|
Pair<Integer, Double> closestInfo = Population.getClosestFarthestIndy(loners.getEAIndividual(i), bests, metric, true);
|
||||||
|
// we have now the info about the closest best individual. If its closer than the threshold, we can assign the loner to that index
|
||||||
|
if (!strictNicheRadius || (closestInfo.tail()<nicheRadius)) {
|
||||||
|
assoc[i]=closestInfo.head();
|
||||||
|
} else assoc[i]=-1;
|
||||||
|
}
|
||||||
|
return assoc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Population[] cluster(Population pop, Population referenceSet) {
|
||||||
|
Population sorted = pop.getSortedBestFirst();
|
||||||
|
Population peaks = performDynPeakIdent(metric, sorted, numNiches, nicheRadius);
|
||||||
|
Population[] clusters = new Population[peaks.size()+1];
|
||||||
|
for (int i=0; i<clusters.length; i++) clusters[i]=new Population();
|
||||||
|
|
||||||
|
Population rest = pop.cloneShallowInds();
|
||||||
|
rest.filter(peaks);
|
||||||
|
int[] assoc = assignLeaders(rest, peaks);
|
||||||
|
|
||||||
|
for (int i=0; i<assoc.length; i++) {
|
||||||
|
if (assoc[i]>=0) { // it can be assigned to a peak
|
||||||
|
clusters[assoc[i]+1].add(rest.getEAIndividual(i));
|
||||||
|
} else { // its a loner
|
||||||
|
clusters[0].add(rest.getEAIndividual(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clusters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String initClustering(Population pop) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean mergingSpecies(Population species1, Population species2,
|
||||||
|
Population referenceSet) {
|
||||||
|
// in our case just return true if the leaders are close enough
|
||||||
|
return (metric.distance(species1.getBestEAIndividual(), species2.getBestEAIndividual())<nicheRadius);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The DPI mechanism. Collect a number of peaks, which are the fittest individuals
|
||||||
|
* which are not dominated by other individuals within distance rho.
|
||||||
|
* Note that the returned set may be smaller than q.
|
||||||
|
*
|
||||||
|
* @param pop
|
||||||
|
* @param q the number of peaks to be identified
|
||||||
|
* @param rho the niche radius
|
||||||
|
* @return the dynamic peak set
|
||||||
|
*/
|
||||||
|
public static Population performDynPeakIdent(InterfaceDistanceMetric metric, Population sortedPop, int q, double rho) {
|
||||||
|
int i=0;
|
||||||
|
Population peaks = new Population(q);
|
||||||
|
while (i<sortedPop.size() && (peaks.size() < q)) {
|
||||||
|
if ((peaks.size()==0) || (!peaks.isWithinPopDist((AbstractEAIndividual)sortedPop.get(i), rho, metric))) {
|
||||||
|
peaks.add(sortedPop.get(i));
|
||||||
|
System.out.println("Added peak " + sortedPop.get(i));
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
if (TRACE) {
|
||||||
|
System.out.println("Found " + peaks.size() + " peaks, ");
|
||||||
|
for (int k=0; k<peaks.size(); k++) System.out.println(" " + peaks.getEAIndividual(k));
|
||||||
|
System.out.println("Measures: " + BeanInspector.toString(peaks.getPopulationMeasures()));
|
||||||
|
}
|
||||||
|
return peaks;
|
||||||
|
}
|
||||||
|
}
|
@ -332,7 +332,7 @@ public class ClusteringKMeans implements InterfaceClustering, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Oldy but goldy: K-Means clustering.";
|
return "Oldy but goldy: K-Means clustering.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -353,7 +353,7 @@ public class ClusteringNearestBetter implements InterfaceClustering, Serializabl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "A tree is produced by assigning each individual the closest individual with better fitness. Connections with a distance above a certain threshold are cut. After that, each interconnected subtree forms a cluster.";
|
return "A tree is produced by assigning each individual the closest individual with better fitness. Connections with a distance above a certain threshold are cut. After that, each interconnected subtree forms a cluster.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -341,7 +341,7 @@ public class ClusteringXMeans implements InterfaceClustering, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Oldy but goldy: K-Means clustering.";
|
return "Oldy but goldy: K-Means clustering.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -29,15 +29,27 @@ public interface InterfaceClustering {
|
|||||||
* All other populations group individuals into clusters.
|
* All other populations group individuals into clusters.
|
||||||
* It should make sure that the returned Population instances are of the same type
|
* It should make sure that the returned Population instances are of the same type
|
||||||
* as the given one, which may be a subclass of Population.
|
* as the given one, which may be a subclass of Population.
|
||||||
|
* If the clustering depends on population measures, a reference set may be given
|
||||||
|
* which is the reference population to consider the measures of. This is for cases
|
||||||
|
* where, e.g., subsets of a Population are to be clustered using measures of the
|
||||||
|
* original population.
|
||||||
*
|
*
|
||||||
* @param pop The population of individuals that is to be clustered.
|
* @param pop The population of individuals that is to be clustered.
|
||||||
|
* @param referenceSet a reference population for dynamic measures
|
||||||
* @return Population[]
|
* @return Population[]
|
||||||
*/
|
*/
|
||||||
public Population[] cluster(Population pop, Population referenceSet);
|
public Population[] cluster(Population pop, Population referenceSet);
|
||||||
|
|
||||||
/** This method allows you to decide if two species are to be merged regarding this clustering algorithm.
|
/**
|
||||||
|
* This method allows you to decide if two species are to be merged regarding this clustering algorithm.
|
||||||
|
* If the clustering depends on population measures, a reference set may be given
|
||||||
|
* which is the reference population to consider the measures of. This is for cases
|
||||||
|
* where, e.g., subsets of a Population are to be clustered using measures of the
|
||||||
|
* original population.
|
||||||
|
*
|
||||||
* @param species1 The first species.
|
* @param species1 The first species.
|
||||||
* @param species2 The second species.
|
* @param species2 The second species.
|
||||||
|
* @param referenceSet a reference population for dynamic measures
|
||||||
* @return True if species converge, else False.
|
* @return True if species converge, else False.
|
||||||
*/
|
*/
|
||||||
public boolean mergingSpecies(Population species1, Population species2, Population referenceSet);
|
public boolean mergingSpecies(Population species1, Population species2, Population referenceSet);
|
||||||
@ -69,9 +81,14 @@ public interface InterfaceClustering {
|
|||||||
* be associated, -1 is returned as individual entry.
|
* be associated, -1 is returned as individual entry.
|
||||||
* Note that the last cluster threshold is used which may have depended on the last
|
* Note that the last cluster threshold is used which may have depended on the last
|
||||||
* generation.
|
* generation.
|
||||||
|
* If the clustering depends on population measures, a reference set may be given
|
||||||
|
* which is the reference population to consider the measures of. This is for cases
|
||||||
|
* where, e.g., subsets of a Population are to be clustered using measures of the
|
||||||
|
* original population.
|
||||||
*
|
*
|
||||||
* @param loners
|
* @param loners
|
||||||
* @param species
|
* @param species
|
||||||
|
* @param referenceSet a reference population for dynamic measures
|
||||||
* @return associative list matching loners to species.
|
* @return associative list matching loners to species.
|
||||||
*/
|
*/
|
||||||
public int[] associateLoners(Population loners, Population[] species, Population referenceSet);
|
public int[] associateLoners(Population loners, Population[] species, Population referenceSet);
|
||||||
|
@ -69,7 +69,7 @@ public class ConstraintCollection extends AbstractConstraint {
|
|||||||
return constraintArray.length + " constr./" + getPenaltyFactor() + "/" + getHandlingMethod() + "/" + getPenaltyFactControl().getClass().getSimpleName();
|
return constraintArray.length + " constr./" + getPenaltyFactor() + "/" + getHandlingMethod() + "/" + getPenaltyFactControl().getClass().getSimpleName();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "A set of constraints with a single parameter adaption mechanism.";
|
return "A set of constraints with a single parameter adaption mechanism.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ public class DummyConstraint extends AbstractConstraint {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This constraint is always fulfilled.";
|
return "This constraint is always fulfilled.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,7 @@ public class GenericConstraint extends AbstractConstraint implements InterfaceDo
|
|||||||
return this.getClass().getSimpleName() + " " + constraintString;
|
return this.getClass().getSimpleName() + " " + constraintString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "A generic constraint which is parsed from a String; n is dimension, x0..xn are solution components. Use prefix notation as in \"+(-(sum(x),n),sqrt(*(pi,x0)))\".";
|
return "A generic constraint which is parsed from a String; n is dimension, x0..xn are solution components. Use prefix notation as in \"+(-(sum(x),n),sqrt(*(pi,x0)))\".";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class ImplicitConstraint extends AbstractConstraint {
|
|||||||
return "ImplicitCnstr-"+index;
|
return "ImplicitCnstr-"+index;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Similar to a multi-objective translation into fitness, this class allows to interpret fitness criteria as constraints.";
|
return "Similar to a multi-objective translation into fitness, this class allows to interpret fitness criteria as constraints.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ public class CrossoverEAMixer implements InterfaceCrossover, java.io.Serializabl
|
|||||||
|
|
||||||
public CrossoverEAMixer() {
|
public CrossoverEAMixer() {
|
||||||
InterfaceCrossover[] tmpList;
|
InterfaceCrossover[] tmpList;
|
||||||
ArrayList<String> crossers = GenericObjectEditor.getClassesFromProperties("eva2.server.go.operators.crossover.InterfaceCrossover");
|
ArrayList<String> crossers = GenericObjectEditor.getClassesFromProperties(InterfaceCrossover.class.getCanonicalName(), null);
|
||||||
tmpList = new InterfaceCrossover[crossers.size()];
|
tmpList = new InterfaceCrossover[crossers.size()];
|
||||||
for (int i = 0; i < crossers.size(); i++) {
|
for (int i = 0; i < crossers.size(); i++) {
|
||||||
if (((String)crossers.get(i)).equals(this.getClass().getName())) continue;
|
if (((String)crossers.get(i)).equals(this.getClass().getName())) continue;
|
||||||
@ -140,7 +140,7 @@ public class CrossoverEAMixer implements InterfaceCrossover, java.io.Serializabl
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This meta-mutation operator allows you to combine multiple alternative mutation operators.";
|
return "This meta-mutation operator allows you to combine multiple alternative mutation operators.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class CrossoverESArithmetical implements InterfaceCrossover, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an arithmetical crossover between m ES individuals.";
|
return "This is an arithmetical crossover between m ES individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ public class CrossoverESBLXAlpha implements InterfaceCrossover, java.io.Serializ
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The BLX crossover inits the values within the extreme values plus an additional alpha range (BLX-0.0 equals flat crossover).";
|
return "The BLX crossover inits the values within the extreme values plus an additional alpha range (BLX-0.0 equals flat crossover).";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ public class CrossoverESDefault implements InterfaceCrossover, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a discrete one-point crossover between m ES individuals.";
|
return "This is a discrete one-point crossover between m ES individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,7 @@ public class CrossoverESFlat implements InterfaceCrossover, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The flat crossover inits the values within the extreme values.";
|
return "The flat crossover inits the values within the extreme values.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -107,7 +107,7 @@ public class CrossoverESIntermediate implements InterfaceCrossover, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an intermediate crossover between m ES individuals.";
|
return "This is an intermediate crossover between m ES individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class CrossoverESNPointDiscrete implements InterfaceCrossover, java.io.Se
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a discrete n-point crossover between m ES individuals.";
|
return "This is a discrete n-point crossover between m ES individuals.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,7 +135,7 @@ public class CrossoverESNPointDiscreteDislocation implements InterfaceCrossover,
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a discrete n-point crossover between m ES individuals with dislocation.";
|
return "This is a discrete n-point crossover between m ES individuals with dislocation.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +288,7 @@ public class CrossoverESPCX implements InterfaceCrossover, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is the Parent Centric Crossover (PCX).";
|
return "This is the Parent Centric Crossover (PCX).";
|
||||||
}
|
}
|
||||||
public void setEta(double a) {
|
public void setEta(double a) {
|
||||||
|
@ -192,7 +192,7 @@ public class CrossoverESSBX implements InterfaceCrossover, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The SBX crossover simulates a binary crossover (works only for two partners!).";
|
return "The SBX crossover simulates a binary crossover (works only for two partners!).";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ public class CrossoverESSPX implements InterfaceCrossover, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is the Simplex Crossover (SPX).";
|
return "This is the Simplex Crossover (SPX).";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ public class CrossoverESUNDX implements InterfaceCrossover, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is the Unimodal Normally Distributed crossover (UNDX), typically use more than two parents.";
|
return "This is the Unimodal Normally Distributed crossover (UNDX), typically use more than two parents.";
|
||||||
}
|
}
|
||||||
public void setEta(double a) {
|
public void setEta(double a) {
|
||||||
|
@ -113,7 +113,7 @@ public class CrossoverESUniformDiscrete implements InterfaceCrossover, java.io.S
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a discrete n-point crossover between m ES individuals.";
|
return "This is a discrete n-point crossover between m ES individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ public class CrossoverGABitSimulated implements InterfaceCrossover, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a bit simulated crossover between m individuals.";
|
return "This is a bit simulated crossover between m individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ public class CrossoverGADefault implements InterfaceCrossover,
|
|||||||
*
|
*
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a one-point crossover between two individuals.";
|
return "This is a one-point crossover between two individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ public class CrossoverGANPoint implements InterfaceCrossover, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an n-point crossover between m individuals.";
|
return "This is an n-point crossover between m individuals.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ public class CrossoverGAUniform implements InterfaceCrossover, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a uniform crossover between m individuals.";
|
return "This is a uniform crossover between m individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ public class CrossoverGIDefault implements InterfaceCrossover, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a discrete one-point crossover between m GI individuals.";
|
return "This is a discrete one-point crossover between m GI individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,7 @@ public class CrossoverGINPoint implements InterfaceCrossover, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an n-point crossover between m individuals.";
|
return "This is an n-point crossover between m individuals.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -184,7 +184,7 @@ public class CrossoverGINPointVL implements InterfaceCrossover, java.io.Serializ
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a variable length n-point crossover between m individuals.";
|
return "This is a variable length n-point crossover between m individuals.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class CrossoverGIUniform implements InterfaceCrossover, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a uniform crossover between m individuals.";
|
return "This is a uniform crossover between m individuals.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -120,7 +120,7 @@ public class CrossoverGPDefault implements InterfaceCrossover, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a one-point crossover between two programs.";
|
return "This is a one-point crossover between two programs.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public class CrossoverOBGAPMX implements InterfaceCrossover, java.io.Serializabl
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The infamous PMX crossover for Permutations.";
|
return "The infamous PMX crossover for Permutations.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class CrossoverOBGAPMXUniform implements InterfaceCrossover, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The infamous PMX uniform crossover for Permutations.";
|
return "The infamous PMX uniform crossover for Permutations.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ public class NoCrossover implements InterfaceCrossover, java.io.Serializable {
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "No crossover at all, even for occasional strategy paramters.";
|
return "No crossover at all, even for occasional strategy paramters.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -76,7 +76,7 @@ public class EuclideanMetric implements InterfaceDistanceMetric {
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The euclidean metric calculates euclidian distances for individuals which have a real valued interpretation.";
|
return "The euclidean metric calculates euclidian distances for individuals which have a real valued interpretation.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -56,7 +56,7 @@ public class GenotypeMetricBitSet implements InterfaceDistanceMetric, java.io.Se
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a genotype based distance metric suited for binary data. The hamming distance is computed and normalized by chromosome length.";
|
return "This is a genotype based distance metric suited for binary data. The hamming distance is computed and normalized by chromosome length.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -75,7 +75,7 @@ public class IndividualDataMetric implements InterfaceDistanceMetric, Serializab
|
|||||||
this.normedDistance = normedDistance;
|
this.normedDistance = normedDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "Uses individual object data (so far only double[]) to calculate the distance.";
|
return "Uses individual object data (so far only double[]) to calculate the distance.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ public class ObjectiveSpaceMetric implements InterfaceDistanceMetric, java.io.Se
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "The objective space metric calculates euclidian distances on the fitness vectors.";
|
return "The objective space metric calculates euclidian distances on the fitness vectors.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -206,7 +206,7 @@ public class PhenotypeMetric implements InterfaceDistanceMetric, java.io.Seriali
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a phenotype based metric which can be applied to binary, integer, double, permutation, and program data types. For the latter two, the Levenshtein distance is computed. All distance values are normed.";
|
return "This is a phenotype based metric which can be applied to binary, integer, double, permutation, and program data types. For the latter two, the Levenshtein distance is computed. All distance values are normed.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -63,7 +63,7 @@ public class SigmaSingleMetricGlobalMutation implements InterfaceDistanceMetric,
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is an experimental method for individuals using global ES mutation.";
|
return "This is an experimental method for individuals using global ES mutation.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -65,7 +65,7 @@ public class FitnessAdaptiveClustering implements java.io.Serializable, Interfac
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a normation method based on Fitness Sharing. It adds a penalty for too similar individuals on the standard Normation method.";
|
return "This is a normation method based on Fitness Sharing. It adds a penalty for too similar individuals on the standard Normation method.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class FitnessModifierNone implements java.io.Serializable, InterfaceFitne
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "With this method the fitness remains unaltered.";
|
return "With this method the fitness remains unaltered.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ public class FitnessSharing implements java.io.Serializable, InterfaceFitnessMod
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a normation method based on Fitness Sharing. It adds a penalty for too similar individuals on the standard Normation method.";
|
return "This is a normation method based on Fitness Sharing. It adds a penalty for too similar individuals on the standard Normation method.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ public class MOBestMigration implements InterfaceMigration, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is multi-objective migration scheme.";
|
return "This is multi-objective migration scheme.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -348,7 +348,7 @@ public class MOClusteringSeparation implements InterfaceMigration, java.io.Seria
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is migration scheme, which implements a clustering based partitioning.";
|
return "This is migration scheme, which implements a clustering based partitioning.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -717,7 +717,7 @@ public class MOConeSeparation implements InterfaceMigration, java.io.Serializabl
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is migration scheme, which implements a cone separation based partitioning.";
|
return "This is migration scheme, which implements a cone separation based partitioning.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -350,7 +350,7 @@ public class MOXMeansSeparation implements InterfaceMigration, java.io.Serializa
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is migration scheme, which implements a clustering based partitioning.";
|
return "This is migration scheme, which implements a clustering based partitioning.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -77,7 +77,7 @@ public class SOBestMigration implements InterfaceMigration, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a single-objective migration scheme.";
|
return "This is a single-objective migration scheme.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -47,7 +47,7 @@ public class SOMONoMigration implements InterfaceMigration, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is actually no mirgation scheme, because no individuals are exchanged.";
|
return "This is actually no mirgation scheme, because no individuals are exchanged.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
/** This method will return a naming String
|
||||||
|
@ -94,7 +94,7 @@ public class MOSODynamicallyWeightedFitness implements InterfaceMOSOConverter, j
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calcuates a dynamic weighted sum over TWO fitness values depending on the current generation.";
|
return "This method calcuates a dynamic weighted sum over TWO fitness values depending on the current generation.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public class MOSOEpsilonConstraint implements InterfaceMOSOConverter, java.io.Se
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method uses n-1 objected as hard constraints.";
|
return "This method uses n-1 objected as hard constraints.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ public class MOSOEpsilonThreshold implements InterfaceMOSOConverter, java.io.Ser
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method uses n-1 objected as soft constraints.";
|
return "This method uses n-1 objected as soft constraints.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ public class MOSOGoalProgramming implements InterfaceMOSOConverter, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method minimizes the delta to a given target fitness values.";
|
return "This method minimizes the delta to a given target fitness values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class MOSOLpMetric implements InterfaceMOSOConverter, java.io.Serializabl
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method minimizes the Lp metric to a given target fitness values, for (p<1) this equals the Tchebycheff metric.";
|
return "This method minimizes the Lp metric to a given target fitness values, for (p<1) this equals the Tchebycheff metric.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public class MOSOMOGARankBased implements InterfaceMOSOConverter, java.io.Serial
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calcuates the MOGA rank of each individual and uses the rank as fitness [Fonseca93Genetic].";
|
return "This method calcuates the MOGA rank of each individual and uses the rank as fitness [Fonseca93Genetic].";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -144,7 +144,7 @@ public class MOSOMaxiMin implements InterfaceMOSOConverter, java.io.Serializable
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calculate the maximum of minimum distance over all criterias over all individuals.";
|
return "This method calculate the maximum of minimum distance over all criterias over all individuals.";
|
||||||
}
|
}
|
||||||
// /** This method allows you to choose the ScalingFactor for
|
// /** This method allows you to choose the ScalingFactor for
|
||||||
|
@ -77,7 +77,7 @@ public class MOSONoConvert implements InterfaceMOSOConverter, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method leaves everything the same.";
|
return "This method leaves everything the same.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ public class MOSORandomChoice implements InterfaceMOSOConverter, java.io.Serial
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method selects a random fitness value, actually this implements VEGA [Schaffer84Experiments].";
|
return "This method selects a random fitness value, actually this implements VEGA [Schaffer84Experiments].";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -91,7 +91,7 @@ public class MOSORandomWeight implements InterfaceMOSOConverter, java.io.Seriali
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calcuates a randomly weighted sum over all fitness values [Murata95MOGA].";
|
return "This method calcuates a randomly weighted sum over all fitness values [Murata95MOGA].";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -81,7 +81,7 @@ public class MOSORankbased implements InterfaceMOSOConverter, java.io.Serializab
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calcuates the Pareto rank of each individual and uses the rank as fitness.";
|
return "This method calcuates the Pareto rank of each individual and uses the rank as fitness.";
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -91,7 +91,7 @@ public class MOSOUtilityFunction implements InterfaceMOSOConverter, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method allows you to progamm an individual utility function.";
|
return "This method allows you to progamm an individual utility function.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ public class MOSOWeightedFitness implements InterfaceMOSOConverter, java.io.Seri
|
|||||||
/** This method returns a global info string
|
/** This method returns a global info string
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This method calcuates the weighted sum over all fitness values.";
|
return "This method calcuates the weighted sum over all fitness values.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user