Minor fixes.

This commit is contained in:
Marcel Kronfeld 2010-06-01 16:03:43 +00:00
parent 89975518ef
commit d9f059fe6c
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,6 @@
package eva2; package eva2;
import java.io.File; import java.io.InputStream;
import java.util.Properties; import java.util.Properties;
import eva2.tools.BasicResourceLoader; import eva2.tools.BasicResourceLoader;
@ -100,8 +100,8 @@ public class EvAInfo {
System.err.println(ex.getMessage()); System.err.println(ex.getMessage());
System.exit(1); System.exit(1);
} }
File f=new File(EvAInfo.iconLocation); InputStream istr = BasicResourceLoader.instance().getStreamFromResourceLocation(EvAInfo.iconLocation);
if (!f.exists()) { if (istr==null) {
throw new RuntimeException(resourceNotFoundErrorMessage(EvAInfo.iconLocation) + " (EvAInfo.static)"); throw new RuntimeException(resourceNotFoundErrorMessage(EvAInfo.iconLocation) + " (EvAInfo.static)");
// System.exit(2); // dont be as harsh right here - there will be plenty of exceptions later in the bad case... // System.exit(2); // dont be as harsh right here - there will be plenty of exceptions later in the bad case...
} }

View File

@ -1676,6 +1676,10 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
if (pop.size()<2) { if (pop.size()<2) {
return new double[]{1.,1.,1.,1.}; return new double[]{1.,1.,1.,1.};
} }
if (!(pop.getEAIndividual(0) instanceof InterfaceDataTypeDouble)) {
EVAERROR.errorMsgOnce("Warning: population correlations can only be calculated for double valued data!");
return new double[]{1.,1.,1.,1.};
}
int index=0; int index=0;
double corsSum=0, minCor = 10., maxCor=-10.; double corsSum=0, minCor = 10., maxCor=-10.;
for (int i = 0; i < pop.size()-1; i++) { for (int i = 0; i < pop.size()-1; i++) {