Module raytracer

Class MetropolisProcessor

All Implemented Interfaces:
RayProcessor, Cloneable

public class MetropolisProcessor extends BiDirectionalProcessor
  • Field Details

    • CORRECTION_FACTOR

      public static final String CORRECTION_FACTOR
      See Also:
    • MUTATION_PP_COUNT

      public static final String MUTATION_PP_COUNT
      See Also:
    • minimalPathLength

      public int minimalPathLength
    • maximalPathLength

      public int maximalPathLength
    • stopped

      public static boolean stopped
    • imageWidth

      public int imageWidth
    • imageHeight

      public int imageHeight
    • imageUpdateRate

      protected int imageUpdateRate
    • nextImageUpdateTime

      protected long nextImageUpdateTime
    • timeDiff

      protected long timeDiff
  • Constructor Details

    • MetropolisProcessor

      public MetropolisProcessor()
  • Method Details

    • dup

      public RayProcessor dup(Scene scene)
      Description copied from interface: RayProcessor
      Returns a clone of this RayProcessor. All constant variables are copied shallowly, state variables are newly created and copied where necessary.
      Specified by:
      dup in interface RayProcessor
      Overrides:
      dup in class BiDirectionalProcessor
      Parameters:
      scene - duplicate of scene
      Returns:
      clone of this ray processor
    • initialize

      public void initialize(PixelwiseRenderer renderer, Scene scene)
      Description copied from interface: RayProcessor
      With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.
      Specified by:
      initialize in interface RayProcessor
      Overrides:
      initialize in class BiDirectionalProcessor
      Parameters:
      renderer - the renderer which provides the needed information
      scene - the scene which is rendered
    • setMinMaxPathLength

      public void setMinMaxPathLength(int testLength)
    • getColorFromRay

      public void getColorFromRay(Line ray, Spectrum resp, Color4f color, Random random)
      Description copied from interface: RayProcessor
      The main method of a ray processor. This method computes a color for the specified ray. color.w contains the alpha value for the ray, the other components are premultiplied with this alpha value.
      Specified by:
      getColorFromRay in interface RayProcessor
      Overrides:
      getColorFromRay in class BiDirectionalProcessor
      Parameters:
      ray - input - calculate for this ray
      resp - responsivity of camera
      color - output - the calculated color
      random - pseudorandom generator
    • mergeWithRenderer

      public void mergeWithRenderer()
    • resetAll

      public void resetAll()
    • initializeLoop

      public void initializeLoop(float brightness, int imageWidth, int imageHeight, int mutatedPixPerProc, MetropolisRenderer.MetropolisResult result, int procId)
    • getResult

      public PixelwiseRenderer.Result getResult()
    • getMutatedPixels

      public int getMutatedPixels()
    • appendStatisticsImpl

      protected void appendStatisticsImpl(StringBuffer stats)
      Overrides:
      appendStatisticsImpl in class BiDirectionalProcessor
    • pathChanged

      public void pathChanged()