Improve multiverse similarity logic and fix incorrect log
This commit is contained in:
+5
-2
@@ -57,7 +57,7 @@ public class SubDimCompare implements Comparable<SubDimCompare>
|
||||
}
|
||||
|
||||
/** returns a number between 0 (no equal datapoint) and 1 (totally equal) */
|
||||
public double getPercentEqual() { return (double) equalDataPoints / (double) totalDataPoints; }
|
||||
public double getPercentEqual() { return (double) this.equalDataPoints / (double) this.totalDataPoints; }
|
||||
|
||||
|
||||
@Override
|
||||
@@ -66,7 +66,7 @@ public class SubDimCompare implements Comparable<SubDimCompare>
|
||||
if (this.equalDataPoints != other.equalDataPoints)
|
||||
{
|
||||
// compare based on data points
|
||||
return Integer.compare(this.equalDataPoints, other.equalDataPoints);
|
||||
return Double.compare(this.getPercentEqual(), other.getPercentEqual());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -83,4 +83,7 @@ public class SubDimCompare implements Comparable<SubDimCompare>
|
||||
|| this.playerPosDist <= MAX_SIMILAR_PLAYER_POS_DISTANCE_IN_BLOCKS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() { return this.equalDataPoints + "/" + this.totalDataPoints + ": " + this.getPercentEqual() + " playerPos: " + this.playerPosDist; }
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -332,7 +332,7 @@ public class SubDimensionLevelMatcher implements AutoCloseable
|
||||
|
||||
|
||||
String subDimShortName = LodUtil.shortenString(testLevelFolder.getName(), 8); // variables are separated out for easier debugging
|
||||
String equalPercent = LodUtil.shortenString(subDimCompare.getPercentEqual()+"", 5);
|
||||
String equalPercent = LodUtil.shortenString(mostSimilarSubDim.getPercentEqual()+"", 5);
|
||||
LOGGER.info("Sub dimension ["+subDimShortName+"...] is current dimension probability: "+equalPercent+" ("+equalDataPoints+"/"+totalDataPointCount+")");
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
Reference in New Issue
Block a user