Package ca.eandb.jmist.framework.random

Examples of ca.eandb.jmist.framework.random.SimpleRandom


  }

  public void castPhotons(long n, ProgressMonitor monitor, long progressInterval) {

    long untilCallback = 0;
    Random rng = new SimpleRandom();

    for (int i = 0; i < n; i++) {

      if (--untilCallback <= 0) {
View Full Code Here


  }

  public void castPhotons(long n, ProgressMonitor monitor, long progressInterval) {

    long untilCallback = 0;
    Random rng = new SimpleRandom();
    int sqrt = (int) Math.floor(Math.sqrt(n));
    int nbox = sqrt * sqrt;

    for (int i = 0; i < n; i++) {

      if (--untilCallback <= 0) {

        double progress = (double) i / (double) n;

        if (!monitor.notifyProgress(progress)) {
          monitor.notifyCancelled();
          return;
        }

        untilCallback = progressInterval;

      }

      double ru = rng.next();
      double rv = rng.next();
      double rj = rng.next();

      if (i < nbox) {
        ru = (((double) (i % sqrt)) + ru) / (double) sqrt;
        rv = (((double) (i / sqrt)) + rv) / (double) sqrt;
      }
View Full Code Here

  /** Sets up the random number generated used by this shader. */
  private void initialize() {
    rnd = new ThreadLocal<Random>() {
      protected Random initialValue() {
        return new SimpleRandom();
      }
    };
    if (firstBounceRays > 0) {
      firstBounceSampler = new ThreadLocal<Random>() {
        protected Random initialValue() {
View Full Code Here

    this.background = background;
    this.rng = rng;
  }

  public SceneRayShader(SceneElement root, Light light, RayShader background) {
    this(root, light, background, new ThreadLocalRandom(new SimpleRandom()));
  }
View Full Code Here

  public SceneRayShader(SceneElement root, Light light, RayShader background) {
    this(root, light, background, new ThreadLocalRandom(new SimpleRandom()));
  }

  public SceneRayShader(Scene scene, RayShader background) {
    this(scene.getRoot(), scene.getLight(), background, new ThreadLocalRandom(new SimpleRandom()));
  }
View Full Code Here

  public SceneRayShader(Scene scene, RayShader background) {
    this(scene.getRoot(), scene.getLight(), background, new ThreadLocalRandom(new SimpleRandom()));
  }

  public SceneRayShader(Scene scene) {
    this(scene.getRoot(), scene.getLight(), RayShader.BLACK, new ThreadLocalRandom(new SimpleRandom()));
  }
View Full Code Here

     * @see ca.eandb.jmist.framework.TaskWorker#performTask(java.lang.Object, ca.eandb.util.progress.ProgressMonitor)
     */
    public Object performTask(Object task, ProgressMonitor monitor) {

      Task        info      = (Task) task;
      Random        rng        = new SimpleRandom();
      final int      numInSensors  = incidentCollector.sensors();
      final int      numOutSensors  = exitantCollector.sensors();
      final TaskResult  result      = new TaskResult(numInSensors, numOutSensors);
      final long      progInterval  = MathUtil.clamp(info.samples / 1000, 1, 1000);
      long        progCountdown  = 1;
View Full Code Here

TOP

Related Classes of ca.eandb.jmist.framework.random.SimpleRandom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.