Cleanup of unused code. Removed further traces of TRACE.

This commit is contained in:
Fabian Becker 2014-07-22 14:38:41 +02:00
parent 5c77484a11
commit 827b107d44
5 changed files with 8 additions and 85 deletions

View File

@ -63,7 +63,7 @@ public class Main extends JFrame implements OptimizationStateListener {
// if not null, the module is loaded automatically and no other can be selected
private String useDefaultModule = null; //"Genetic_Optimization";
private boolean localMode = false;
// measuring optimization runtime
private long startTime = 0;
@ -471,8 +471,8 @@ public class Main extends JFrame implements OptimizationStateListener {
}
});
LOGGER.log(Level.INFO, "Working directory is: {0}", System.getProperty("user.dir"));
LOGGER.log(Level.INFO, "Class path is: {0}", System.getProperty("java.class.path", "."));
LOGGER.log(Level.FINE, "Working directory is: {0}", System.getProperty("user.dir"));
LOGGER.log(Level.FINE, "Class path is: {0}", System.getProperty("java.class.path", "."));
if (!(configurationPane.isVisible())) {
configurationPane.setVisible(true);
@ -529,7 +529,7 @@ public class Main extends JFrame implements OptimizationStateListener {
public static void main(String[] args) {
// Properties for Mac OS X support.
if ((System.getProperty("mrj.version") != null)
|| (System.getProperty("os.name").toLowerCase().indexOf("mac") != -1)) {
|| (System.getProperty("os.name").toLowerCase().contains("mac"))) {
/*
* Note: the xDock name property must be set before parsing
* command-line arguments! See above!
@ -545,13 +545,7 @@ public class Main extends JFrame implements OptimizationStateListener {
System.setProperty("com.apple.mrj.application.live-resize", "true");
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (InstantiationException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (IllegalAccessException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (UnsupportedLookAndFeelException e) {
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
} else {
@ -689,7 +683,7 @@ public class Main extends JFrame implements OptimizationStateListener {
};
actQuit = new ExtAction("&Quit", "Quit EvA2 workbench",
KeyStroke.getKeyStroke(KeyEvent.VK_Q, Event.CTRL_MASK)) {
KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_MASK)) {
@Override
public void actionPerformed(final ActionEvent event) {
@ -698,7 +692,7 @@ public class Main extends JFrame implements OptimizationStateListener {
};
actPreferences = new ExtAction("&Preferences", "Show preferences dialog",
KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.CTRL_MASK)) {
KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK)) {
@Override
public void actionPerformed(final ActionEvent event) {
@ -740,16 +734,6 @@ public class Main extends JFrame implements OptimizationStateListener {
private void buildMenu() {
JMenuBar menuBar = new JMenuBar();
setJMenuBar(menuBar);
JExtMenu menuModule = new JExtMenu("&Module");
//menuModule.add(actModuleLoad);
JExtMenu menuSelHosts = new JExtMenu("&Select Hosts");
//menuSelHosts.setToolTipText("Select a host for the server application");
//menuSelHosts.add(actHost);
//menuSelHosts.add(actAvailableHost);
//menuSelHosts.addSeparator();
//menuSelHosts.add(actKillHost);
//menuSelHosts.add(actKillAllHosts);
JExtMenu menuHelp = new JExtMenu("&Help");
menuHelp.add(actHelp);
@ -762,10 +746,6 @@ public class Main extends JFrame implements OptimizationStateListener {
//menuOptions.add(menuSelHosts);
menuOptions.addSeparator();
menuOptions.add(actQuit);
// this is accessible if no default module is given
//if (showLoadModules) {
// menuBar.add(menuModule);
//}
menuBar.add(menuOptions);
menuBar.add(((JExtDesktopPane) desktopPane).getWindowMenu());
@ -830,7 +810,6 @@ public class Main extends JFrame implements OptimizationStateListener {
return;
}
} else {
newModuleAdapter.setConnection(!localMode);
newModuleAdapter.addOptimizationStateListener(this);
try {
if (withGUI) {

View File

@ -18,8 +18,6 @@ abstract public class AbstractModuleAdapter implements ModuleAdapter, Serializab
protected int instanceNumber;
protected String adapterName;
protected InterfaceProcessor processor;
protected String hostName = "not defined";
protected boolean hasConnection = true;
protected ModuleAdapter remoteModuleAdapter = null;
private List<OptimizationStateListener> optimizationStateListeners;
@ -47,14 +45,6 @@ abstract public class AbstractModuleAdapter implements ModuleAdapter, Serializab
processor.startOptimization();
}
/**
* Restart optimization on processor.
*/
@Override
public void restartOptimization() {
processor.restartOptimization();
}
/**
* Stop optimization on processor.
*/
@ -104,11 +94,7 @@ abstract public class AbstractModuleAdapter implements ModuleAdapter, Serializab
}
public boolean isOptRunning() {
if ((processor != null) && (processor instanceof Processor)) {
return ((Processor) processor).isOptimizationRunning();
} else {
return false;
}
return (processor != null) && (processor instanceof Processor) && ((Processor) processor).isOptimizationRunning();
}
/**
@ -118,25 +104,6 @@ abstract public class AbstractModuleAdapter implements ModuleAdapter, Serializab
public void addOptimizationStateListener(OptimizationStateListener remoteListener) {
optimizationStateListeners.add(remoteListener);
}
/**
*
*/
@Override
public void setConnection(boolean flag) {
hasConnection = flag;
}
/**
* Returns whether the module has a connection.
*
* @return true if the adapter has a connection.
*/
@Override
public boolean hasConnection() {
return hasConnection;
}
/**
*
*/

View File

@ -30,8 +30,6 @@ public interface ModuleAdapter extends OptimizationStateListener {
*/
OptimizationJob scheduleJob();
void restartOptimization();
void stopOptimization();
/**
@ -49,8 +47,4 @@ public interface ModuleAdapter extends OptimizationStateListener {
boolean startPostProcessing();
void addOptimizationStateListener(OptimizationStateListener x);
void setConnection(boolean flag);
boolean hasConnection();
}

View File

@ -57,9 +57,6 @@ public abstract class AbstractSynchronousOptimizationProblem extends
@Override
protected void changeProblemAt(double problemTime) {
incProblemTime(shiftPerChange);
if (TRACE) {
System.out.println("problem shiftet at " + problemTime + " per " + shiftPerChange);
}
evalsSinceChange = 0.;
}
@ -79,9 +76,6 @@ public abstract class AbstractSynchronousOptimizationProblem extends
*/
protected void setConstantProblemEvals(double constEvals) {
constantProblemEvals = constEvals;
if (TRACE) {
System.out.println("setConstantProblemEvals: " + constEvals);
}
}
/* (non-Javadoc)

View File

@ -53,10 +53,6 @@ public class DynJumpProblem extends AbstractDynTransProblem {
protected void changeProblemAt(double problemTime) {
super.changeProblemAt(problemTime);
makeTranslation();
/* prooving results */
if (TRACE) {
writeFile();
}
++changeCounter;
}
@ -110,13 +106,6 @@ public class DynJumpProblem extends AbstractDynTransProblem {
/* Update previousMovement */
previousMovement[i] = shift[i];
}
if (TRACE) {
System.out.print("Jumped to ");
for (int i = 0; i < getProblemDimension(); i++) {
System.out.print(" " + translation[i]);
}
System.out.println();
}
}
@Override