Merging mk rev. 519 and some more bug fixing (introspection) in synch with MK branch
This commit is contained in:
parent
6ea578615c
commit
6923956e29
@ -151,7 +151,7 @@ public class BeanInspector {
|
|||||||
sbuf.append(delim);
|
sbuf.append(delim);
|
||||||
if (!tight) sbuf.append(" ");
|
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, ']');
|
sbuf.setCharAt(sbuf.length()-1, ']');
|
||||||
return sbuf.toString();
|
return sbuf.toString();
|
||||||
}
|
}
|
||||||
@ -331,6 +331,8 @@ public class BeanInspector {
|
|||||||
return meth.invoke(obj, args);
|
return meth.invoke(obj, args);
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
System.err.println("Error on calling method "+mName + " on " + obj.getClass().getName());
|
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();
|
e.printStackTrace();
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -348,7 +350,7 @@ public class BeanInspector {
|
|||||||
if (o==null) return null;
|
if (o==null) return null;
|
||||||
Class[] clz = new Class[o.length];
|
Class[] clz = new Class[o.length];
|
||||||
for (int i=0; i<o.length; i++) {
|
for (int i=0; i<o.length; i++) {
|
||||||
clz[i]=o.getClass();
|
clz[i]=o[i].getClass();
|
||||||
}
|
}
|
||||||
return clz;
|
return clz;
|
||||||
}
|
}
|
||||||
@ -388,7 +390,7 @@ public class BeanInspector {
|
|||||||
if (paramTypes!=null && (methParamTypes.length==paramTypes.length)) {
|
if (paramTypes!=null && (methParamTypes.length==paramTypes.length)) {
|
||||||
boolean mismatch = false; int i=0;
|
boolean mismatch = false; int i=0;
|
||||||
while ((i<methParamTypes.length) && (!mismatch)) {
|
while ((i<methParamTypes.length) && (!mismatch)) {
|
||||||
if (!methParamTypes[i].equals(paramTypes[i])) mismatch=true;
|
if (!methParamTypes[i].isAssignableFrom(paramTypes[i])) mismatch=true;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
if (!mismatch) return method; // parameter match, otherwise search on
|
if (!mismatch) return method; // parameter match, otherwise search on
|
||||||
|
@ -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
|
* Retrieve a list of objects which are properties of the given target object (retrievable by a
|
||||||
* getter method) and which implement the getParamControl method.
|
* 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
|
* @param target
|
||||||
* @return
|
* @return
|
||||||
|
@ -310,7 +310,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
else if (terminator instanceof EvaluationTerminator)
|
else if (terminator instanceof EvaluationTerminator)
|
||||||
args = new Object[] {optimizer, optimizer.getPopulation(), optimizer.getPopulation().getFunctionCalls(), ((EvaluationTerminator)terminator).getFitnessCalls()};
|
args = new Object[] {optimizer, optimizer.getPopulation(), optimizer.getPopulation().getFunctionCalls(), ((EvaluationTerminator)terminator).getFitnessCalls()};
|
||||||
// ((InterfaceParameterControl)paramCtrl).updateParameters(optimizer, 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);
|
// ((InterfaceParameterControl)paramCtrl).updateParameters(optimizer);
|
||||||
|
|
||||||
if (args != null) { // only if iteration counting is available
|
if (args != null) { // only if iteration counting is available
|
||||||
|
Loading…
x
Reference in New Issue
Block a user