Some 2400 @Overrides added... LAWL
This commit is contained in:
Fabian Becker 2013-01-29 13:37:25 +00:00
parent d3ea94fe5c
commit c16a592a26
511 changed files with 4461 additions and 1587 deletions

File diff suppressed because it is too large Load Diff

View File

@ -132,6 +132,7 @@ public class OptimizerRunnable implements Runnable {
doRestart = restart;
}
@Override
public void run() {
isFinished = false;
try {

View File

@ -28,6 +28,7 @@ public class ClassPreloader implements Runnable {
/**
* Load classes via GenericObjectEditor in a thread.
*/
@Override
public void run() {
if (classNames != null) {
for (int i = 0; i < classNames.length; i++) {

View File

@ -252,6 +252,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
SwingUtilities.invokeLater(initRnbl = new Runnable() {
@Override
public void run() {
synchronized (this) {
long startTime = System.currentTimeMillis();
@ -1177,6 +1178,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
comAdapter.killAllServers();
}
@Override
public void performedRestart(String infoString) {
if (superListenerList != null) {
for (RemoteStateListener l : superListenerList) {
@ -1187,6 +1189,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
startTime = System.currentTimeMillis();
}
@Override
public void performedStart(String infoString) {
if (superListenerList != null) {
for (RemoteStateListener l : superListenerList) {
@ -1197,6 +1200,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
startTime = System.currentTimeMillis();
}
@Override
public void performedStop() {
if (superListenerList != null) {
for (RemoteStateListener l : superListenerList) {
@ -1215,6 +1219,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
* for the event dispatching thread with SwingUtilities.invokeLater(). In
* this case we're just changing the progress bars value.
*/
@Override
public void updateProgress(final int percent, String msg) {
if (superListenerList != null) {
for (RemoteStateListener l : superListenerList) {
@ -1227,6 +1232,7 @@ public class EvAClient extends JFrame implements RemoteStateListener {
if (this.progressBar != null) {
Runnable doSetProgressBarValue = new Runnable() {
@Override
public void run() {
progressBar.setValue(percent);
}

View File

@ -23,35 +23,37 @@ import java.rmi.RemoteException;
*
*/
public class EvAComAdapter extends ComAdapter {
private LoggingPanel loggingPanel;
private EvAMainAdapterImpl localMainAdapter;
private boolean runLocally = false;
/**
*
*/
public void setLogPanel(LoggingPanel loggingPanel) {
this.loggingPanel = loggingPanel;
}
/**
*
*/
public static EvAComAdapter getInstance() {
if (m_instance==null) {
m_instance = new EvAComAdapter();
m_instance.addServersFromProperties(EvAInfo.getProperties());
}
return (EvAComAdapter)m_instance;
}
/**
* Creates the ModulAdapters RMI Object on the server
* @return
*/
public ModuleAdapter getModuleAdapter(String selectedModuleName, InterfaceGOParameters goParams, String noGuiStatsFile) {
ModuleAdapter newModuleAdapter;
if ((m_RMIServer == null) && isRunLocally()) {
//ret = evaAdapter.getModuleAdapter(Modul, hostAdd, this.m_MainAdapterClient);
private LoggingPanel loggingPanel;
private EvAMainAdapterImpl localMainAdapter;
private boolean runLocally = false;
/**
*
*/
public void setLogPanel(LoggingPanel loggingPanel) {
this.loggingPanel = loggingPanel;
}
/**
*
*/
public static EvAComAdapter getInstance() {
if (m_instance == null) {
m_instance = new EvAComAdapter();
m_instance.addServersFromProperties(EvAInfo.getProperties());
}
return (EvAComAdapter) m_instance;
}
/**
* Creates the ModulAdapters RMI Object on the server
*
* @return
*/
public ModuleAdapter getModuleAdapter(String selectedModuleName, InterfaceGOParameters goParams, String noGuiStatsFile) {
ModuleAdapter newModuleAdapter;
if ((m_RMIServer == null) && isRunLocally()) {
newModuleAdapter = getLocalMainAdapter().getModuleAdapter(selectedModuleName, true, getHostName(), goParams, noGuiStatsFile, null);
} else {
newModuleAdapter = ((RMIConnectionEvA) getConnection(getHostName())).getModuleAdapter(selectedModuleName);
@ -59,68 +61,77 @@ public class EvAComAdapter extends ComAdapter {
System.err.println("RMI Error for getting ModuleAdapterObject : " + selectedModuleName);
}
}
return newModuleAdapter;
}
public void updateLocalMainAdapter() {
localMainAdapter = new EvAMainAdapterImpl();
}
private EvAMainAdapter getLocalMainAdapter() {
if (localMainAdapter == null) localMainAdapter = new EvAMainAdapterImpl();
return localMainAdapter;
}
/**
* Returns a list of modules available on the server.
* @return
*/
public String[] getModuleNameList() {
String[] list;
if ((m_RMIServer == null) && isRunLocally()) {
list = getLocalMainAdapter().getModuleNameList();
} else {
RMIConnectionEvA Connection = (RMIConnectionEvA)getConnection(getHostName());
if (Connection == null) {
System.err.println("Couldnt create RMIConnection in EvAComAdapter.getModuleNameList");
return null;
}
list = ((EvAMainAdapter)Connection.getMainAdapter()).getModuleNameList();
}
if (loggingPanel != null)
loggingPanel.logMessage("List of modules on server:");
if (list != null)
for (int i = 0; i < list.length; i++) {
if ( (String) list[i] != null && loggingPanel != null)
loggingPanel.logMessage( (String) list[i]);
}
return list;
}
protected MainAdapter getMainAdapter(RMIInvocationHandler invocHandler) throws RemoteException {
try {
return (EvAMainAdapter) invocHandler.getWrapper();
} catch (ClassCastException e) {
System.err.println("Warning: cannot cast to EvAMainAdapter in EvAComAdapter.. trying MainAdapter...");
}
return (MainAdapter) invocHandler.getWrapper();
}
protected RMIConnection createRMIConnection(String Host, MainAdapter mainRemoteObject, MainAdapterClient client) {
return new RMIConnectionEvA(Host, mainRemoteObject, client);
}
/**
* @return the runLocally
*/
public boolean isRunLocally() {
return runLocally;
}
/**
* @param runLocally the runLocally to set
*/
public void setRunLocally(boolean runLocally) {
this.runLocally = runLocally;
}
return newModuleAdapter;
}
public void updateLocalMainAdapter() {
localMainAdapter = new EvAMainAdapterImpl();
}
private EvAMainAdapter getLocalMainAdapter() {
if (localMainAdapter == null) {
localMainAdapter = new EvAMainAdapterImpl();
}
return localMainAdapter;
}
/**
* Returns a list of modules available on the server.
*
* @return
*/
public String[] getModuleNameList() {
String[] list;
if ((m_RMIServer == null) && isRunLocally()) {
list = getLocalMainAdapter().getModuleNameList();
} else {
RMIConnectionEvA Connection = (RMIConnectionEvA) getConnection(getHostName());
if (Connection == null) {
System.err.println("Couldnt create RMIConnection in EvAComAdapter.getModuleNameList");
return null;
}
list = ((EvAMainAdapter) Connection.getMainAdapter()).getModuleNameList();
}
if (loggingPanel != null) {
loggingPanel.logMessage("List of modules on server:");
}
if (list != null) {
for (int i = 0; i < list.length; i++) {
if ((String) list[i] != null && loggingPanel != null) {
loggingPanel.logMessage((String) list[i]);
}
}
}
return list;
}
@Override
protected MainAdapter getMainAdapter(RMIInvocationHandler invocHandler) throws RemoteException {
try {
return (EvAMainAdapter) invocHandler.getWrapper();
} catch (ClassCastException e) {
System.err.println("Warning: cannot cast to EvAMainAdapter in EvAComAdapter.. trying MainAdapter...");
}
return (MainAdapter) invocHandler.getWrapper();
}
@Override
protected RMIConnection createRMIConnection(String Host, MainAdapter mainRemoteObject, MainAdapterClient client) {
return new RMIConnectionEvA(Host, mainRemoteObject, client);
}
/**
* @return the runLocally
*/
public boolean isRunLocally() {
return runLocally;
}
/**
* @param runLocally the runLocally to set
*/
public void setRunLocally(boolean runLocally) {
this.runLocally = runLocally;
}
}

View File

@ -63,6 +63,7 @@ public class AboutDialog extends JDialog {
infoEditorPane.setOpaque(false);
infoEditorPane.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent hle) {
if (HyperlinkEvent.EventType.ACTIVATED.equals(hle.getEventType())) {
java.awt.Desktop desktop = java.awt.Desktop.getDesktop();

View File

@ -97,6 +97,7 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
this.m_BlackCheck[i] = new JCheckBox(getElementName(i), isElementSelected(i));
this.m_BlackCheck[i].setToolTipText(getElementToolTip(i));
this.m_BlackCheck[i].addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ev) {
if (actionOnSelect()) m_Support.firePropertyChange("AbstractListSelectionEditor", null, this);
}
@ -123,6 +124,7 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (setObject(o)) updateEditor();
}
@ -131,29 +133,36 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
* Returns the current object.
* @return the current object
*/
@Override
public abstract Object getValue();
@Override
public String getJavaInitializationString() {
return "";
}
@Override
public String getAsText() {
return null;
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -162,6 +171,7 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -171,6 +181,7 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -182,6 +193,7 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
* Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -189,11 +201,13 @@ public abstract class AbstractListSelectionEditor extends JPanel implements Prop
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
m_Support.firePropertyChange("AbstractListSelectionEditor", null, this);
}

View File

@ -109,6 +109,7 @@ public class BigStringEditor implements PropertyEditor {
m_Panel.setLayout(new BorderLayout());
m_SetButton = new JButton("SET");
m_SetButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setValue(m_TextArea.getText());
}
@ -119,6 +120,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public void setValue (Object value) {
m_ElementEditor = null;
if (value instanceof String) {
@ -135,6 +137,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public Object getValue () {
// m_Source.setString(m_TextArea.getText());
return null;
@ -142,6 +145,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public String getJavaInitializationString () {
return "null";
}
@ -152,6 +156,7 @@ public class BigStringEditor implements PropertyEditor {
*
* @return true
*/
@Override
public boolean isPaintable () {
return true;
}
@ -162,6 +167,7 @@ public class BigStringEditor implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue (Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent())/2;
@ -172,6 +178,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public String getAsText () {
return null;
}
@ -179,6 +186,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public void setAsText (String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -186,6 +194,7 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags () {
return null;
}
@ -193,21 +202,25 @@ public class BigStringEditor implements PropertyEditor {
/**
*
*/
@Override
public boolean supportsCustomEditor () {
return true;
}
/**
*
*/
@Override
public Component getCustomEditor () {
return m_Panel;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);

View File

@ -269,6 +269,7 @@ public class DPointSetMultiIcon extends DComponent
jumperMI.addJump();
}
@Override
public void paint(DMeasures m)
{
try
@ -490,6 +491,7 @@ public class DPointSetMultiIcon extends DComponent
//~ Inner Classes //////////////////////////////////////////////////////////
@Override
public String toString()
{
String text = "eva2.tools.chart2d.DPointSet[size:" + getSize();

View File

@ -91,6 +91,7 @@ public class DataViewer implements DataViewerInterface {
/**
*
*/
@Override
public Graph getNewGraph(String InfoString) {
m_GraphCounter++;
if (TRACE) System.out.println("Graph.getNewGraph No:"+m_GraphCounter);
@ -99,6 +100,7 @@ public class DataViewer implements DataViewerInterface {
/**
*
*/
@Override
public void init() {
m_Plot = new Plot(m_Name,"x","y", true);
}

View File

@ -18,10 +18,12 @@ public class EnumEditor extends PropertyEditorSupport {
/** The Enum values that may be chosen */
private Enum[] enumConstants;
@Override
public String getAsText() {
return getValue().toString();
}
@Override
public void setValue(Object value) {
if (value instanceof Enum) {
enumConstants = ((Enum)value).getClass().getEnumConstants();
@ -67,6 +69,7 @@ public class EnumEditor extends PropertyEditorSupport {
PropertyValueSelector ps = new PropertyValueSelector(ed);
JFrame f = new JFrame();
f.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}

View File

@ -52,6 +52,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
moduleAdapter = adapter;
}
@Override
public JToolBar makePanel() {
toolBar = new JToolBar();
toolBar.setFloatable(false);
@ -165,6 +166,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
helpButton.setToolTipText("Description of the current optimization algorithm.");
helpButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//System.out.println("Run Opt pressed !!!!!!!!!!!!!!!!======================!!");
try {
@ -186,6 +188,7 @@ public class EvAModuleButtonPanelMaker implements RemoteStateListener, Serializa
/**
*
*/
@Override
public void performedStop() {
runButton.setEnabled(true);
postProcessButton.setEnabled(true);

View File

@ -40,6 +40,7 @@ public class EvATabbedFrameMaker implements Serializable, PanelMaker, InterfaceN
pmContainer.add(pm);
}
@Override
public JPanel makePanel() {
JPanel tabControlPanel = new JPanel(new GridBagLayout());
@ -111,6 +112,7 @@ public class EvATabbedFrameMaker implements Serializable, PanelMaker, InterfaceN
}
}
@Override
public void setInformers(List<InterfaceAdditionalPopulationInformer> informers) {
// if the informers have changed, update the GUI element which displays them
try {
@ -169,6 +171,7 @@ class ClosableTabComponent extends JPanel {
//make JLabel read titles from JTabbedPane
JLabel label = new JLabel() {
@Override
public String getText() {
int index = pane.indexOfTabComponent(ClosableTabComponent.this);
if (index != -1) {
@ -210,6 +213,7 @@ class ClosableTabComponent extends JPanel {
addActionListener(this);
}
@Override
public void actionPerformed(ActionEvent e) {
int i = pane.indexOfTabComponent(ClosableTabComponent.this);
if (i != -1) {
@ -252,10 +256,12 @@ class ClosableTabComponent extends JPanel {
}
//we don't want to update UI for this button
@Override
public void updateUI() {
}
//paint the cross
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g.create();
@ -273,6 +279,7 @@ class ClosableTabComponent extends JPanel {
}
private final static MouseListener buttonMouseListener = new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {
@ -281,6 +288,7 @@ class ClosableTabComponent extends JPanel {
}
}
@Override
public void mouseExited(MouseEvent e) {
Component component = e.getComponent();
if (component instanceof AbstractButton) {

View File

@ -42,6 +42,7 @@ public class EvATreeSelectionListener implements TreeSelectionListener, Property
if (goEditor!=null) goEditor.addPropertyChangeListener(this); // listen to changes to the parameters
}
@Override
public void valueChanged(TreeSelectionEvent e) {
if (TRACE) System.out.println("valueChanged to " + BeanInspector.toString(e.getPath()));
TreePath tp = e.getPath();
@ -59,6 +60,7 @@ public class EvATreeSelectionListener implements TreeSelectionListener, Property
}
}
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (TRACE) System.out.println("EvATreeNode received change event " + evt);
root.setObject(evt.getNewValue(), true);

View File

@ -19,6 +19,7 @@ public class Exp extends DFunction {
* (non-Javadoc)
* @see eva2.tools.chart2d.DFunction#isDefinedAt(double)
*/
@Override
public boolean isDefinedAt(double source) {
return true;
}
@ -27,6 +28,7 @@ public class Exp extends DFunction {
* (non-Javadoc)
* @see eva2.tools.chart2d.DFunction#isInvertibleAt(double)
*/
@Override
public boolean isInvertibleAt(double image) {
return image > 0;
}
@ -35,6 +37,7 @@ public class Exp extends DFunction {
* (non-Javadoc)
* @see eva2.tools.chart2d.DFunction#getImageOf(double)
*/
@Override
public double getImageOf(double source) {
return Math.exp(source);
}
@ -43,6 +46,7 @@ public class Exp extends DFunction {
* (non-Javadoc)
* @see eva2.tools.chart2d.DFunction#getSourceOf(double)
*/
@Override
public double getSourceOf(double target) {
if (target <= 0) {
return Math.log(minValue); // think of a minimal value we want to show in case invalid values are requested

View File

@ -30,6 +30,7 @@ public abstract class ExtActionChangedListener implements PropertyChangeListener
/**
*
*/
@Override
public abstract void propertyChange(PropertyChangeEvent e);
/**
*

View File

@ -35,11 +35,13 @@ public class ExtDesktopManager extends DefaultDesktopManager {
this.desktop = desktop;
}
@Override
public void activateFrame(JInternalFrame f) {
super.activateFrame(f);
activeFrame = f;
}
@Override
public void deactivateFrame(JInternalFrame f) {
super.deactivateFrame(f);
if (activeFrame == f) {
@ -51,6 +53,7 @@ public class ExtDesktopManager extends DefaultDesktopManager {
return activeFrame;
}
@Override
public void closeFrame(JInternalFrame internalFrame) {
LOGGER.log(Level.FINE, "Closing Internal Frame: {0}", internalFrame.getTitle());
super.closeFrame(internalFrame);

View File

@ -191,6 +191,7 @@ public class FunctionArea extends DArea implements Serializable {
private void addPopup() {
addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if ((e.getModifiers() & InputEvent.BUTTON1_MASK) == InputEvent.BUTTON1_MASK) {
// do nothing
@ -201,6 +202,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, "Rename graph", new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
renameGraph(getNearestGraphIndex(FunctionArea.this.xPos, FunctionArea.this.yPos));
}
@ -212,6 +214,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, togGTTName,
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
setShowGraphToolTips(!isShowGraphToolTips());
}
@ -221,6 +224,7 @@ public class FunctionArea extends DArea implements Serializable {
+ " legend";
addMenuItem(graphPopupMenu, togLName, new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
toggleLegend();
}
@ -228,6 +232,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, "Toggle scientific format", new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
toggleScientificY(true);
}
@ -237,6 +242,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, "Recolor all graphs",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
recolorAllGraphsByIndex();
}
@ -249,6 +255,7 @@ public class FunctionArea extends DArea implements Serializable {
+ temp.x + "/" + temp.y + ")",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
DPoint temp = getDMeasures().getDPoint(
xPos, yPos);
@ -268,6 +275,7 @@ public class FunctionArea extends DArea implements Serializable {
+ point.x + "/" + point.y + ")",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
}
}, false);
@ -275,6 +283,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, " Remove point",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
removePoint(FunctionArea.this.xPos,
FunctionArea.this.yPos);
@ -290,6 +299,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, selectTitle,
new ActionListener() {
@Override
public void actionPerformed(
ActionEvent ee) {
((InterfaceSelectablePointIcon) currentPointIcon).getSelectionListener().individualSelected(
@ -304,6 +314,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, " Show individual",
new ActionListener() {
@Override
public void actionPerformed(
ActionEvent ee) {
((InterfaceDPointWithContent) currentPointIcon).showIndividual();
@ -325,16 +336,19 @@ public class FunctionArea extends DArea implements Serializable {
+ getGraphInfo(e.getX(), e.getY()),
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
DPoint temp = FunctionArea.this.getDMeasures().getDPoint(
FunctionArea.this.xPos,
FunctionArea.this.yPos);
DPointIcon icon1 = new DPointIcon() {
@Override
public DBorder getDBorder() {
return new DBorder(4, 4, 4, 4);
}
@Override
public void paint(Graphics g) {
g.drawLine(-2, 0, 2, 0);
g.drawLine(0, 0, 0, 4);
@ -348,6 +362,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, " Remove graph",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
clearGraph(FunctionArea.this.xPos,
FunctionArea.this.yPos);
@ -357,6 +372,7 @@ public class FunctionArea extends DArea implements Serializable {
addMenuItem(graphPopupMenu, " Change graph color",
new ActionListener() {
@Override
public void actionPerformed(ActionEvent ee) {
changeColorGraph(FunctionArea.this.xPos,
FunctionArea.this.yPos);

View File

@ -100,6 +100,7 @@ public class GOEPanel extends JPanel implements ItemListener {
propertySheetPanel.addPropertyChangeListener(
new PropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent event) {
propChangeSupport.firePropertyChange("", backupObject, genericObjectEditor.getValue());
}

View File

@ -75,6 +75,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
private ActionListener innerActionListener = new ActionListener() {
//
@Override
public void actionPerformed(ActionEvent e) {
boolean consistentView = true; // be optimistic...
if (view instanceof PropertyText) { // check consistency!
@ -171,6 +172,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
new ListSelectionListener() {
//
@Override
public void valueChanged(ListSelectionEvent e) {
if (e.getSource() == elementList) {
@ -216,6 +218,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
gae = genAE;
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int index = list.locationToIndex(e.getPoint());
@ -274,6 +277,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
* @param boolean true if the cell has the focus
* @return the rendering component
*/
@Override
public Component getListCellRendererComponent(final JList list,
final Object value,
final int index,
@ -526,6 +530,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
private ActionListener makeSelectionKnownAL(final ActionListener al) {
return new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (selectableList != null) {
selectableList.setSelectionByIndices(elementList.getSelectedIndices());
@ -550,6 +555,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
*
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
// Create a new list model, put it in the list and resize?
updateEditorType(o);
@ -580,6 +586,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
*
* @return the current object array
*/
@Override
public Object getValue() {
if (listModel == null) {
return null;
@ -606,6 +613,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
if (m_popupItemList.size() > 0) {
elementList.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (selectableList != null) {
selectableList.setSelectionByIndices(elementList.getSelectedIndices());
@ -650,6 +658,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
*
* @return the java source code initialisation string
*/
@Override
public String getJavaInitializationString() {
return "null";
}
@ -659,6 +668,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
*
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -669,6 +679,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -689,6 +700,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -696,6 +708,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -703,6 +716,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@ -710,6 +724,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -717,10 +732,12 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public Component getCustomEditor() {
return this;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (propChangeSupport == null) {
propChangeSupport = new PropertyChangeSupport(this);
@ -728,6 +745,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
propChangeSupport.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (propChangeSupport == null) {
propChangeSupport = new PropertyChangeSupport(this);
@ -759,6 +777,7 @@ public class GenericArrayEditor extends JPanel implements PropertyEditor {
this.withDeleteButton = wB;
}
@Override
public void removeNotify() {
super.removeNotify();
}

View File

@ -42,12 +42,14 @@ class MyFocusListener implements FocusListener {
* (non-Javadoc)
* @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
*/
@Override
public void focusLost(FocusEvent e) { }
/*
* (non-Javadoc)
* @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
*/
@Override
public void focusGained(FocusEvent e) { arrEditor.notifyFocusID(myID);};
};
@ -100,6 +102,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
this.m_OKButton = new JButton("OK");
this.m_OKButton.setEnabled(true);
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
@ -119,6 +122,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** This action listener adds an element to DoubleArray
*/
ActionListener addAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_DoubleArray.addRowCopy(lastFocussedRow); // copy the last focussed row
updateEditor();
@ -128,6 +132,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** This action listener removes an element from the DoubleArray.
*/
ActionListener deleteAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
if (!m_DoubleArray.isValidRow(lastFocussedRow)) {
m_DoubleArray.deleteRow(m_DoubleArray.getNumRows()-1);
@ -142,6 +147,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
* This action listener nomalizes each columng of the values of the DoubleArray.
*/
ActionListener normalizeAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_DoubleArray.normalizeColumns();
updateEditor();
@ -151,11 +157,14 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** This action listener reads all values
*/
KeyListener readDoubleArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
double[][] tmpDD = new double[m_InputTextFields.length][m_InputTextFields[0].length];
@ -235,6 +244,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyDoubleArray) {
this.m_DoubleArray = (PropertyDoubleArray) o;
@ -245,10 +255,12 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_DoubleArray;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -256,6 +268,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -263,6 +276,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -270,15 +284,18 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -301,6 +318,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -310,6 +328,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -320,6 +339,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -327,6 +347,7 @@ public class GenericDoubleArrayEditor extends JPanel implements PropertyEditor {
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;

View File

@ -59,6 +59,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
this.m_OKButton = new JButton("OK");
this.m_OKButton.setEnabled(true);
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
@ -75,6 +76,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** This action listener adds an element to DoubleArray
*/
ItemListener objectiveAction = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent event) {
m_EpsilonConstraint.m_OptimizeObjective = m_Objective.getSelectedIndex();
updateEditor();
@ -84,11 +86,14 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** This action listener reads all values
*/
KeyListener readDoubleArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
double[] tmpT = m_EpsilonConstraint.m_TargetValue;
@ -143,6 +148,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyEpsilonConstraint) {
this.m_EpsilonConstraint = (PropertyEpsilonConstraint) o;
@ -153,10 +159,12 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_EpsilonConstraint;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -164,6 +172,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -171,6 +180,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -178,15 +188,18 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -209,6 +222,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -218,6 +232,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -228,6 +243,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -235,6 +251,7 @@ public class GenericEpsilonConstraintEditor extends JPanel implements PropertyEd
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;

View File

@ -59,6 +59,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
this.m_OKButton = new JButton("OK");
this.m_OKButton.setEnabled(true);
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
@ -75,6 +76,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** This action listener adds an element to DoubleArray
*/
ItemListener objectiveAction = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent event) {
m_EpsilonThreshhold.m_OptimizeObjective = m_Objective.getSelectedIndex();
updateEditor();
@ -84,11 +86,14 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** This action listener reads all values
*/
KeyListener readDoubleArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
double[] tmpT = m_EpsilonThreshhold.m_TargetValue;
double[] tmpP = m_EpsilonThreshhold.m_Punishment;
@ -160,6 +165,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyEpsilonThreshold) {
this.m_EpsilonThreshhold = (PropertyEpsilonThreshold) o;
@ -170,10 +176,12 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_EpsilonThreshhold;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -181,6 +189,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -188,6 +197,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -195,15 +205,18 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -226,6 +239,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -235,6 +249,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -245,6 +260,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -252,6 +268,7 @@ public class GenericEpsilonThresholdEditor extends JPanel implements PropertyEdi
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;

View File

@ -39,6 +39,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyFilePath) {
this.m_FilePath = (PropertyFilePath) o;
@ -48,10 +49,12 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_FilePath;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -59,6 +62,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -66,6 +70,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -73,15 +78,18 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -90,6 +98,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -99,6 +108,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -109,6 +119,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -116,6 +127,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
this.m_Panel = new JPanel();
this.m_FileChooser = new JFileChooser();
@ -131,6 +143,7 @@ public class GenericFilePathEditor extends JPanel implements PropertyEditor {
* the SOM to recalculate the mapping.
*/
ActionListener fileChooserAction = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand() == "ApproveSelection") {
m_FilePath.setCompleteFilePath(m_FileChooser.getSelectedFile().getAbsolutePath());

View File

@ -53,6 +53,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
this.m_OKButton = new JButton("OK");
this.m_OKButton.setEnabled(true);
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
@ -69,11 +70,14 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** This action listener reads all values
*/
KeyListener readIntArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
int[] tmpD = new int[m_InputTextField.length];
@ -122,6 +126,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyIntArray) {
this.m_IntArray = (PropertyIntArray) o;
@ -132,10 +137,12 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_IntArray;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -143,6 +150,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -150,6 +158,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -157,15 +166,18 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -188,6 +200,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -197,6 +210,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -207,6 +221,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -214,6 +229,7 @@ public class GenericIntArrayEditor extends JPanel implements PropertyEditor {
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;

View File

@ -311,6 +311,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @param o an object that must be a Object.
*/
@Override
public void setValue(Object o) {
//System.err.println("setValue()" + m_ClassType.toString());
@ -363,6 +364,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return the current Object
*/
@Override
public Object getValue() {
return m_Object;
}
@ -374,6 +376,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return the java source code initialization string
*/
@Override
public String getJavaInitializationString() {
return "new " + m_Object.getClass().getName() + "()";
}
@ -383,6 +386,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -393,6 +397,7 @@ public class GenericObjectEditor implements PropertyEditor {
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
if (isEnabled && m_Object != null) {
int getNameMethod = -1;
@ -435,6 +440,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return null
*/
@Override
public String getAsText() {
return null;
}
@ -445,6 +451,7 @@ public class GenericObjectEditor implements PropertyEditor {
* @param text the text value
* @exception IllegalArgumentException as we don't support getting/setting values as text.
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -454,6 +461,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return null
*/
@Override
public String[] getTags() {
return null;
}
@ -463,6 +471,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -472,6 +481,7 @@ public class GenericObjectEditor implements PropertyEditor {
*
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (editorComponent == null) {
editorComponent = new GOEPanel(m_Object, m_Backup, propertyChangeSupport, this);
@ -490,6 +500,7 @@ public class GenericObjectEditor implements PropertyEditor {
editorComponent.setEnabledOkCancelButtons(false);
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
@ -497,6 +508,7 @@ public class GenericObjectEditor implements PropertyEditor {
propertyChangeSupport.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);

View File

@ -48,6 +48,7 @@ public class GenericObjectListSelectionEditor extends AbstractListSelectionEdito
/** Retruns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return objList;
}

View File

@ -194,6 +194,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** This action listener,...
*/
ActionListener updateTargets = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
updateTargetList();
}
@ -202,6 +203,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** This action listener,...
*/
ActionListener addTarget = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_OptimizationObjectives.addTarget((InterfaceOptimizationObjective)m_OptimizationObjectives.getAvailableTargets()[0].clone());
int l = m_OptimizationObjectives.getSelectedTargets().length;
@ -234,6 +236,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** This action listener,...
*/
ActionListener deleteTarget = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
int l = m_OptimizationObjectives.getSelectedTargets().length, j = 0;
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l-1];
@ -266,6 +269,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyOptimizationObjectives) {
this.m_OptimizationObjectives= (PropertyOptimizationObjectives) o;
@ -276,10 +280,12 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_OptimizationObjectives;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -287,6 +293,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -294,6 +301,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -301,6 +309,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@ -322,6 +331,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -331,6 +341,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -341,6 +352,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -348,6 +360,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_Editor == null) this.initCustomEditor();
return m_Editor;
@ -363,11 +376,13 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
/********************************* java.beans.PropertyChangeListener *************************/
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -376,6 +391,7 @@ public class GenericOptimizationObjectivesEditor extends JPanel implements Prope
* editing an object.
* @param evt
*/
@Override
public void propertyChange(PropertyChangeEvent evt) {
Object newVal = evt.getNewValue();
Object oldVal = evt.getOldValue();

View File

@ -218,6 +218,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This action listener,...
*/
ActionListener updateTargets = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
updateTargetList();
}
@ -226,6 +227,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This action listener,...
*/
ActionListener addTarget = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_OptimizationObjectivesWithWeights.addTarget((InterfaceOptimizationObjective)m_OptimizationObjectivesWithWeights.getAvailableTargets()[0].clone());
int l = m_OptimizationObjectivesWithWeights.getSelectedTargets().length;
@ -258,6 +260,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This action listener,...
*/
ActionListener deleteTarget = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
int l = m_OptimizationObjectivesWithWeights.getSelectedTargets().length, j = 0;
GeneralGOEProperty[] newEdit = new GeneralGOEProperty[l-1];
@ -276,6 +279,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This action listener,...
*/
ActionListener normalizeWeights = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
double[] newW = m_OptimizationObjectivesWithWeights.getWeights();
double sum = 0;
@ -295,11 +299,14 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This action listener reads all values
*/
KeyListener readDoubleArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
double[] newW = m_OptimizationObjectivesWithWeights.getWeights();
@ -332,6 +339,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyOptimizationObjectivesWithParam) {
this.m_OptimizationObjectivesWithWeights= (PropertyOptimizationObjectivesWithParam) o;
@ -342,10 +350,12 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_OptimizationObjectivesWithWeights;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -353,6 +363,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -360,6 +371,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -367,6 +379,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@ -388,6 +401,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -397,6 +411,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -407,6 +422,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -414,6 +430,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_Editor == null) this.initCustomEditor();
return m_Editor;
@ -429,11 +446,13 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
/********************************* java.beans.PropertyChangeListener *************************/
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -442,6 +461,7 @@ public class GenericOptimizationObjectivesWithParamEditor extends JPanel impleme
* editing an object.
* @param evt
*/
@Override
public void propertyChange(PropertyChangeEvent evt) {
Object newVal = evt.getNewValue();
Object oldVal = evt.getOldValue();

View File

@ -198,6 +198,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener saveServers = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
String text = m_RemoteServers.writeToText();
JFileChooser saver = new JFileChooser();
@ -222,6 +223,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener killServers = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_RemoteServers.killServers();
updateServerList();
@ -231,6 +233,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener startServers = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_RemoteServers.startServers();
updateServerList();
@ -240,6 +243,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener updateServers = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
updateServerList();
}
@ -248,6 +252,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener addServer = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_RemoteServers.addServerNode("noname-"+m_RemoteServers.size(), 1);
updateServerList();
@ -258,6 +263,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener deleteServer = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
for (int i = 0; i < m_Delete.length; i++) {
if (event.getSource().equals(m_Delete[i])) m_RemoteServers.removeServerNode(m_RemoteServers.get(i).m_ServerName);
@ -270,6 +276,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener,...
*/
ActionListener loadServers = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
String text = "";
JFileChooser reader = new JFileChooser();
@ -300,10 +307,13 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener reads all values
*/
KeyListener loginListener = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
m_RemoteServers.setLogin(m_Login.getText());
}
@ -312,10 +322,13 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener reads all values
*/
KeyListener passwordListener = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
m_RemoteServers.setPassword(m_Password.getPassword());
}
@ -324,10 +337,13 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener reads all values
*/
KeyListener serverNameListener = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
for (int i = 0; i < m_Names.length; i++) {
if (event.getSource().equals(m_Names[i])) m_RemoteServers.setNameFor(i, m_Names[i].getText());
@ -338,6 +354,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This action listener adds an element to DoubleArray
*/
ItemListener cpuStateListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent event) {
for (int i = 0; i < m_CPUs.length; i++) {
if (event.getSource().equals(m_CPUs[i])) m_RemoteServers.setCPUsFor(i, m_CPUs[i].getSelectedIndex()+1);
@ -358,6 +375,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyRemoteServers) {
this.m_RemoteServers = (PropertyRemoteServers) o;
@ -368,10 +386,12 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_RemoteServers;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -379,6 +399,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -386,6 +407,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -393,15 +415,18 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -424,6 +449,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -433,6 +459,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -443,6 +470,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -450,6 +478,7 @@ public class GenericRemoteServersEditor extends JPanel implements PropertyEditor
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_Editor == null) this.initCustomEditor();
return m_Editor;

View File

@ -58,6 +58,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
this.m_OKButton = new JButton("OK");
this.m_OKButton.setEnabled(true);
this.m_OKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
//m_Backup = copyObject(m_Object);
if ((m_CustomEditor.getTopLevelAncestor() != null) && (m_CustomEditor.getTopLevelAncestor() instanceof Window)) {
@ -74,11 +75,14 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** This action listener reads all values
*/
KeyListener readDoubleAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
try {
int d = new Integer(m_PValue.getText()).intValue();
@ -92,11 +96,14 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** This action listener reads all values
*/
KeyListener readDoubleArrayAction = new KeyListener() {
@Override
public void keyPressed(KeyEvent event) {
}
@Override
public void keyTyped(KeyEvent event) {
}
@Override
public void keyReleased(KeyEvent event) {
double[] tmpT = m_WLPT.m_IdealValue;
double[] tmpP = m_WLPT.m_Weights;
@ -167,6 +174,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** This method will set the value of object that is to be edited.
* @param o an object that must be an array.
*/
@Override
public void setValue(Object o) {
if (o instanceof PropertyWeightedLPTchebycheff) {
this.m_WLPT = (PropertyWeightedLPTchebycheff) o;
@ -177,10 +185,12 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** Returns the current object.
* @return the current object
*/
@Override
public Object getValue() {
return this.m_WLPT;
}
@Override
public String getJavaInitializationString() {
return "TEST";
}
@ -188,6 +198,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -195,6 +206,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -202,15 +214,18 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) m_Support = new PropertyChangeSupport(this);
m_Support.removePropertyChangeListener(l);
@ -233,6 +248,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** Returns true since the Object can be shown
* @return true
*/
@Override
public boolean isPaintable() {
return true;
}
@ -242,6 +258,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
* @param gfx the graphics context to use
* @param box the area we are allowed to paint into
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -252,6 +269,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** Returns true because we do support a custom editor.
* @return true
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -259,6 +277,7 @@ public class GenericWeigthedLPTchebycheffEditor extends JPanel implements Proper
/** Returns the array editing component.
* @return a value of type 'java.awt.Component'
*/
@Override
public Component getCustomEditor() {
if (this.m_CustomEditor == null) this.initCustomEditor();
return m_CustomEditor;

View File

@ -43,6 +43,7 @@ public class GraphPointSetLegend {
*
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Pair<String, Color> o1, Pair<String, Color> o2) {
int comp = o1.car().compareTo(o2.car());
// Same text; let us see if the color is also identical.

View File

@ -104,6 +104,7 @@ public class HtmlDemo {
*/
public HyperlinkListener createHyperLinkListener() {
return new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
if (e instanceof HTMLFrameHyperlinkEvent) {

View File

@ -81,6 +81,7 @@ public class JEFrame extends JInternalFrame {
this.getRootPane().getActionMap().put(
"ctrlFpressed",
new AbstractAction("ctrlFpressed") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
JEFrameRegister.getInstance().getFrameList().get(0).toFront();
}
@ -93,6 +94,7 @@ public class JEFrame extends JInternalFrame {
this.getRootPane().getActionMap().put(
"ctrlOpressed",
new AbstractAction("ctrlOpressed") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
java.util.List<JEFrame> frameList = JEFrameRegister.getInstance().getFrameList();
for (JEFrame frame : frameList) {
@ -109,6 +111,7 @@ public class JEFrame extends JInternalFrame {
this.getRootPane().getActionMap().put(
"ctrlSmallerpressed",
new AbstractAction("ctrlSmallerpressed") {
@Override
public void actionPerformed(ActionEvent actionEvent) {
JEFrameRegister.getInstance().setFocusToNext(self);
}

View File

@ -206,6 +206,7 @@ public class JExtDesktopPane extends JDesktopPane {
public int getFrameCount() {
return getComponentCount(new ComponentFilter() {
@Override
public boolean accept(Component c) {
return c instanceof JInternalFrame
|| (c instanceof JInternalFrame.JDesktopIcon
@ -237,6 +238,7 @@ public class JExtDesktopPane extends JDesktopPane {
}
}
@Override
public void addImpl(Component comp, Object constraints, int index) {
super.addImpl(comp, constraints, index);
//System.out.println("JExtDesktopPane.addImpl");

View File

@ -26,6 +26,7 @@ public class JExtFileChooser extends JFileChooser{
return overwriteWarning;
}
@Override
public void approveSelection(){
if(getDialogType() == JFileChooser.SAVE_DIALOG && overwriteWarning){
File f = getSelectedFile();

View File

@ -45,6 +45,7 @@ public class JExtMenu extends JMenu{
/**
*
*/
@Override
public JMenuItem add(Action a){
JMenuItem item = super.add(a);
Object o;
@ -59,8 +60,10 @@ public class JExtMenu extends JMenu{
/**
*
*/
@Override
protected PropertyChangeListener createActionChangeListener(JMenuItem b){
return new ExtActionChangedListener(b){
@Override
public void propertyChange(PropertyChangeEvent e) {
JMenuItem menuItem = (JMenuItem)component;
if(menuItem == null) return;

View File

@ -18,6 +18,7 @@ import javax.swing.*;
*
*/
public class JExtToolBar extends JToolBar{
@Override
public JButton add(Action a){
JButton button = super.add(a);
button.setText(null);
@ -49,8 +50,10 @@ public class JExtToolBar extends JToolBar{
return result.toString();
}
@Override
protected PropertyChangeListener createActionChangeListener(JButton b){
return new ExtActionChangedListener(b){
@Override
public void propertyChange(PropertyChangeEvent e){
JButton button = (JButton)component;

View File

@ -39,6 +39,7 @@ public class JParaPanel implements Serializable, PanelMaker {
/**
*/
@Override
public JComponent makePanel() {
PropertyEditorProvider.installEditors();

View File

@ -34,6 +34,7 @@ public class JTextEditorInternalFrame extends JDocFrame{
setEnabled(false);
}
@Override
public void actionPerformed(ActionEvent e){
try{
undo.undo();
@ -64,6 +65,7 @@ public class JTextEditorInternalFrame extends JDocFrame{
setEnabled(false);
}
@Override
public void actionPerformed(ActionEvent e) {
try{
undo.redo();
@ -93,16 +95,19 @@ public class JTextEditorInternalFrame extends JDocFrame{
///////////////////////////////////////////
//
/////////////////////////////////////////
@Override
public String[] getActionGroups(){
return actionGroups;
}
private JMenu mnuEdit;
private JToolBar barEdit;
@Override
public JMenu getMenu(String group){
if(GROUP_EDIT.equals(group)) return mnuEdit;
else return null;
}
@Override
public JToolBar getToolBar(String group){
if(GROUP_EDIT.equals(group)) return barEdit;
return null;
@ -203,20 +208,24 @@ public class JTextEditorInternalFrame extends JDocFrame{
setChanged(true);
}
@Override
public void changedUpdate(DocumentEvent e){
changed();
}
@Override
public void insertUpdate(DocumentEvent e){
changed();
}
@Override
public void removeUpdate(DocumentEvent e){
changed();
}
});
textArea.getDocument().addUndoableEditListener(new UndoableEditListener(){
@Override
public void undoableEditHappened(UndoableEditEvent e){
undo.addEdit(e.getEdit());
actUndo.update();
@ -259,6 +268,7 @@ public class JTextEditorInternalFrame extends JDocFrame{
createActions();
}
@Override
public void save(File f){
FileWriter out = null;
try{
@ -276,6 +286,7 @@ public class JTextEditorInternalFrame extends JDocFrame{
super.save(f);
}
@Override
public void setSelected(boolean value) throws java.beans.PropertyVetoException{
super.setSelected(value);

View File

@ -41,6 +41,7 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
/**
*
*/
@Override
public void print(String text) {
if (textArea == null) {
createFrame();
@ -49,10 +50,12 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
textArea.repaint();
}
@Override
public void println(String txt) {
print(txt + '\n');
}
@Override
public void setShow(boolean bShow) {
if (frame.isVisible() != bShow) {
if (frame.isVisible()) {
@ -100,6 +103,7 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
private int lastHeight;
//
@Override
public void stateChanged(ChangeEvent e) {
JViewport viewport = (JViewport) e.getSource();
int Height = viewport.getViewSize().height;
@ -131,6 +135,7 @@ public class JTextoutputFrame implements JTextoutputFrameInterface, ActionListen
textArea.addMouseListener(popupListener);
}
@Override
public void actionPerformed(ActionEvent e) {
JMenuItem src = (JMenuItem) e.getSource();
if (src == clearItem) {
@ -157,10 +162,12 @@ class PopupListener extends MouseAdapter {
popup = pm;
}
@Override
public void mousePressed(MouseEvent e) {
maybeShowPopup(e);
}
@Override
public void mouseReleased(MouseEvent e) {
maybeShowPopup(e);
}

View File

@ -70,6 +70,7 @@ public class LoggingPanel extends JPanel {
scrollpane.getViewport().addChangeListener(new ChangeListener() {
private int lastHeight;
//
@Override
public void stateChanged(ChangeEvent e) {
JViewport viewport = (JViewport)e.getSource();
int height = viewport.getViewSize().height;

View File

@ -17,23 +17,31 @@ import java.awt.event.*;
public class MultiLineStringEditor implements PropertyEditor {
protected MultiLineString value; // The value we will be editing.
@Override
public void setValue(Object o) { value=(MultiLineString) o;}
@Override
public Object getValue() { return value; }
@Override
public void setAsText(String s) { value.setString(s); }
@Override
public String getAsText() { return value.getString(); }
@Override
public String[] getTags() { return null; } // not enumerated; no tags
// Say that we allow custom editing.
@Override
public boolean supportsCustomEditor() { return true; }
// Return the custom editor. This just creates and returns a TextArea
// to edit the multi-line text. But it also registers a listener on the
// text area to update the value as the user types and to fire the
// property change events that property editors are required to fire.
@Override
public Component getCustomEditor() {
final TextArea t = new TextArea(value.string);
t.setSize(300, 150); // TextArea doesn't have a preferred size, so set one
t.addTextListener(new TextListener() {
@Override
public void textValueChanged(TextEvent e) {
value.setString(t.getText());
listeners.firePropertyChange(null, null, null);
@ -45,8 +53,10 @@ public class MultiLineStringEditor implements PropertyEditor {
// Visual display of the value, for use with the custom editor.
// Just print some instructions and hope they fit in the in the box.
// This could be more sophisticated.
@Override
public boolean isPaintable() { return true; }
@Override
public void paintValue(Graphics g, Rectangle r) {
g.setClip(r);
g.drawString("Click to edit...", r.x+5, r.y+15);
@ -54,17 +64,20 @@ public class MultiLineStringEditor implements PropertyEditor {
// Important method for code generators. Note that it
// ought to add any necessary escape sequences.
@Override
public String getJavaInitializationString() { return "\"" + value + "\""; }
// This code uses the PropertyChangeSupport class to maintain a list of
// listeners interested in the edits we make to the value.
protected PropertyChangeSupport listeners = new PropertyChangeSupport(this);
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (listeners == null) listeners = new PropertyChangeSupport(this);
listeners.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (listeners == null) listeners = new PropertyChangeSupport(this);
listeners.removePropertyChangeListener(l);

View File

@ -109,6 +109,7 @@ public class Plot implements PlotInterface, Serializable {
JButton ClearButton = new JButton("Clear");
ClearButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
clearAll();
}
@ -117,6 +118,7 @@ public class Plot implements PlotInterface, Serializable {
LOGButton.setToolTipText("Toggle between a linear and a log scale on the y-axis.");
LOGButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_PlotArea.toggleLog();
}
@ -125,6 +127,7 @@ public class Plot implements PlotInterface, Serializable {
ExportButton.setToolTipText("Exports the graph data to a simple TSV file.");
ExportButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
exportPlot();
}
@ -133,6 +136,7 @@ public class Plot implements PlotInterface, Serializable {
DumpButton.setToolTipText("Dump the graph data to standard output");
DumpButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
m_PlotArea.exportToAscii();
}
@ -141,6 +145,7 @@ public class Plot implements PlotInterface, Serializable {
JButton saveImageButton = new JButton("Save as PNG...");
saveImageButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
Robot robot = new Robot();
@ -211,6 +216,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void init() {
m_Frame = new JEFrame("Plot: " + plotName);
BasicResourceLoader loader = BasicResourceLoader.instance();
@ -315,6 +321,7 @@ public class Plot implements PlotInterface, Serializable {
*
* @return true if the Plot object is valid
*/
@Override
public boolean isValid() {
return (m_Frame != null) && (m_PlotArea != null);
}
@ -322,10 +329,12 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void setConnectedPoint(double x, double y, int func) {
m_PlotArea.setConnectedPoint(x, y, func);
}
@Override
public int getPointCount(int graphLabel) {
return m_PlotArea.getPointCount(graphLabel);
}
@ -333,6 +342,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void addGraph(int g1, int g2, boolean forceAdd) {
m_PlotArea.addGraph(g1, g2, forceAdd);
}
@ -340,6 +350,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void setUnconnectedPoint(double x, double y, int GraphLabel) {
m_PlotArea.setUnconnectedPoint(x, y, GraphLabel);
}
@ -347,6 +358,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void clearAll() {
m_PlotArea.clearAll();
m_PlotArea.removeAllDElements();
@ -357,6 +369,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void clearGraph(int GraphNumber) {
m_PlotArea.clearGraph(GraphNumber);
}
@ -364,6 +377,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void setInfoString(int GraphLabel, String Info, float stroke) {
m_PlotArea.setInfoString(GraphLabel, Info, stroke);
}
@ -371,6 +385,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public void jump() {
m_PlotArea.jump();
}
@ -471,6 +486,7 @@ public class Plot implements PlotInterface, Serializable {
/**
*
*/
@Override
public String getName() {
return this.plotName;
}

View File

@ -22,6 +22,7 @@ public class PropertyBoolSelector extends JCheckBox {
setSelected(false);
addItemListener(new ItemListener () {
@Override
public void itemStateChanged (ItemEvent evt) {
if (evt.getStateChange() == ItemEvent.SELECTED) {
m_Editor.setValue(Boolean.TRUE);

View File

@ -42,6 +42,7 @@ public class PropertyDoubleArray implements java.io.Serializable {
}
}
@Override
public Object clone() {
return (Object) new PropertyDoubleArray(this);
}
@ -165,6 +166,7 @@ public class PropertyDoubleArray implements java.io.Serializable {
return (k>=0) && (k<getNumRows());
}
@Override
public String toString() {
return BeanInspector.toString(m_DoubleArray);
}

View File

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

View File

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

View File

@ -52,6 +52,7 @@ public class PropertyFilePath implements java.io.Serializable {
else return new PropertyFilePath(fName);
}
@Override
public Object clone() {
return (Object) new PropertyFilePath(this);
}

View File

@ -19,6 +19,7 @@ public class PropertyIntArray implements java.io.Serializable {
System.arraycopy(d.m_IntArray, 0, this.m_IntArray, 0, this.m_IntArray.length);
}
@Override
public Object clone() {
return (Object) new PropertyIntArray(this);
}

View File

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

View File

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

View File

@ -80,6 +80,7 @@ public class PropertyPanel extends JPanel {
/**
*
*/
@Override
public void removeNotify() {
if (propertyDialog != null) {
propertyDialog = null;
@ -89,6 +90,7 @@ public class PropertyPanel extends JPanel {
/**
*
*/
@Override
public void paintComponent(Graphics g) {
Insets i = textLabel.getInsets();
Rectangle box = new Rectangle(i.left, i.top,

View File

@ -26,6 +26,7 @@ class ServerNode implements java.io.Serializable {
this.m_CPUs = a.m_CPUs;
this.m_ServerName = a.m_ServerName;
}
@Override
public Object clone() {
return (Object) new ServerNode(this);
}
@ -57,6 +58,7 @@ public class PropertyRemoteServers implements java.io.Serializable {
}
}
@Override
public Object clone() {
return (Object) new PropertyRemoteServers(this);
}

View File

@ -34,6 +34,7 @@ public class PropertySelectableList<T> implements java.io.Serializable {
}
}
@Override
public Object clone() {
return (Object) new PropertySelectableList<T>(this);
}

View File

@ -108,6 +108,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
*
* @param evt a value of type 'PropertyChangeEvent'
*/
@Override
public void propertyChange(PropertyChangeEvent evt) {
wasModified(evt); // Let our panel update before guys downstream
propertyChangeSupport.removePropertyChangeListener(this);
@ -115,6 +116,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
propertyChangeSupport.addPropertyChangeListener(this);
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);
@ -122,6 +124,7 @@ public class PropertySheetPanel extends JPanel implements PropertyChangeListener
propertyChangeSupport.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (propertyChangeSupport == null) {
propertyChangeSupport = new PropertyChangeSupport(this);

View File

@ -117,6 +117,7 @@ class JCheckBoxFlag extends JCheckBox {
m_Flag = flag;
addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent evt) {
if (evt.getStateChange() == evt.SELECTED) {
m_Flag = true;

View File

@ -44,12 +44,14 @@ class PropertySlider extends JPanel {
this.add(slider);
propertyEditor.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
updateUs();
}
});
addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
// if (e.getKeyCode() == KeyEvent.VK_ENTER)
updateEditor();
@ -57,6 +59,7 @@ class PropertySlider extends JPanel {
});
addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
updateEditor();
}
@ -95,6 +98,7 @@ class PropertySlider extends JPanel {
public SliderListener() {
}
@Override
public void stateChanged(ChangeEvent e) {
JSlider s1 = (JSlider) e.getSource();
System.out.println("slider" + s1.getValue());

View File

@ -31,6 +31,7 @@ public class PropertyValueSelector extends JComboBox {
/**
*
*/
@Override
public Object getSelectedItem() {
return propertyEditor.getAsText();
}
@ -38,6 +39,7 @@ public class PropertyValueSelector extends JComboBox {
/**
*
*/
@Override
public void setSelectedItem(Object o) {
propertyEditor.setAsText((String) o);
}

View File

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

View File

@ -32,6 +32,7 @@ public class StatisticsEditor implements PropertyEditor {
m_StatPanel.addPropertyChangeListener(
new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
m_Support.firePropertyChange("", null, null);
}
@ -47,6 +48,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public void setValue(Object value) {
if (value instanceof GenericStatistics) {
m_Value = (GenericStatistics) value;
@ -58,6 +60,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public Object getValue() {
System.out.println("getValue !!!!!!!!!!!!");
m_Value.setState(m_StatPanel.getState());
@ -67,6 +70,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public String getJavaInitializationString() {
return "null";
}
@ -74,6 +78,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public boolean isPaintable() {
return true;
}
@ -81,6 +86,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public void paintValue(Graphics gfx, Rectangle box) {
FontMetrics fm = gfx.getFontMetrics();
int vpad = (box.height - fm.getAscent()) / 2;
@ -91,6 +97,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public String getAsText() {
return null;
}
@ -98,6 +105,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public void setAsText(String text) throws IllegalArgumentException {
throw new IllegalArgumentException(text);
}
@ -105,6 +113,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public String[] getTags() {
return null;
}
@ -112,6 +121,7 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public boolean supportsCustomEditor() {
return true;
}
@ -119,10 +129,12 @@ public class StatisticsEditor implements PropertyEditor {
/**
*
*/
@Override
public Component getCustomEditor() {
return m_Panel;
}
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) {
m_Support = new PropertyChangeSupport(this);
@ -130,6 +142,7 @@ public class StatisticsEditor implements PropertyEditor {
m_Support.addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
if (m_Support == null) {
m_Support = new PropertyChangeSupport(this);

View File

@ -32,6 +32,7 @@ public class TagEditor extends PropertyEditorSupport {
*
* @return a value of type 'String'
*/
@Override
public String getJavaInitializationString() {
SelectedTag s = (SelectedTag)getValue();
@ -56,6 +57,7 @@ public class TagEditor extends PropertyEditorSupport {
*
* @return a value of type 'String'
*/
@Override
public String getAsText() {
SelectedTag s = (SelectedTag)getValue();
return s.getSelectedTag().getString();
@ -67,6 +69,7 @@ public class TagEditor extends PropertyEditorSupport {
* @param text the text of the selected tag.
* @exception java.lang.IllegalArgumentException if an error occurs
*/
@Override
public void setAsText(String text) throws java.lang.IllegalArgumentException {
SelectedTag s = (SelectedTag)getValue();
Tag [] tags = s.getTags();
@ -87,6 +90,7 @@ public class TagEditor extends PropertyEditorSupport {
*
* @return an array of string tags.
*/
@Override
public String[] getTags() {
SelectedTag s = (SelectedTag)getValue();
@ -123,6 +127,7 @@ public class TagEditor extends PropertyEditorSupport {
byte[] bytes = loader.getBytesFromResourceLocation(EvAInfo.iconLocation, true);
f.setIconImage(Toolkit.getDefaultToolkit().createImage(bytes));
f.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}

View File

@ -68,10 +68,12 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
contentInsets = new Insets(i, i, i, i);
}
@Override
public int getTabRunCount(JTabbedPane pane) {
return 1;
}
@Override
protected void installDefaults() {
super.installDefaults();
@ -87,15 +89,18 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
return false;
}
@Override
protected Insets getContentBorderInsets(int tabPlacement) {
return contentInsets;
}
@Override
protected int calculateTabHeight(int tabPlacement, int tabIndex,
int fontHeight) {
return 21;
}
@Override
protected int calculateTabWidth(int tabPlacement, int tabIndex,
FontMetrics metrics) {
int w = super.calculateTabWidth(tabPlacement, tabIndex, metrics);
@ -104,10 +109,12 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
return w;
}
@Override
protected int calculateMaxTabHeight(int tabPlacement) {
return 21;
}
@Override
protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex) {
Graphics2D g2d = (Graphics2D) g;
g2d.setPaint(new GradientPaint(0, 0, defaultColorSet.topGradColor1, 0,
@ -125,6 +132,7 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
}
}
@Override
protected void paintTabBackground(Graphics g, int tabPlacement,
int tabIndex, int x, int y, int w, int h, boolean isSelected) {
Graphics2D g2d = (Graphics2D) g;
@ -164,6 +172,7 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
}
}
@Override
protected void paintTabBorder(Graphics g, int tabPlacement, int tabIndex,
int x, int y, int w, int h, boolean isSelected) {
Rectangle rect = getTabBounds(tabIndex, new Rectangle(x, y, w, h));
@ -171,31 +180,37 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
g.drawLine(rect.x + rect.width, 0, rect.x + rect.width, 20);
}
@Override
protected void paintContentBorderTopEdge(Graphics g, int tabPlacement,
int selectedIndex, int x, int y, int w, int h) {
}
@Override
protected void paintContentBorderRightEdge(Graphics g, int tabPlacement,
int selectedIndex, int x, int y, int w, int h) {
// Do nothing
}
@Override
protected void paintContentBorderLeftEdge(Graphics g, int tabPlacement,
int selectedIndex, int x, int y, int w, int h) {
// Do nothing
}
@Override
protected void paintContentBorderBottomEdge(Graphics g, int tabPlacement,
int selectedIndex, int x, int y, int w, int h) {
// Do nothing
}
@Override
protected void paintFocusIndicator(Graphics g, int tabPlacement,
Rectangle[] rects, int tabIndex, Rectangle iconRect,
Rectangle textRect, boolean isSelected) {
// Do nothing
}
@Override
protected int getTabLabelShiftY(int tabPlacement, int tabIndex,
boolean isSelected) {
return 0;
@ -212,26 +227,33 @@ public class CustomTabbedPaneUI extends BasicTabbedPaneUI {
private class RollOverListener implements MouseMotionListener,
MouseListener {
@Override
public void mouseDragged(MouseEvent e) {
}
@Override
public void mouseMoved(MouseEvent e) {
checkRollOver();
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
checkRollOver();
}
@Override
public void mouseExited(MouseEvent e) {
tabPane.repaint();
}

View File

@ -26,14 +26,17 @@ public class EvAMainAdapterImpl extends MainAdapterImpl implements EvAMainAdapte
moduleServer = new ModuleServer(EvAInfo.getProperties());
}
@Override
public String[] getModuleNameList() {
return moduleServer.getModuleNameList();
}
@Override
public ModuleAdapter getModuleAdapter(String selectedModule, boolean withoutRMI, String hostAddress, MainAdapterClient client) {
return getModuleAdapter(selectedModule, withoutRMI, hostAddress, null, null, client);
}
@Override
public ModuleAdapter getModuleAdapter(String selectedModule, boolean withoutRMI, String hostAddress, InterfaceGOParameters goParams, String noGuiStatsFile, MainAdapterClient client) {
return moduleServer.createModuleAdapter(selectedModule, client, withoutRMI, hostAddress, goParams, noGuiStatsFile);
}

View File

@ -27,6 +27,7 @@ public class RMIServerEvA extends RMIServer {
return (RMIServerEvA)instance;
}
@Override
protected void createMainRemoteObject(String mainAdapterName) {
try {
mainRemoteObject = new EvAMainAdapterImpl();

View File

@ -118,6 +118,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
this.m_Frame.setSize(500, 400);
this.m_Frame.setLocation(530, 50);
this.m_Frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
@ -197,11 +198,14 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
/** This action listener, called by the "Run/Restart" button, will init the problem and start the computation.
*/
ActionListener runListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
worker = new SwingWorker() {
@Override
public Object construct() {
return doWork();
}
@Override
public void finished() {
m_RunButton.setEnabled(true);
m_Continue.setEnabled(true);
@ -221,6 +225,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
* the doWork() method handles InterruptedExceptions cleanly.
*/
ActionListener stopListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
m_RunButton.setEnabled(true);
m_Continue.setEnabled(true);
@ -235,12 +240,15 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
* the doWork() method handles InterruptedExceptions cleanly.
*/
ActionListener continueListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
// todo something need to be done here...
worker = new SwingWorker() {
@Override
public Object construct() {
return doWork();
}
@Override
public void finished() {
m_RunButton.setEnabled(true);
m_Continue.setEnabled(true);
@ -264,6 +272,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
* currently best solution in a frame.
*/
ActionListener showSolListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
JFrame frame = new JFrame();
frame.setTitle("The current best solution for "+m_GO.getProblem().getName());
@ -278,6 +287,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
/** This method gives the experimental settings and starts the work.
*/
@Override
public void startExperiment() {
// This is for the CBN-TEST RUNS
this.m_GO.setOptimizer(new EvolutionStrategies());
@ -508,6 +518,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
void updateStatus(final int i) {
if (this.m_ProgressBar != null) {
Runnable doSetProgressBarValue = new Runnable() {
@Override
public void run() {
m_ProgressBar.setValue(i);
}
@ -533,6 +544,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
}
}
@Override
public void setShow(boolean t) {
this.show = t;
}
@ -541,6 +553,7 @@ public class GOStandaloneVersion implements InterfaceGOStandalone, InterfacePopu
* @param source The source of the event.
* @param name Could be used to indicate the nature of the event.
*/
@Override
public void registerPopulationStateChanged(Object source, String name) {
if (name.equals(Population.nextGenerationPerformed)) {
Population population = ((InterfaceOptimizer)source).getPopulation();

View File

@ -19,6 +19,7 @@ public interface InterfaceTerminator {
public boolean isTerminated(PopulationInterface pop);
public boolean isTerminated(InterfaceSolutionSet pop);
@Override
public String toString();
public String lastTerminationMessage();
public void init(InterfaceOptimizationProblem prob);

View File

@ -58,6 +58,7 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
this.m_JFrame.setSize(1200, 750);
this.m_JFrame.setLocation(50, 50);
this.m_JFrame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent ev) {
System.exit(0);
}
@ -359,6 +360,7 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
/** This method starts the actual optimization procedure
*/
@Override
public void startExperiment() {
if (this.m_JFrame != null) {
}
@ -370,9 +372,11 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
if (this.m_State.m_Optimizer.getPopulation().size() == 0) this.m_State.m_Optimizer.init();
this.m_State.m_Optimizer.addPopulationChangedEventListener(this);
worker = new SwingWorker() {
@Override
public Object construct() {
return doWork();
}
@Override
public void finished() {
Population[] pop = null;
if (m_State.m_Optimizer instanceof IslandModelEA) {
@ -406,6 +410,7 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
void updateStatus(final String t, final int i) {
if (this.m_ProgressBar != null) {
Runnable doSetProgressBarValue = new Runnable() {
@Override
public void run() {
m_ProgressBar.setValue(i);
}
@ -438,6 +443,7 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
return "All Done";
}
@Override
public void setShow(boolean t) {
// i guess this is not necessary in this environment
}
@ -449,6 +455,7 @@ public class MOCCOStandalone implements InterfaceGOStandalone, InterfacePopulati
* @param source The source of the event.
* @param name Could be used to indicate the nature of the event.
*/
@Override
public void registerPopulationStateChanged(Object source, String name) {
int currentProgress;
if (name.equals(Population.nextGenerationPerformed)) {

View File

@ -89,10 +89,12 @@ public abstract class SwingWorker {
*/
public SwingWorker() {
final Runnable doFinished = new Runnable() {
@Override
public void run() { finished(); }
};
Runnable doConstruct = new Runnable() {
@Override
public void run() {
try {
setValue(construct());

View File

@ -81,6 +81,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
*
* @return The clone
*/
@Override
public abstract Object clone();
/**
@ -595,6 +596,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
*
* @return The complete fitness array
*/
@Override
public double[] getFitness() {
return this.m_Fitness;
}
@ -620,6 +622,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
* @param fitness The new fitness array
* @deprecated
*/
@Override
public void setFitness(double[] fitness) {
this.m_Fitness = fitness;
}

View File

@ -108,6 +108,7 @@ public class AbstractEAIndividualComparator implements Comparator<Object>, Seria
preferFeasible = other.preferFeasible;
}
@Override
public Object clone() {
return new AbstractEAIndividualComparator(this);
}
@ -120,6 +121,7 @@ public class AbstractEAIndividualComparator implements Comparator<Object>, Seria
* @param o2 the second AbstractEAIndividual to compare
* @return -1 if the first is dominant, 1 if the second is dominant, otherwise 0
*/
@Override
public int compare(Object o1, Object o2) {
boolean o1domO2, o2domO1;

View File

@ -65,6 +65,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new ESIndividualBinaryData(this);
}
@ -73,6 +74,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof ESIndividualBinaryData) {
ESIndividualBinaryData indy = (ESIndividualBinaryData) individual;
@ -95,6 +97,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to request a certain amount of binary data
* @param length The lenght of the BitSet that is to be optimized
*/
@Override
public void setBinaryDataLength(int length) {
this.m_Genotype = new double[length];
this.m_Range = new double[length][2];
@ -107,6 +110,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method returns the length of the binary data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Genotype.length;
}
@ -114,6 +118,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryData() {
if (this.m_UseHardSwitch) {
// In this case it is only tested if the genotyp is bigger than 0.5
@ -141,6 +146,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* an update from the genotype
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -148,6 +154,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to set the binary data.
* @param binaryData The new binary data.
*/
@Override
public void SetBinaryPhenotype(BitSet binaryData) {
this.m_Phenotype = binaryData;
}
@ -155,6 +162,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBinaryGenotype(BitSet binaryData) {
this.SetBinaryPhenotype(binaryData);
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -176,6 +184,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof BitSet) {
BitSet bs = (BitSet) obj;
@ -192,6 +201,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "ESIndividual coding double: (";
@ -215,6 +225,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method will allow the user to read the ES 'genotype'
* @return BitSet
*/
@Override
public double[] getDGenotype() {
return this.m_Genotype;
}
@ -222,6 +233,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method will allow the user to set the current ES 'genotype'.
* @param b The new genotype of the Individual
*/
@Override
public void SetDGenotype(double[] b) {
this.m_Genotype = b;
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -242,16 +254,19 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
return this.m_Range;
}
/** This method performs a simple one element mutation on the double vector
*/
@Override
public void defaultMutate() {
ESIndividualDoubleData.defaultMutate(m_Genotype, m_Range);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
if ((prob != null) && (prob instanceof InterfaceHasInitRange) && (((InterfaceHasInitRange)prob).getInitRange()!=null)) ESIndividualDoubleData.defaultInit(m_Genotype, (double[][])((InterfaceHasInitRange)prob).getInitRange());
else ESIndividualDoubleData.defaultInit(m_Genotype, m_Range);
@ -263,6 +278,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "ES individual";
}

View File

@ -66,6 +66,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new ESIndividualDoubleData(this);
}
@ -74,6 +75,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof ESIndividualDoubleData) {
ESIndividualDoubleData indy = (ESIndividualDoubleData) individual;
@ -98,6 +100,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setDoubleDataLength (int length) {
double[] newDesPa = new double[length];
double[][] newRange = new double[length][2];
@ -131,6 +134,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Genotype.length;
}
@ -140,6 +144,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* ranges.
* @param range The new range for the double data.
*/
@Override
public void SetDoubleRange(double[][] range) {
if (range.length != this.m_Range.length) {
System.out.println("Warning: Trying to set a range of length " + range.length + " to a vector of length "
@ -154,6 +159,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
return this.m_Range;
}
@ -162,6 +168,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* and the genotype copied.
* @return BitSet representing the double data.
*/
@Override
public double[] getDoubleData() {
// since the phenotype is set to null if the genotype is changed,
// it should now be save to only perform the copy if the phenotype is null
@ -178,6 +185,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* an update from the genotype.
* @return double[] representing the double data.
*/
@Override
public double[] getDoubleDataWithoutUpdate() {
if (m_Phenotype==null) return getDoubleData();
else return this.m_Phenotype;
@ -187,6 +195,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* use SetDoubleDataLamarckian().
* @param doubleData The new double data.
*/
@Override
public void SetDoublePhenotype(double[] doubleData) {
this.m_Phenotype = doubleData;
}
@ -195,6 +204,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param doubleData The new double data.
*/
@Override
public void SetDoubleGenotype(double[] doubleData) {
// this.SetDoublePhenotype(doubleData);
this.SetDoublePhenotype(null); // tag it as invalid
@ -208,6 +218,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method will allow a default initialisation of the individual
* @param opt The optimization problem that is to be solved.
*/
@Override
public void init(InterfaceOptimizationProblem opt) {
super.init(opt);
// evil operators may not respect the range, so at least give some hint
@ -219,6 +230,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof double[]) {
double[] bs = (double[]) obj;
@ -236,6 +248,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
StringBuilder strB = new StringBuilder(200);
strB.append("ESIndividual coding double: (Fitness {");
@ -264,6 +277,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method will allow the user to read the ES 'genotype'
* @return BitSet
*/
@Override
public double[] getDGenotype() {
return this.m_Genotype;
}
@ -271,6 +285,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method will allow the user to set the current ES 'genotype'.
* @param b The new genotype of the Individual
*/
@Override
public void SetDGenotype(double[] b) {
this.m_Genotype = b;
this.m_Phenotype=null; // mark it as invalid
@ -290,6 +305,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method performs a simple one element mutation on the double vector
*/
@Override
public void defaultMutate() {
ESIndividualDoubleData.defaultMutate(this.m_Genotype, this.m_Range);
m_Phenotype=null; // mark it as invalid
@ -310,6 +326,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
if (genotype[mutationIndex] > range[mutationIndex][1]) genotype[mutationIndex] = range[mutationIndex][1];
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
if ((prob != null) && (prob instanceof InterfaceHasInitRange) && (((InterfaceHasInitRange)prob).getInitRange()!=null)) ESIndividualDoubleData.defaultInit(m_Genotype, (double[][])((InterfaceHasInitRange)prob).getInitRange());
else ESIndividualDoubleData.defaultInit(m_Genotype, m_Range);
@ -336,6 +353,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "ES individual";
}

View File

@ -61,6 +61,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new ESIndividualIntegerData(this);
}
@ -69,6 +70,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof ESIndividualIntegerData) {
ESIndividualIntegerData indy = (ESIndividualIntegerData) individual;
@ -91,6 +93,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to request a certain amount of int data
* @param length The lenght of the int[] that is to be optimized
*/
@Override
public void setIntegerDataLength (int length) {
double[] newDesPa = new double[length];
int[][] newRange = new int[length][2];
@ -115,6 +118,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method returns the length of the int data set
* @return The number of ints stored
*/
@Override
public int size() {
return this.m_Genotype.length;
}
@ -124,6 +128,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* ranges.
* @param range The new range for the int data.
*/
@Override
public void SetIntRange(int[][] range) {
if (range.length != this.m_Range.length) {
System.out.println("Warning: Trying to set a range of length " + range.length + " to a vector of length "
@ -138,6 +143,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will return the range for all int attributes.
* @return The range array.
*/
@Override
public int[][] getIntRange() {
return this.m_Range;
}
@ -145,6 +151,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to read the int data
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerData() {
this.m_Phenotype = new int[this.m_Genotype.length];
for (int i = 0; i < this.m_Phenotype.length; i++) {
@ -159,6 +166,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* an update from the genotype
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -166,6 +174,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the int data.
* @param intData The new int data.
*/
@Override
public void SetIntPhenotype(int[] intData) {
this.m_Phenotype = intData;
}
@ -174,6 +183,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms.
* @param intData The new int data.
*/
@Override
public void SetIntGenotype(int[] intData) {
for (int i = 0; i < this.m_Genotype.length; i++) {
m_Genotype[i]=(double)intData[i];
@ -190,6 +200,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[]) {
int[] bs = (int[]) obj;
@ -207,6 +218,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "ESIndividual coding int: (";
@ -229,6 +241,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will allow the user to read the ES 'genotype'
* @return BitSet
*/
@Override
public double[] getDGenotype() {
return this.m_Genotype;
}
@ -236,6 +249,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will allow the user to set the current ES 'genotype'.
* @param b The new genotype of the Individual
*/
@Override
public void SetDGenotype(double[] b) {
this.m_Genotype = b;
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -246,6 +260,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method performs a simple one element mutation on the double vector
*/
@Override
public void defaultMutate() {
int mutationIndex = RNG.randomInt(0, this.m_Genotype.length-1);
this.m_Genotype[mutationIndex] += ((this.m_Range[mutationIndex][1] - this.m_Range[mutationIndex][0])/2)*RNG.gaussianDouble(0.05f);
@ -256,6 +271,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
double[][] result = new double[this.m_Range.length][2];
for (int i = 0; i < this.m_Range.length; i++) {
@ -265,6 +281,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
return result;
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
int[][] range = m_Range;
if ((prob != null) && (prob instanceof InterfaceHasInitRange) && (((InterfaceHasInitRange)prob).getInitRange()!=null)) range = (int[][])((InterfaceHasInitRange)prob).getInitRange();
@ -279,6 +296,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "ES individual";
}

View File

@ -79,6 +79,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
}
@Override
public Object clone() {
return (Object) new ESIndividualPermutationData(this);
}
@ -87,6 +88,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof ESIndividualPermutationData) {
ESIndividualPermutationData indy = (ESIndividualPermutationData) individual;
@ -108,6 +110,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* InterfaceDataTypePermutation methods
*/
@Override
public void setPermutationDataLength(int[] length){
this.m_Genotype = new double[length.length][];
@ -126,6 +129,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
}
}
@Override
public int[] sizePermutation() {
int[] res = new int[m_Genotype.length];
for (int i = 0; i < m_Genotype.length; i++) {
@ -134,6 +138,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
return res;
}
@Override
public void SetPermutationPhenotype(int[][] perm){
this.m_Phenotype = perm;
this.m_Range = new double[perm.length][][];
@ -147,6 +152,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
}
@Override
public void SetPermutationGenotype(int[][] perm){
this.SetPermutationPhenotype(perm);
@ -170,6 +176,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
}
@Override
public int[][] getPermutationData() {
this.m_Phenotype = new int[this.m_Genotype.length][];
for (int p = 0; p < m_Genotype.length; p++) {
@ -200,6 +207,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* an update from the genotype
* @return int[] representing the permutation.
*/
@Override
public int[][] getPermutationDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -207,6 +215,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
public int[] getFirstindex() {
return firstindex;
}
@Override
public void setFirstindex(int[] firstindex) {
this.firstindex = firstindex;
}
@ -220,6 +229,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[][]) {
int[][] bs = (int[][]) obj;
@ -237,6 +247,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "ESIndividual coding permutation: (";
@ -259,6 +270,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
/** This method will allow the user to read the ES 'genotype'
* @return BitSet
*/
@Override
public double[] getDGenotype() {
return mapMatrixToVector(m_Genotype);
}
@ -297,6 +309,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
/** This method will allow the user to set the current ES 'genotype'.
* @param b The new genotype of the Individual
*/
@Override
public void SetDGenotype(double[] b) {
this.m_Genotype = mapVectorToMatrix(b, this.sizePermutation());
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -311,12 +324,14 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
/** This method performs a one element mutation on every permutation coded by a double vector.
*/
@Override
public void defaultMutate() {
for (int i = 0; i < m_Genotype.length; i++) {
ESIndividualDoubleData.defaultMutate(m_Genotype[i], m_Range[i]);
}
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
double[][][] range = m_Range;
if ((prob != null) && (prob instanceof InterfaceHasInitRange) && (((InterfaceHasInitRange)prob).getInitRange()!=null)) range = (double[][][])((InterfaceHasInitRange)prob).getInitRange();
@ -329,6 +344,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
int sumentries = 0;
for (int i = 0; i < this.m_Range.length; i++) {
@ -353,6 +369,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "ES individual";
}

View File

@ -48,6 +48,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GAESIndividualBinaryDoubleData(this);
}
@ -56,6 +57,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GAESIndividualBinaryDoubleData) {
GAESIndividualBinaryDoubleData indy = (GAESIndividualBinaryDoubleData)individual;
@ -70,11 +72,13 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method will allow a default initialisation of the individual
* @param opt The optimization problem that is to be solved.
*/
@Override
public void init(InterfaceOptimizationProblem opt) {
((AbstractEAIndividual)this.m_Numbers).init(opt);
((AbstractEAIndividual)this.m_BitSet).init(opt);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
((AbstractEAIndividual)this.m_Numbers).defaultInit(prob);
((AbstractEAIndividual)this.m_BitSet).defaultInit(prob);
@ -85,6 +89,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof Object[]) {
if (((Object[])obj)[0] instanceof double[]) {
@ -103,11 +108,13 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method will mutate the individual randomly
*/
@Override
public void mutate() {
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_Numbers).mutate();
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_BitSet).mutate();
}
@Override
public void defaultMutate() {
((AbstractEAIndividual)this.m_Numbers).defaultMutate();
((AbstractEAIndividual)this.m_BitSet).defaultMutate();
@ -118,6 +125,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param partners The possible partners
* @return offsprings
*/
@Override
public AbstractEAIndividual[] mateWith(Population partners) {
AbstractEAIndividual[] result;
if (RNG.flipCoin(this.m_CrossoverProbability)) {
@ -172,6 +180,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "This is a hybrid Individual:\n";
result += "The Numbers Part:\n"+((AbstractEAIndividual)this.m_Numbers).getStringRepresentation();
@ -185,6 +194,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setDoubleDataLength (int length) {
this.m_Numbers.setDoubleDataLength(length);
this.m_BitSet.setBinaryDataLength(length);
@ -193,6 +203,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Numbers.size();
}
@ -202,6 +213,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* for dimension d.
* @param range The new range for the double data.
*/
@Override
public void SetDoubleRange(double[][] range) {
this.m_Numbers.SetDoubleRange(range);
}
@ -209,6 +221,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
return this.m_Numbers.getDoubleRange();
}
@ -216,6 +229,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method allows you to read the double data
* @return BitSet representing the double data.
*/
@Override
public double[] getDoubleData() {
return this.m_Numbers.getDoubleData();
}
@ -224,6 +238,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* an update from the genotype
* @return double[] representing the double data.
*/
@Override
public double[] getDoubleDataWithoutUpdate() {
return this.m_Numbers.getDoubleDataWithoutUpdate();
}
@ -232,6 +247,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param doubleData The new double data.
* @see InterfaceDataTypeDouble.SetDoubleData()
*/
@Override
public void SetDoublePhenotype(double[] doubleData) {
this.m_Numbers.SetDoublePhenotype(doubleData);
}
@ -241,6 +257,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param doubleData The new double data.
* @see InterfaceDataTypeDouble.SetDoubleDataLamarckian()
*/
@Override
public void SetDoubleGenotype(double[] doubleData) {
this.m_Numbers.SetDoubleGenotype(doubleData);
}
@ -251,6 +268,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method allows you to request a certain amount of binary data
* @param length The lenght of the BitSet that is to be optimized
*/
@Override
public void setBinaryDataLength (int length) {
this.m_Numbers.setDoubleDataLength(length);
this.m_BitSet.setBinaryDataLength(length);
@ -266,6 +284,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryData() {
return this.m_BitSet.getBinaryData();
}
@ -274,6 +293,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* an update from the genotype
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryDataWithoutUpdate() {
return this.m_BitSet.getBinaryDataWithoutUpdate();
}
@ -282,6 +302,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param binaryData The new binary data.
* @see InterfaceDataTypeBinary.SetBinaryData()
*/
@Override
public void SetBinaryPhenotype(BitSet binaryData) {
this.m_BitSet.SetBinaryPhenotype(binaryData);
}
@ -291,6 +312,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* @param binaryData The new binary data.
* @see InterfaceBinaryData.SetBinaryDataLamarckian()
*/
@Override
public void SetBinaryGenotype(BitSet binaryData) {
this.m_BitSet.SetBinaryGenotype(binaryData);
}
@ -302,6 +324,7 @@ public class GAESIndividualBinaryDoubleData extends AbstractEAIndividual impleme
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GA/ES individual";
}

View File

@ -61,6 +61,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GAIndividualBinaryData(this);
}
@ -69,6 +70,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GAIndividualBinaryData) {
GAIndividualBinaryData indy = (GAIndividualBinaryData) individual;
@ -101,6 +103,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof BitSet) {
BitSet bs = (BitSet) obj;
@ -118,6 +121,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* double[] is used instead of a single double.
* @return The complete fitness array
*/
@Override
public double[] getFitness() {
return this.m_Fitness;
}
@ -126,6 +130,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GAIndividual: (";
@ -151,6 +156,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBGenotype() {
return this.m_Genotype;
}
@ -159,6 +165,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBGenotype(BitSet binaryData) {
this.m_Genotype = binaryData;
}
@ -168,10 +175,12 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* of the last significant bit.
* @return The length of the genotype.
*/
@Override
public int getGenotypeLength() {
return this.m_GenotypeLength;
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
for (int i = 0; i < this.m_GenotypeLength; i++) {
if (RNG.flipCoin(0.5)) this.m_Genotype.set(i);
@ -181,6 +190,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method performs a simple one point mutation in the genotype
*/
@Override
public void defaultMutate() {
int mutationIndex = RNG.randomInt(0, this.m_GenotypeLength);
//if (mutationIndex > 28) System.out.println("Mutate: " + this.getSolutionRepresentationFor());
@ -195,6 +205,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to request a certain amount of binary data
* @param length The lenght of the BitSet that is to be optimized
*/
@Override
public void setBinaryDataLength(int length) {
this.m_GenotypeLength = length;
}
@ -202,6 +213,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method returns the length of the binary data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_GenotypeLength;
}
@ -209,6 +221,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryData() {
this.m_Phenotype = (BitSet)this.m_Genotype.clone();
return this.m_Phenotype;
@ -218,6 +231,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* an update from the genotype
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBinaryDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -225,6 +239,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
/** This method allows you to set the binary data.
* @param binaryData The new binary data.
*/
@Override
public void SetBinaryPhenotype(BitSet binaryData) {
this.m_Phenotype = binaryData;
}
@ -233,6 +248,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBinaryGenotype(BitSet binaryData) {
this.SetBinaryPhenotype(binaryData);
this.m_Genotype =(BitSet)binaryData.clone();
@ -245,6 +261,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GA binary individual";
}

View File

@ -73,6 +73,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GAIndividualDoubleData(this);
}
@ -81,6 +82,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GAIndividualDoubleData) {
GAIndividualDoubleData indy = (GAIndividualDoubleData) individual;
@ -104,6 +106,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setDoubleDataLength (int length) {
double[] newDesPa = new double[length];
double[][] newRange = new double[length][2];
@ -134,6 +137,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Range.length;
}
@ -143,6 +147,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* ranges.
* @param range The new range for the double data.
*/
@Override
public void SetDoubleRange(double[][] range) {
if (range.length != this.m_Range.length) {
System.out.println("Warning: Trying to set a range of length " + range.length + " to a vector of length "
@ -157,6 +162,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
return this.m_Range;
}
@ -164,6 +170,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method allows you to read the double data
* @return BitSet representing the double data.
*/
@Override
public double[] getDoubleData() {
int[] locus = new int[2];
this.m_Phenotype = new double[this.m_Range.length];
@ -179,6 +186,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* an update from the genotype
* @return double[] representing the double data.
*/
@Override
public double[] getDoubleDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -187,6 +195,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* use SetDoubleDataLamarckian.
* @param doubleData The new double data.
*/
@Override
public void SetDoublePhenotype(double[] doubleData) {
this.m_Phenotype = doubleData;
}
@ -195,6 +204,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param doubleData The new double data.
*/
@Override
public void SetDoubleGenotype(double[] doubleData) {
this.SetDoublePhenotype(doubleData);
int[] locus = new int[2];
@ -214,6 +224,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof double[]) {
double[] bs = (double[]) obj;
@ -231,6 +242,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GAIndividual coding double: (";
@ -261,6 +273,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBGenotype() {
return this.m_Genotype;
}
@ -269,6 +282,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBGenotype(BitSet binaryData) {
this.m_Genotype = binaryData;
}
@ -278,10 +292,12 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* of the last significat bit.
* @return The length of the genotype.
*/
@Override
public int getGenotypeLength() {
return this.m_GenotypeLength;
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
for (int i = 0; i < this.m_GenotypeLength; i++) {
if (RNG.flipCoin(0.5)) this.m_Genotype.set(i);
@ -291,6 +307,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
/** This method performs a simple one point mutation in the genotype
*/
@Override
public void defaultMutate() {
int mutationIndex = RNG.randomInt(0, this.m_GenotypeLength);
if (this.m_Genotype.get(mutationIndex)) this.m_Genotype.clear(mutationIndex);
@ -303,6 +320,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GA individual";
}

View File

@ -72,6 +72,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GAIndividualIntegerData(this);
}
@ -81,6 +82,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GAIndividualIntegerData) {
GAIndividualIntegerData indy = (GAIndividualIntegerData) individual;
@ -104,6 +106,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setIntegerDataLength (int length) {
int[] newDesPa = new int[length];
int[][] newRange = new int[length][2];
@ -129,6 +132,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Range.length;
}
@ -138,6 +142,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* ranges.
* @param range The new range for the double data.
*/
@Override
public void SetIntRange(int[][] range) {
if (range.length != this.m_Range.length) {
System.out.println("Warning: Trying to set a range of length " + range.length + " to a vector of length "
@ -179,6 +184,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public int[][] getIntRange() {
return this.m_Range;
}
@ -186,6 +192,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to read the double data
* @return BitSet representing the double data.
*/
@Override
public int[] getIntegerData() {
int[] locus = new int[2];
locus[0] = 0;
@ -203,6 +210,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* an update from the genotype
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -210,6 +218,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the double data.
* @param doubleData The new double data.
*/
@Override
public void SetIntPhenotype(int[] doubleData) {
this.m_Phenotype = doubleData;
}
@ -218,6 +227,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms.
* @param doubleData The new double data.
*/
@Override
public void SetIntGenotype(int[] doubleData) {
this.SetIntPhenotype(doubleData);
if (doubleData != null) {
@ -240,6 +250,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[]) {
int[] bs = (int[]) obj;
@ -257,6 +268,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GAIndividual coding int: (";
@ -299,6 +311,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBGenotype() {
return this.m_Genotype;
}
@ -307,6 +320,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBGenotype(BitSet binaryData) {
this.m_Genotype = binaryData;
}
@ -316,12 +330,14 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* of the last significat bit.
* @return The length of the genotype.
*/
@Override
public int getGenotypeLength() {
int overallLength = 0;
for (int i = 0; i < this.m_CodingLenghts.length; i++) overallLength += this.m_CodingLenghts[i];
return overallLength;
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
int overallLength = 0;
for (int i = 0; i < this.m_CodingLenghts.length; i++) overallLength += this.m_CodingLenghts[i];
@ -333,6 +349,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method performs a simple one point mutation in the genotype
*/
@Override
public void defaultMutate() {
int overallLength = 0;
for (int i = 0; i < this.m_CodingLenghts.length; i++) overallLength += this.m_CodingLenghts[i];
@ -383,6 +400,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GA individual";
}

View File

@ -47,6 +47,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GAPIndividualProgramData(this);
}
@ -55,6 +56,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GAPIndividualProgramData) {
GAPIndividualProgramData indy = (GAPIndividualProgramData)individual;
@ -69,11 +71,13 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method will allow a default initialisation of the individual
* @param opt The optimization problem that is to be solved.
*/
@Override
public void init(InterfaceOptimizationProblem opt) {
((AbstractEAIndividual)this.m_Numbers).init(opt);
((AbstractEAIndividual)this.m_Program).init(opt);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
((AbstractEAIndividual)this.m_Numbers).defaultInit(prob);
((AbstractEAIndividual)this.m_Program).defaultInit(prob);
@ -84,6 +88,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof Object[]) {
if (((Object[])obj)[0] instanceof double[]) {
@ -102,11 +107,13 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method will mutate the individual randomly
*/
@Override
public void mutate() {
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_Numbers).mutate();
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_Program).mutate();
}
@Override
public void defaultMutate() {
((AbstractEAIndividual)this.m_Numbers).defaultMutate();
((AbstractEAIndividual)this.m_Program).defaultMutate();
@ -117,6 +124,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* @param partners The possible partners
* @return offsprings
*/
@Override
public AbstractEAIndividual[] mateWith(Population partners) {
AbstractEAIndividual[] result;
if (RNG.flipCoin(this.m_CrossoverProbability)) {
@ -156,6 +164,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "This is a hybrid Individual:\n";
result += "The Numbers Part:\n"+((AbstractEAIndividual)this.m_Numbers).getStringRepresentation();
@ -169,6 +178,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setDoubleDataLength (int length) {
this.m_Numbers.setDoubleDataLength(length);
}
@ -176,6 +186,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Numbers.size();
}
@ -185,6 +196,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* for dimension d.
* @param range The new range for the double data.
*/
@Override
public void SetDoubleRange(double[][] range) {
this.m_Numbers.SetDoubleRange(range);
}
@ -192,6 +204,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public double[][] getDoubleRange() {
return this.m_Numbers.getDoubleRange();
}
@ -199,6 +212,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to read the double data
* @return BitSet representing the double data.
*/
@Override
public double[] getDoubleData() {
return this.m_Numbers.getDoubleData();
}
@ -207,6 +221,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* an update from the genotype
* @return double[] representing the double data.
*/
@Override
public double[] getDoubleDataWithoutUpdate() {
return this.m_Numbers.getDoubleDataWithoutUpdate();
}
@ -215,6 +230,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* SetDoubleDataLamarckian().
* @param doubleData The new double data.
*/
@Override
public void SetDoublePhenotype(double[] doubleData) {
this.m_Numbers.SetDoublePhenotype(doubleData);
}
@ -223,6 +239,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* memetic algorithms.
* @param doubleData The new double data.
*/
@Override
public void SetDoubleGenotype(double[] doubleData) {
this.m_Numbers.SetDoubleGenotype(doubleData);
}
@ -233,6 +250,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setProgramDataLength (int length) {
this.m_Program.setProgramDataLength(length);
}
@ -240,6 +258,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to read the program stored as Koza style node tree
* @return AbstractGPNode representing the binary data.
*/
@Override
public InterfaceProgram[] getProgramData() {
return this.m_Program.getProgramData();
}
@ -248,6 +267,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* an update from the genotype
* @return InterfaceProgram[] representing the Program.
*/
@Override
public InterfaceProgram[] getProgramDataWithoutUpdate() {
return this.m_Program.getProgramDataWithoutUpdate();
}
@ -255,6 +275,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to set the program.
* @param program The new program.
*/
@Override
public void SetProgramPhenotype(InterfaceProgram[] program) {
this.m_Program.SetProgramPhenotype(program);
}
@ -262,6 +283,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to set the program.
* @param program The new program.
*/
@Override
public void SetProgramGenotype(InterfaceProgram[] program) {
this.m_Program.SetProgramGenotype(program);
}
@ -269,6 +291,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to set the function area
* @param area The area contains functions and terminals
*/
@Override
public void SetFunctionArea(Object[] area) {
this.m_Program.SetFunctionArea(area);
}
@ -276,6 +299,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
/** This method allows you to set the function area
* @return The function area
*/
@Override
public Object[] getFunctionArea() {
return this.m_Program.getFunctionArea();
}
@ -287,6 +311,7 @@ public class GAPIndividualProgramData extends AbstractEAIndividual implements In
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GAP individual";
}

View File

@ -108,6 +108,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GEIndividualProgramData(this);
}
@ -116,6 +117,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GEIndividualProgramData) {
GEIndividualProgramData indy = (GEIndividualProgramData) individual;
@ -302,6 +304,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setProgramDataLength (int length) {
GPArea[] oldArea = this.m_Area;
Object[][] oldRulz = this.m_Rules;
@ -417,6 +420,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to read the program stored as Koza style node tree
* @return GPNode representing the binary data.
*/
@Override
public InterfaceProgram[] getProgramData() {
// if (true) {
// String test ="GE decoding:\n";
@ -453,6 +457,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* an update from the genotype
* @return InterfaceProgram[] representing the Program.
*/
@Override
public InterfaceProgram[] getProgramDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -460,6 +465,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program phenotype.
* @param program The new program.
*/
@Override
public void SetProgramPhenotype(InterfaceProgram[] program) {
if (program instanceof AbstractGPNode[]) {
this.m_Phenotype = new AbstractGPNode[program.length];
@ -473,6 +479,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* Warning - this is not implemented, it only sets the phenotype using SetProgramData.
* @param program The new program.
*/
@Override
public void SetProgramGenotype(InterfaceProgram[] program) {
this.SetProgramPhenotype(program);
if (program instanceof AbstractGPNode[]) System.err.println("Warning setProgram() for GEIndividualProgramData not implemented!");
@ -481,6 +488,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the function area
* @param area The area contains functions and terminals
*/
@Override
public void SetFunctionArea(Object[] area) {
if (area instanceof GPArea[]) {
this.m_Area = new GPArea[area.length];
@ -494,6 +502,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the function area
* @return The function area
*/
@Override
public Object[] getFunctionArea() {
return this.m_Area;
}
@ -506,6 +515,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof InterfaceProgram) {
this.SetProgramGenotype((InterfaceProgram[])obj);
@ -521,6 +531,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GEIndividual coding program:\n";
@ -544,6 +555,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to read the binary data
* @return BitSet representing the binary data.
*/
@Override
public BitSet getBGenotype() {
return this.m_Genotype;
}
@ -552,6 +564,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* memetic algorithms.
* @param binaryData The new binary data.
*/
@Override
public void SetBGenotype(BitSet binaryData) {
this.m_Genotype = binaryData;
}
@ -561,10 +574,12 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* of the last significat bit.
* @return The length of the genotype.
*/
@Override
public int getGenotypeLength() {
return this.m_GenotypeLengthPerProgram*this.m_Area.length;
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
for (int i = 0; i < this.m_GenotypeLengthPerProgram*this.m_Area.length; i++) {
if (RNG.flipCoin(0.5)) this.m_Genotype.set(i);
@ -574,6 +589,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
/** This method performs a simple one point mutation in the genotype
*/
@Override
public void defaultMutate() {
int mutationIndex = RNG.randomInt(0, this.m_GenotypeLengthPerProgram*this.m_Area.length);
//if (mutationIndex > 28) System.out.println("Mutate: " + this.getSolutionRepresentationFor());
@ -589,6 +605,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GE individual";
}

View File

@ -71,6 +71,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GIIndividualIntegerData(this);
}
@ -80,6 +81,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GIIndividualIntegerData) {
GIIndividualIntegerData indy = (GIIndividualIntegerData) individual;
@ -102,6 +104,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setIntegerDataLength (int length) {
int[] newDesPa = new int[length];
int[][] newRange = new int[length][2];
@ -126,6 +129,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method returns the length of the double data set
* @return The number of bits stored
*/
@Override
public int size() {
return this.m_Range.length;
}
@ -135,6 +139,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* ranges.
* @param range The new range for the double data.
*/
@Override
public void SetIntRange(int[][] range) {
if (range.length != this.m_Range.length) {
this.setIntegerDataLength(range.length);
@ -148,6 +153,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will return the range for all double attributes.
* @return The range array.
*/
@Override
public int[][] getIntRange() {
return this.m_Range;
}
@ -155,6 +161,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to read the double data
* @return BitSet representing the double data.
*/
@Override
public int[] getIntegerData() {
this.m_Phenotype = new int[this.m_Range.length];
for (int i = 0; i < this.m_Phenotype.length; i++) {
@ -167,6 +174,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* an update from the genotype
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -174,6 +182,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method allows you to set the double data.
* @param doubleData The new double data.
*/
@Override
public void SetIntPhenotype(int[] doubleData) {
this.m_Phenotype = doubleData;
}
@ -182,6 +191,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* memetic algorithms.
* @param doubleData The new double data.
*/
@Override
public void SetIntGenotype(int[] doubleData) {
this.SetIntPhenotype(doubleData);
this.m_Genotype = new int[this.m_Range.length];
@ -198,6 +208,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[]) {
int[] bs = (int[]) obj;
@ -215,6 +226,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GIIndividual coding int: (";
@ -244,6 +256,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
/** This method will allow the user to read the GI genotype
* @return BitSet
*/
@Override
public int[] getIGenotype() {
return this.m_Genotype;
}
@ -254,6 +267,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* this method.
* @param b The new genotype of the Individual
*/
@Override
public void SetIGenotype(int[] b) {
this.m_Genotype = b;
}
@ -263,17 +277,20 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* of the last significat bit.
* @return The length of the genotype.
*/
@Override
public int getGenotypeLength() {
return this.m_Genotype.length;
}
/** This method performs a simple one point mutation in the genotype
*/
@Override
public void defaultMutate() {
int mutationIndex = RNG.randomInt(0, this.m_Genotype.length-1);
this.m_Genotype[mutationIndex] = RNG.randomInt(this.m_Range[mutationIndex][0], this.m_Range[mutationIndex][1]);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
int[][] range = m_Range;
if ((prob != null) && (prob instanceof InterfaceHasInitRange) && (((InterfaceHasInitRange)prob).getInitRange()!=null)) {
@ -304,6 +321,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GI individual";
}

View File

@ -45,6 +45,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GIOBGAIndividualIntegerPermutationData(this);
}
@ -53,6 +54,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GIOBGAIndividualIntegerPermutationData) {
GIOBGAIndividualIntegerPermutationData indy = (GIOBGAIndividualIntegerPermutationData)individual;
@ -67,11 +69,13 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method will allow a default initialisation of the individual
* @param opt The optimization problem that is to be solved.
*/
@Override
public void init(InterfaceOptimizationProblem opt) {
((AbstractEAIndividual)this.m_Integer).init(opt);
((AbstractEAIndividual)this.m_Permutation).init(opt);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
((AbstractEAIndividual)this.m_Integer).defaultInit(prob);
((AbstractEAIndividual)this.m_Permutation).defaultInit(prob);
@ -82,6 +86,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof Object[]) {
if (((Object[])obj)[0] instanceof double[]) {
@ -100,11 +105,13 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method will mutate the individual randomly
*/
@Override
public void mutate() {
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_Integer).mutate();
if (RNG.flipCoin(this.m_MutationProbability))((AbstractEAIndividual)this.m_Permutation).mutate();
}
@Override
public void defaultMutate() {
((AbstractEAIndividual)this.m_Integer).defaultMutate();
((AbstractEAIndividual)this.m_Permutation).defaultMutate();
@ -115,6 +122,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* @param partners The possible partners
* @return offsprings
*/
@Override
public AbstractEAIndividual[] mateWith(Population partners) {
AbstractEAIndividual[] result;
if (RNG.flipCoin(this.m_CrossoverProbability)) {
@ -169,6 +177,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "This is a hybrid Individual:\n";
result += "The Integer Part:\n"+((AbstractEAIndividual)this.m_Integer).getStringRepresentation();
@ -182,6 +191,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to request a certain amount of int data
* @param length The lenght of the int[] that is to be optimized
*/
@Override
public void setIntegerDataLength (int length) {
this.m_Integer.setIntegerDataLength(length);
}
@ -189,6 +199,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method returns the length of the int data set
* @return The number of integers stored
*/
@Override
public int size() {
return this.m_Integer.size();
}
@ -198,6 +209,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* for dimension d.
* @param range The new range for the int data.
*/
@Override
public void SetIntRange(int[][] range) {
this.m_Integer.SetIntRange(range);
}
@ -205,6 +217,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method will return the range for all int attributes.
* @return The range array.
*/
@Override
public int[][] getIntRange() {
return this.m_Integer.getIntRange();
}
@ -212,6 +225,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to read the int data
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerData() {
return this.m_Integer.getIntegerData();
}
@ -220,6 +234,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* an update from the genotype
* @return int[] representing the int data.
*/
@Override
public int[] getIntegerDataWithoutUpdate() {
return this.m_Integer.getIntegerDataWithoutUpdate();
}
@ -227,6 +242,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to set the int data.
* @param intData The new int data.
*/
@Override
public void SetIntPhenotype(int[] intData) {
this.m_Integer.SetIntPhenotype(intData);
}
@ -235,6 +251,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* memetic algorithms.
* @param intData The new int data.
*/
@Override
public void SetIntGenotype(int[] intData) {
this.m_Integer.SetIntGenotype(intData);
}
@ -245,6 +262,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** setLength sets the length of the permutation.
* @param length int new length
*/
@Override
public void setPermutationDataLength(int[] length) {
this.m_Permutation.setPermutationDataLength(length);
this.m_Integer.setIntegerDataLength(length.length);
@ -253,6 +271,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** size returns the size of the permutation.
* @return int
*/
@Override
public int[] sizePermutation() {
return this.m_Permutation.sizePermutation();
}
@ -260,6 +279,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to read the permutation data
* @return int[] represent the permutation.
*/
@Override
public int[][] getPermutationData() {
return this.m_Permutation.getPermutationData();
}
@ -268,6 +288,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* an update from the genotype
* @return int[] representing the permutation.
*/
@Override
public int[][] getPermutationDataWithoutUpdate() {
return this.m_Permutation.getPermutationDataWithoutUpdate();
}
@ -275,6 +296,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
/** This method allows you to set the permutation.
* @param perm The new permutation data.
*/
@Override
public void SetPermutationPhenotype(int[][] perm) {
this.SetPermutationPhenotype(perm);
}
@ -283,10 +305,12 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* memetic algorithms.
* @param perm The new permutation data.
*/
@Override
public void SetPermutationGenotype(int[][] perm) {
this.SetPermutationGenotype(perm);
}
@Override
public void setFirstindex(int[] firstindex) {
this.m_Permutation.setFirstindex(firstindex);
}
@ -298,6 +322,7 @@ public class GIOBGAIndividualIntegerPermutationData extends AbstractEAIndividual
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GA/ES individual";
}

View File

@ -78,6 +78,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
cloneAEAObjects((AbstractEAIndividual) individual);
}
@Override
public Object clone() {
return (Object) new GPIndividualProgramData(this);
}
@ -86,6 +87,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof GPIndividualProgramData) {
GPIndividualProgramData indy = (GPIndividualProgramData) individual;
@ -112,6 +114,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to request a certain amount of double data
* @param length The lenght of the double[] that is to be optimized
*/
@Override
public void setProgramDataLength (int length) {
GPArea[] oldArea = this.m_Area;
AbstractGPNode[] oldProg = this.m_Genotype;
@ -130,6 +133,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to read the program stored as Koza style node tree
* @return AbstractGPNode representing the binary data.
*/
@Override
public InterfaceProgram[] getProgramData() {
this.m_Phenotype = new AbstractGPNode[this.m_Genotype.length];
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -151,6 +155,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* an update from the genotype
* @return InterfaceProgram[] representing the Program.
*/
@Override
public InterfaceProgram[] getProgramDataWithoutUpdate() {
if (this.m_Phenotype==null) return getProgramData();
else return this.m_Phenotype;
@ -159,6 +164,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program phenotype.
* @param program The new program.
*/
@Override
public void SetProgramPhenotype(InterfaceProgram[] program) {
if (program instanceof AbstractGPNode[]) {
this.m_Phenotype = new AbstractGPNode[program.length];
@ -170,6 +176,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the program genotype.
* @param program The new program.
*/
@Override
public void SetProgramGenotype(InterfaceProgram[] program) {
this.SetProgramPhenotype(program);
if (program instanceof AbstractGPNode[]) {
@ -182,6 +189,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the function area
* @param area The area contains functions and terminals
*/
@Override
public void SetFunctionArea(Object[] area) {
if (area instanceof GPArea[]) {
this.m_Area = (GPArea[]) area;
@ -191,6 +199,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method allows you to set the function area
* @return The function area
*/
@Override
public Object[] getFunctionArea() {
return this.m_Area;
}
@ -203,6 +212,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof InterfaceProgram[]) {
this.SetProgramGenotype((InterfaceProgram[])obj);
@ -218,6 +228,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "GPIndividual coding program: (";
@ -240,6 +251,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method will allow the user to read the program genotype
* @return AbstractGPNode
*/
@Override
public AbstractGPNode[] getPGenotype() {
return this.m_Genotype;
}
@ -247,6 +259,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/** This method will allow the user to set the current program 'genotype'.
* @param b The new programgenotype of the Individual
*/
@Override
public void SetPGenotype(AbstractGPNode[] b) {
this.m_Genotype = b;
this.m_Phenotype=null;
@ -256,6 +269,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* @param b The new program genotype of the Individual
* @param i The index where to insert the new program
*/
@Override
public void SetPGenotype(AbstractGPNode b, int i) {
this.m_Genotype[i] = b;
m_Genotype[i].updateDepth(0);
@ -266,6 +280,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
/**
* This method performs a simple one element mutation on the program
*/
@Override
public void defaultMutate() {
for (int i = 0; i < this.m_Genotype.length; i++) {
AbstractGPNode nodeToMutate = this.m_Genotype[i].getRandomNode();
@ -291,6 +306,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
m_Phenotype=null; // reset pheno
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob) {
m_Phenotype=null; // reset pheno
for (int i = 0; i < this.m_Area.length; i++) {
@ -315,6 +331,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "GP individual";
}
@ -377,6 +394,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
public void setMaxAllowedDepth(int b) {
this.m_maxAllowedDepth = b;
}
@Override
public int getMaxAllowedDepth() {
return this.m_maxAllowedDepth;
}

View File

@ -29,6 +29,7 @@ public class IndividualDistanceComparator implements Comparator<Object>, Seriali
closerMeansLess = closerIsLess;
}
@Override
public int compare(Object o1, Object o2) {
double d1 = distMetric.distance((AbstractEAIndividual)o1, refIndy);
double d2 = distMetric.distance((AbstractEAIndividual)o2, refIndy);

View File

@ -68,6 +68,7 @@ public class IndividualWeightedFitnessComparator implements Comparator<Object>,
* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
@Override
public int compare(Object o1, Object o2) {
double[] f1 = ((AbstractEAIndividual) o1).getFitness();
double[] f2 = ((AbstractEAIndividual) o2).getFitness();

View File

@ -69,6 +69,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* @param individual The individual to compare to.
* @return boolean if equal true else false.
*/
@Override
public boolean equalGenotypes(AbstractEAIndividual individual) {
if (individual instanceof OBGAIndividualPermutationData) {
OBGAIndividualPermutationData indy = (OBGAIndividualPermutationData) individual;
@ -96,6 +97,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* @param obj The initial value for the phenotype
* @param opt The optimization problem that is to be solved.
*/
@Override
public void initByValue(Object obj, InterfaceOptimizationProblem opt) {
if (obj instanceof int[]) {
this.SetPermutationGenotype((int[][]) obj);
@ -112,6 +114,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* double[] is used instead of a single double.
* @return The complete fitness array
*/
@Override
public double[] getFitness() {
return this.m_Fitness;
}
@ -120,6 +123,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* noteably the Genotype.
* @return A descriptive string
*/
@Override
public String getStringRepresentation() {
String result = "";
result += "OBGAIndividual: (";
@ -144,6 +148,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
}
@Override
public Object clone() {
return new OBGAIndividualPermutationData(this);
}
@ -152,14 +157,17 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* InterfaceOBGAIndividual methods
*/
@Override
public int[][] getOBGenotype() {
return this.m_Genotype;
}
@Override
public void SetOBGenotype(int[][] g) {
this.m_Genotype = g;
}
@Override
public void defaultMutate(){
int[][] permmatrix = this.getPermutationData();
for (int i = 0; i < permmatrix.length; i++) {
@ -174,6 +182,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
this.SetPermutationGenotype(permmatrix);
}
@Override
public void defaultInit(InterfaceOptimizationProblem prob){
//System.out.println("Default Init!");
int[][] perm = new int[this.m_Genotype.length][];
@ -200,6 +209,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
*/
@Override
public void setPermutationDataLength(int[] length){
this.m_Genotype = new int[length.length][];
for (int i = 0; i < length.length; i++) {
@ -208,6 +218,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
}
@Override
public int[] sizePermutation() {
int[] res = new int[m_Genotype.length];
for (int i = 0; i <m_Genotype.length; i++) {
@ -216,10 +227,12 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
return res;
}
@Override
public void SetPermutationPhenotype(int[][] perm){
this.m_Phenotype = perm;
}
@Override
public void SetPermutationGenotype(int[][] perm){
this.SetPermutationPhenotype(perm);
this.m_Genotype = new int[perm.length][];
@ -230,6 +243,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
}
@Override
public int[][] getPermutationData() {
this.m_Phenotype = new int[this.m_Genotype.length][];
for (int i = 0; i < this.m_Genotype.length; i++) {
@ -243,6 +257,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* an update from the genotype
* @return int[] representing the permutation.
*/
@Override
public int[][] getPermutationDataWithoutUpdate() {
return this.m_Phenotype;
}
@ -250,6 +265,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
public int[] getFirstindex() {
return firstindex;
}
@Override
public void setFirstindex(int[] firstindex) {
this.firstindex = firstindex;
}
@ -258,6 +274,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
* name to the current object.
* @return The name.
*/
@Override
public String getName() {
return "OBGA individual";
}

View File

@ -27,6 +27,7 @@ public class GAGrayCodingDouble implements InterfaceGADoubleCoding, java.io.Seri
* @param correction Enable automatic correction is enabled.
* @return The float value.
*/
@Override
public double decodeValue(BitSet refBitSet, double[] range, int[] locus, boolean correction) {
BitSet tmpBitSet;
int[] tmpLocus;
@ -54,6 +55,7 @@ public class GAGrayCodingDouble implements InterfaceGADoubleCoding, java.io.Seri
* @param refBitSet The BitSet where the questioned value is stored.
* @param locus The position and length on the BitSet that is to be coded.
*/
@Override
public void codeValue(double value, double[] range, BitSet refBitSet, int[] locus) {
BitSet tmpBitSet;
int[] tmpLocus;

View File

@ -22,6 +22,7 @@ public class GAGrayCodingInteger implements InterfaceGAIntegerCoding,java.io.Ser
* @param correction Enable automatic correction is enabled.
* @return The int value.
*/
@Override
public int decodeValue(BitSet refBitSet, int[] range, int[] locus, boolean correction) {
BitSet tmpBitSet;
int[] tmpLocus;
@ -54,6 +55,7 @@ public class GAGrayCodingInteger implements InterfaceGAIntegerCoding,java.io.Ser
* @param refBitSet The BitSet where the questioned value is stored.
* @param locus The position and length on the BitSet that is to be coded.
*/
@Override
public void codeValue(int value, int[] range, BitSet refBitSet, int[] locus) {
BitSet tmpBitSet;
int[] tmpLocus;
@ -81,6 +83,7 @@ public class GAGrayCodingInteger implements InterfaceGAIntegerCoding,java.io.Ser
/** This method will calculate how many bits are to be used to code a given value
* @param range The range for the value.
*/
@Override
public int calculateNecessaryBits(int[] range) {
return this.m_HelpingHand.calculateNecessaryBits(range);
}

View File

@ -71,6 +71,7 @@ public class GAStandardCodingDouble implements InterfaceGADoubleCoding, java.io.
* @param correction Enable automatic correction is enabled.
* @return The decoded value.
*/
@Override
public double decodeValue(BitSet refBitSet, double[] range, int[] locus, boolean correction) {
long val = (refBitSet.get(locus[0]) ? 1 : 0);
int m_length = locus[1];
@ -96,6 +97,7 @@ public class GAStandardCodingDouble implements InterfaceGADoubleCoding, java.io.
* @param refBitSet The BitSet where the questioned value is stored.
* @param locus The position and length on the BitSet that is to be coded.
*/
@Override
public void codeValue(double value, double[] range, BitSet refBitSet, int[] locus) {
double u_max, u_min, m_max, m_min;
int m_start, m_length, counter = 0;

View File

@ -24,6 +24,7 @@ public class GAStandardCodingInteger implements InterfaceGAIntegerCoding, java.i
* @param correction Enable automatic correction is enabled.
* @return The int value.
*/
@Override
public int decodeValue(BitSet refBitSet, int[] range, int[] locus, boolean correction) {
int u_max, u_min, m_max, m_min;
int m_start, m_length, counter = 0;
@ -76,6 +77,7 @@ public class GAStandardCodingInteger implements InterfaceGAIntegerCoding, java.i
* @param refBitSet The BitSet where the questioned value is stored.
* @param locus The position and length on the BitSet that is to be coded.
*/
@Override
public void codeValue(int value, int[] range, BitSet refBitSet, int[] locus) {
int u_max, u_min, m_max, m_min;
int m_start, m_length, counter = 0;
@ -123,6 +125,7 @@ public class GAStandardCodingInteger implements InterfaceGAIntegerCoding, java.i
/** This method will calculate how many bits are to be used to code a given value
* @param range The range for the value.
*/
@Override
public int calculateNecessaryBits(int[] range) {
int result = 0;
double maxStore = 1. + range[1] -range[0];

View File

@ -31,6 +31,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public abstract Object clone();
/** This method will be used to identify the node in the GPAreaEditor
@ -41,6 +42,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
/** This method will evaluate a given node
* @param environment
*/
@Override
public abstract Object evaluate(InterfaceProgramProblem environment);
/** This method will return the current arity
@ -51,6 +53,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
/** This method returns a string representation
* @return string
*/
@Override
public String getStringRepresentation() {
StringBuffer sb = new StringBuffer();
AbstractGPNode.appendStringRepresentation(this, sb);
@ -541,6 +544,7 @@ public abstract class AbstractGPNode implements InterfaceProgram, java.io.Serial
* @param obj The other subtree.
* @return boolean if equal true else false.
*/
@Override
public boolean equals(Object obj) {
if (obj.getClass().equals(this.getClass())) {
AbstractGPNode node = (AbstractGPNode)obj;

View File

@ -37,6 +37,7 @@ public class GPArea implements java.io.Serializable {
this.m_CompleteList = (ArrayList<AbstractGPNode>)g.m_CompleteList.clone();
}
@Override
public Object clone() {
return new GPArea(this);
}

View File

@ -18,6 +18,7 @@ public class GPNodeAbs extends AbstractGPNode implements java.io.Serializable {
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Abs";
}
@ -25,6 +26,7 @@ public class GPNodeAbs extends AbstractGPNode implements java.io.Serializable {
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeAbs(this);
}
@ -32,6 +34,7 @@ public class GPNodeAbs extends AbstractGPNode implements java.io.Serializable {
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 1;
}
@ -39,6 +42,7 @@ public class GPNodeAbs extends AbstractGPNode implements java.io.Serializable {
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object tmpObj;
double result = 0;

View File

@ -24,6 +24,7 @@ public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Add";
}
@ -31,6 +32,7 @@ public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeAdd(this);
}
@ -38,6 +40,7 @@ public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 2;
}
@ -45,6 +48,7 @@ public class GPNodeAdd extends AbstractGPNode implements java.io.Serializable {
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object tmpObj;
double result = 0;

View File

@ -30,6 +30,7 @@ public class GPNodeConst extends AbstractGPNode implements java.io.Serializable
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return ""+value;
}
@ -37,6 +38,7 @@ public class GPNodeConst extends AbstractGPNode implements java.io.Serializable
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 0;
}
@ -44,6 +46,7 @@ public class GPNodeConst extends AbstractGPNode implements java.io.Serializable
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
return new Double(value);
}

View File

@ -20,6 +20,7 @@ public class GPNodeCos extends AbstractGPNode implements java.io.Serializable {
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Cos";
}
@ -27,6 +28,7 @@ public class GPNodeCos extends AbstractGPNode implements java.io.Serializable {
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeCos(this);
}
@ -34,6 +36,7 @@ public class GPNodeCos extends AbstractGPNode implements java.io.Serializable {
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 1;
}
@ -41,6 +44,7 @@ public class GPNodeCos extends AbstractGPNode implements java.io.Serializable {
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object tmpObj;
double result = 1;

View File

@ -28,6 +28,7 @@ public class GPNodeDiv extends AbstractGPNode implements java.io.Serializable {
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Div";
}
@ -35,6 +36,7 @@ public class GPNodeDiv extends AbstractGPNode implements java.io.Serializable {
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeDiv(this);
}
@ -42,6 +44,7 @@ public class GPNodeDiv extends AbstractGPNode implements java.io.Serializable {
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 2;
}
@ -49,6 +52,7 @@ public class GPNodeDiv extends AbstractGPNode implements java.io.Serializable {
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object tmpObj;
double result = 1;

View File

@ -20,6 +20,7 @@ public class GPNodeExp extends AbstractGPNode implements java.io.Serializable {
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Exp";
}
@ -27,6 +28,7 @@ public class GPNodeExp extends AbstractGPNode implements java.io.Serializable {
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeExp(this);
}
@ -34,6 +36,7 @@ public class GPNodeExp extends AbstractGPNode implements java.io.Serializable {
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 1;
}
@ -41,6 +44,7 @@ public class GPNodeExp extends AbstractGPNode implements java.io.Serializable {
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object tmpObj;
double result = 1;

View File

@ -21,6 +21,7 @@ public class GPNodeFlowExec2 extends AbstractGPNode implements java.io.Serializa
/** This method will be used to identify the node in the GPAreaEditor
* @return The name.
*/
@Override
public String getName() {
return "Exec2";
}
@ -28,6 +29,7 @@ public class GPNodeFlowExec2 extends AbstractGPNode implements java.io.Serializa
/** This method allows you to clone the Nodes
* @return the clone
*/
@Override
public Object clone() {
return (Object) new GPNodeFlowExec2(this);
}
@ -35,6 +37,7 @@ public class GPNodeFlowExec2 extends AbstractGPNode implements java.io.Serializa
/** This method will return the current arity
* @return Arity.
*/
@Override
public int getArity() {
return 2;
}
@ -42,6 +45,7 @@ public class GPNodeFlowExec2 extends AbstractGPNode implements java.io.Serializa
/** This method will evaluate a given node
* @param environment
*/
@Override
public Object evaluate(InterfaceProgramProblem environment) {
Object[] result = new Object[this.m_Nodes.length];

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