Added spiral generation, changed how some arrays are created

This commit is contained in:
Leonardo
2021-09-21 18:12:15 +02:00
parent 8228a3b7a6
commit 46bdf5763f
9 changed files with 169 additions and 102 deletions
@@ -229,13 +229,11 @@ public class LevelPosUtil
int compareResult = Integer.compare(
secondDetail,
firstDetail);
// System.out.println("comparing level "+ firstDetail + " " + secondDetail + " " + compareResult);
if (compareResult == 0)
{
compareResult = compareDistance(
firstDistance,
secondDistance);
// System.out.println("Equal level "+ firstDistance + " " + secondDistance + " " + compareResult);
}
return compareResult;
}
@@ -86,13 +86,13 @@ public class ThreadMapUtil
return saveContainer.get(Thread.currentThread().getName());
}
public static long[] getVerticalUpdateArray(byte detailLevel,int size){
if(!verticalUpdate.containsKey(Thread.currentThread().getName()) || (verticalUpdate.get(Thread.currentThread().getName()) == null) || (verticalUpdate.get(Thread.currentThread().getName())[detailLevel].length != size))
public static long[] getVerticalUpdateArray(byte detailLevel){
if(!verticalUpdate.containsKey(Thread.currentThread().getName()) || (verticalUpdate.get(Thread.currentThread().getName()) == null) || (verticalUpdate.get(Thread.currentThread().getName())[detailLevel].length != 4*DetailDistanceUtil.getMaxVerticalData(detailLevel)))
{
long[][] array = new long[10][];
for(int i = 0; i < array.length; i++)
{
array[i] = new long[4 * size];
array[i] = new long[4 * DetailDistanceUtil.getMaxVerticalData(detailLevel)];
}
verticalUpdate.put(Thread.currentThread().getName(), array);
}