de.grogra.ray2.tracing
Class MetropolisProcessor

java.lang.Object
  extended by de.grogra.ray2.tracing.ProcessorBase
      extended by de.grogra.ray2.tracing.RayProcessorBase
          extended by de.grogra.ray2.tracing.PathTracer
              extended by de.grogra.ray2.tracing.BiDirectionalProcessor
                  extended by de.grogra.ray2.tracing.MetropolisProcessor
All Implemented Interfaces:
RayProcessor, java.lang.Cloneable

public class MetropolisProcessor
extends BiDirectionalProcessor


Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.ray2.tracing.RayProcessorBase
RayProcessorBase.Locals
 
Field Summary
static java.lang.String CORRECTION_FACTOR
           
 int imageHeight
           
protected  int imageUpdateRate
           
 int imageWidth
           
 int maximalPathLength
           
 int minimalPathLength
           
static java.lang.String MUTATION_PP_COUNT
           
protected  long nextImageUpdateTime
           
static boolean stopped
           
protected  long timeDiff
           
 
Fields inherited from class de.grogra.ray2.tracing.BiDirectionalProcessor
bestLight, bestS, bestT, EYEPATH_DEPTH, HEURISTIC_FACTOR, isMetropolis, LIGHTPATH_DEPTH, lineTracer, loacalCausticMap, tracingMediator
 
Fields inherited from class de.grogra.ray2.tracing.PathTracer
BRIGHTNESS
 
Fields inherited from class de.grogra.ray2.tracing.RayProcessorBase
enteredSolids, RECURSION_DEPTH, scene
 
Constructor Summary
MetropolisProcessor()
           
 
Method Summary
protected  void appendStatisticsImpl(java.lang.StringBuffer stats)
           
 RayProcessor dup(Scene scene)
          Returns a clone of this RayProcessor.
 void getColorFromRay(Line ray, Spectrum resp, Color4f color, java.util.Random random)
          The main method of a ray processor.
 int getMutatedPixels()
           
 PixelwiseRenderer.Result getResult()
           
 void initialize(PixelwiseRenderer renderer, Scene scene)
          With this method the processor is initialized with the scene and other information of a PixelwiseRenderer.
 void initializeLoop(float brightness, int imageWidth, int imageHeight, int mutatedPixPerProc, MetropolisRenderer.MetropolisResult result, int procId)
           
 void mergeWithRenderer()
           
 void pathChanged()
           
 void resetAll()
           
 void setMinMaxPathLength(int testLength)
           
 
Methods inherited from class de.grogra.ray2.tracing.BiDirectionalProcessor
chooseBestPathCombination, initializeBeforeTracing
 
Methods inherited from class de.grogra.ray2.tracing.PathTracer
initLocals, mergeStatistics
 
Methods inherited from class de.grogra.ray2.tracing.RayProcessorBase
getIOR, getLightProcessor, record, record, setLightProcessor, setRecursionDepth, unrecord
 
Methods inherited from class de.grogra.ray2.tracing.ProcessorBase
appendStatistics, clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.grogra.ray2.tracing.RayProcessor
appendStatistics
 

Field Detail

CORRECTION_FACTOR

public static final java.lang.String CORRECTION_FACTOR
See Also:
Constant Field Values

imageHeight

public int imageHeight

imageUpdateRate

protected int imageUpdateRate

imageWidth

public int imageWidth

maximalPathLength

public int maximalPathLength

minimalPathLength

public int minimalPathLength

MUTATION_PP_COUNT

public static final java.lang.String MUTATION_PP_COUNT
See Also:
Constant Field Values

nextImageUpdateTime

protected long nextImageUpdateTime

stopped

public static boolean stopped

timeDiff

protected long timeDiff
Constructor Detail

MetropolisProcessor

public MetropolisProcessor()
Method Detail

appendStatisticsImpl

protected void appendStatisticsImpl(java.lang.StringBuffer stats)
Overrides:
appendStatisticsImpl in class BiDirectionalProcessor

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

getColorFromRay

public void getColorFromRay(Line ray,
                            Spectrum resp,
                            Color4f color,
                            java.util.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

getMutatedPixels

public int getMutatedPixels()

getResult

public PixelwiseRenderer.Result getResult()

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

initializeLoop

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

mergeWithRenderer

public void mergeWithRenderer()

pathChanged

public void pathChanged()

resetAll

public void resetAll()

setMinMaxPathLength

public void setMinMaxPathLength(int testLength)