Merging mk rev. 519 and some more bug fixing (introspection) in synch with MK branch
This commit is contained in:
		@@ -151,7 +151,7 @@ public class BeanInspector {
 | 
			
		||||
				sbuf.append(delim);
 | 
			
		||||
				if (!tight) sbuf.append(" ");
 | 
			
		||||
			}
 | 
			
		||||
			if (!tight) sbuf.setCharAt(sbuf.length()-2, ' ');
 | 
			
		||||
			if (!tight && (sbuf.charAt(sbuf.length()-2) == delim)) sbuf.setCharAt(sbuf.length()-2, ' '); // delete the delim
 | 
			
		||||
			sbuf.setCharAt(sbuf.length()-1, ']');
 | 
			
		||||
			return sbuf.toString();
 | 
			
		||||
		}
 | 
			
		||||
@@ -331,6 +331,8 @@ public class BeanInspector {
 | 
			
		||||
				return meth.invoke(obj, args);
 | 
			
		||||
			} catch(Exception e) {
 | 
			
		||||
				System.err.println("Error on calling method "+mName + " on " + obj.getClass().getName());
 | 
			
		||||
				System.err.println("Object: " + obj.toString() + ", method name: " + mName);
 | 
			
		||||
				System.err.println("Arguments were " + BeanInspector.toString(args));
 | 
			
		||||
				e.printStackTrace();
 | 
			
		||||
				return null;
 | 
			
		||||
			}
 | 
			
		||||
@@ -348,7 +350,7 @@ public class BeanInspector {
 | 
			
		||||
		if (o==null) return null;
 | 
			
		||||
		Class[] clz = new Class[o.length];
 | 
			
		||||
		for (int i=0; i<o.length; i++) {
 | 
			
		||||
			clz[i]=o.getClass();
 | 
			
		||||
			clz[i]=o[i].getClass();
 | 
			
		||||
		}
 | 
			
		||||
		return clz;
 | 
			
		||||
	}
 | 
			
		||||
@@ -388,7 +390,7 @@ public class BeanInspector {
 | 
			
		||||
					if (paramTypes!=null && (methParamTypes.length==paramTypes.length)) {
 | 
			
		||||
						boolean mismatch = false; int i=0;
 | 
			
		||||
						while ((i<methParamTypes.length) && (!mismatch)) {
 | 
			
		||||
							if (!methParamTypes[i].equals(paramTypes[i])) mismatch=true;
 | 
			
		||||
							if (!methParamTypes[i].isAssignableFrom(paramTypes[i])) mismatch=true;
 | 
			
		||||
							i++;
 | 
			
		||||
						} 
 | 
			
		||||
						if (!mismatch) return method; // parameter match, otherwise search on
 | 
			
		||||
 
 | 
			
		||||
@@ -138,7 +138,7 @@ public class ParameterControlManager implements InterfaceParameterControl, Seria
 | 
			
		||||
	public void setSingleAdapters(ParamAdaption[] singleAdapters) {
 | 
			
		||||
		this.singleAdapters = singleAdapters;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
 | 
			
		||||
	public static String globalInfo() {
 | 
			
		||||
		return "Define a list of dynamically adapted parameters.";
 | 
			
		||||
	}
 | 
			
		||||
@@ -150,6 +150,7 @@ public class ParameterControlManager implements InterfaceParameterControl, Seria
 | 
			
		||||
	/**
 | 
			
		||||
	 * Retrieve a list of objects which are properties of the given target object (retrievable by a 
 | 
			
		||||
	 * getter method) and which implement the getParamControl method.
 | 
			
		||||
	 * This can be used to avoid a GUI layer as stated in the class comment.
 | 
			
		||||
	 * 
 | 
			
		||||
	 * @param target
 | 
			
		||||
	 * @return
 | 
			
		||||
 
 | 
			
		||||
@@ -310,7 +310,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
 | 
			
		||||
		else if (terminator instanceof EvaluationTerminator)
 | 
			
		||||
			args = new Object[] {optimizer, optimizer.getPopulation(), optimizer.getPopulation().getFunctionCalls(), ((EvaluationTerminator)terminator).getFitnessCalls()};
 | 
			
		||||
//			((InterfaceParameterControl)paramCtrl).updateParameters(optimizer, optimizer.getPopulation().getFunctionCalls(), ((EvaluationTerminator)terminator).getFitnessCalls());
 | 
			
		||||
		else args = new Object[]{optimizer, optimizer.getPopulation()};
 | 
			
		||||
		else args = new Object[]{optimizer};
 | 
			
		||||
//			((InterfaceParameterControl)paramCtrl).updateParameters(optimizer);
 | 
			
		||||
    	
 | 
			
		||||
		if (args != null) { // only if iteration counting is available
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user