Skip to content

Commit

Permalink
Address review comments from @trautmane
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Nov 27, 2023
1 parent 8bf964b commit 1545904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;

import mpicbg.models.Affine2D;
Expand Down Expand Up @@ -107,7 +108,7 @@ public static void main(final String[] args)
run(cmdLineSetup);
}

public static void run(AffineBlockSolverSetup cmdLineSetup) throws IOException, InterruptedException {
public static void run(final AffineBlockSolverSetup cmdLineSetup) throws IOException, InterruptedException {
final RenderSetup renderSetup = RenderSetup.setupSolve(cmdLineSetup);

// Note: different setups can be used if specific things need to be done for the solve or certain blocks
Expand Down Expand Up @@ -256,7 +257,7 @@ private static AffineModel2D pickRandom(final List<AffineModel2D> models, final
if (models.size() == 1)
return models.get(0);

final double randomSample = Math.random();
final double randomSample = ThreadLocalRandom.current().nextDouble();
final int i = getRandomIndex(weights, randomSample);
return models.get(i);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public class BlockPartitionParameters implements Serializable {

@Parameter(
names = "--shiftBlocks",
description = "Shift blocks by half a block size in all partitioned directions")
description = "Shift blocks by half a block size in all partitioned directions",
arity = 0)
public Boolean shiftBlocks = false;

public BlockPartitionParameters() {}
Expand Down

0 comments on commit 1545904

Please sign in to comment.