de.jstacs.models.mixture.gibbssampling
Class SimpleBurnInTest

java.lang.Object
  extended by de.jstacs.models.mixture.gibbssampling.BurnInTest
      extended by de.jstacs.models.mixture.gibbssampling.SimpleBurnInTest
All Implemented Interfaces:
Storable, Cloneable

public class SimpleBurnInTest
extends BurnInTest

This is a very simple test for the length of the burn-in phase. It returns for all samplings the length given in the constructor.

Author:
Jens Keilwagen

Constructor Summary
SimpleBurnInTest(int burnInLength)
          This is the main constructor that creates an instance of fixed burn-in length.
SimpleBurnInTest(StringBuffer xml)
          The standard constructor for the interface Storable.
 
Method Summary
 String getInstanceName()
          Returns a short description of the burn-in test.
 int getLengthOfBurnIn(int sampling)
          Return the length of the burn in phase of sampling index.
 void resetAllValues()
          This method can be used to remove all values from the internal memory.
 void setCurrentSamplingIndex(int index)
          This method sets the value of the current sampling. this allows to assign th evalues form BurnInTest.setValue(double) to a sampling.
 void setValue(double val)
          This method can be used to fill the internal memory with the values that will be used to determine the length of the burn-in phase.
 void test()
          Computes the length of the burn-in phase using the values from BurnInTest.setValue(double).
 StringBuffer toXML()
          This method returns an XML-representation of an instance of the implementing class.
 
Methods inherited from class de.jstacs.models.mixture.gibbssampling.BurnInTest
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBurnInTest

public SimpleBurnInTest(int burnInLength)
This is the main constructor that creates an instance of fixed burn-in length.

Parameters:
burnInLength - the length of the burn-in

SimpleBurnInTest

public SimpleBurnInTest(StringBuffer xml)
                 throws NonParsableException
The standard constructor for the interface Storable.

Parameters:
xml - the StringBuffer containing the model
Throws:
NonParsableException - if the StringBuffer can not be parsed
Method Detail

setCurrentSamplingIndex

public void setCurrentSamplingIndex(int index)
Description copied from class: BurnInTest
This method sets the value of the current sampling. this allows to assign th evalues form BurnInTest.setValue(double) to a sampling.

Specified by:
setCurrentSamplingIndex in class BurnInTest
Parameters:
index - the index of the sampling

setValue

public void setValue(double val)
Description copied from class: BurnInTest
This method can be used to fill the internal memory with the values that will be used to determine the length of the burn-in phase.

Specified by:
setValue in class BurnInTest
Parameters:
val - the value

test

public void test()
Description copied from class: BurnInTest
Computes the length of the burn-in phase using the values from BurnInTest.setValue(double).

Specified by:
test in class BurnInTest

resetAllValues

public void resetAllValues()
Description copied from class: BurnInTest
This method can be used to remove all values from the internal memory.

Specified by:
resetAllValues in class BurnInTest

getLengthOfBurnIn

public int getLengthOfBurnIn(int sampling)
Description copied from class: BurnInTest
Return the length of the burn in phase of sampling index.

Specified by:
getLengthOfBurnIn in class BurnInTest
Parameters:
sampling - the index of the sampling
Returns:
the length of the burn in phase of sampling index

toXML

public StringBuffer toXML()
Description copied from interface: Storable
This method returns an XML-representation of an instance of the implementing class.

Returns:
the XML-representation

getInstanceName

public String getInstanceName()
Description copied from class: BurnInTest
Returns a short description of the burn-in test.

Specified by:
getInstanceName in class BurnInTest
Returns:
a short description of the burn-in test.