Package ca.eandb.jmist.framework.random

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


            return colorModel.createRaster(width, height);
          }
        };
        seqX = new ThreadLocal<RepeatableRandom>() {
          public RepeatableRandom initialValue() {
            return new RepeatableRandom(
                KelemenMetropolisLightTransportJob.this.random);
          }
        };
        seqY = new ThreadLocal<RepeatableRandom>() {
          public RepeatableRandom initialValue() {
            return new RepeatableRandom(
                KelemenMetropolisLightTransportJob.this.random);
          }
        };
        mutationType = new ThreadLocal<CategoricalRandom>() {
          final double[] weights = new double[]{ 40, 0, 60 };
View Full Code Here


        };
      }
    }

    private Path generateNewPath() {
      RepeatableRandom seq = (RepeatableRandom) seqX.get().createCompatibleRandom();
      seqY.set(seq);

//      int index      = lcg.get().next();
//      int x        = index % width;
//      int y        = index / width;
//
//      double y0      = (double) y / height;
//      double y1      = (double) (y + 1) / height;
//
//      double x0      = (double) x / width;
//      double x1      = (double) (x + 1) / width;
//
//      Box2 bounds      = new Box2(x0, y0, x1, y1);

      //Point2 p      = RandomUtil.uniform(bounds, seq);
      Point2 p      = RandomUtil.canonical2(seq);
      seq.mark();

      Color sample    = colorModel.sample(seq);
      seq.mark();

      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      return new Path(lightTail, eyeTail);
    }

    private Path mutateImagePoint(Path path, double width) {
      RepeatableRandom seq = seqX.get().cloneSequence();
      seqY.set(seq);
      seq.reset();

      seq.mutate(width);
      Point2 p      = RandomUtil.canonical2(seq);
      seq.mark();

      Color sample    = colorModel.sample(seq);
      seq.mark();

      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      PathNode lightTail  = path.getLightTail();
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

      return new Path(lightTail, eyeTail);
    }

    private Path mutateAll(Path path, double width) {
      RepeatableRandom seq = seqX.get().cloneSequence();
      seqY.set(seq);
      seq.reset();

      seq.mutate(width);
      Point2 p      = RandomUtil.canonical2(seq);
      seq.mark();

      seq.mutate(width);
      Color sample    = colorModel.sample(seq);
      seq.mark();

      seq.mutate(width);
      PathInfo pi      = new PathInfo(scene, sample.getWavelengthPacket());
      Lens lens      = scene.getLens();
      PathNode eyeTail  = strategy.traceEyePath(lens, p,
                    pi, seq);
      seq.mark();

      seq.mutate(width);
      Light light      = scene.getLight();
      PathNode lightTail  = strategy.traceLightPath(
                    light, pi, seq);
      seq.mark();

      return new Path(lightTail, eyeTail);
    }
View Full Code Here

TOP

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

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.