statalign.postprocess.plugins
Class LogLikelihoodTrace

java.lang.Object
  extended by statalign.postprocess.Postprocess
      extended by statalign.postprocess.plugins.LogLikelihoodTrace

public class LogLikelihoodTrace
extends Postprocess

This is the implementation of the postprocess that handles loglikelihoods.

Author:
miklos, novak

Field Summary
 java.util.ArrayList<LogLikelihoodTraceContainer> list
           
 
Fields inherited from class statalign.postprocess.Postprocess
active, alignmentType, file, hasToolBar, mcmc, outputable, outputFile, postprocessable, postprocessWrite, rnaAssociated, sampling, screenable, selected, show
 
Constructor Summary
LogLikelihoodTrace()
          It constructs a postprocess handler that is screenable (=can be shown on the GUI), outputable (= can be written into the log file) and postprocessable (= can generate its own output file).
 
Method Summary
 void afterLastSample()
          It writes the sampled loglikelihood values into a separate file.
 void beforeFirstSample(InputData input)
          Initialises the graphical interface.
 java.lang.String getFileExtension()
          Returns default file extension that is to appended to the input file name to get the file this plugin is writing into.
 javax.swing.Icon getIcon()
          Returns the icon generated from the picture in file icons/loglikelihood1.gif.
 javax.swing.JPanel getJPanel()
          It generates a panel and returns it.
 java.lang.String getTabName()
          Returns the name of the postprocess, 'Loglikelihood'.
 double getTabOrder()
          Specifies the order of the tab for this plugin in the GUI.
 java.lang.String getTip()
          Returns the tip of the tabulated panel 'Log-likelihood trace' (shown when mouse is moved over the panel)
 void newSample(McmcModule coreModel, State state, int no, int total)
          Writes the loglikelihoods into a logfile, if sampling mode is switched on.
 void newStep(McmcStep mcmcStep)
          It makes a dynamically updated list containing <300 samples evenly distributed from the steps already made.
 void setSampling(boolean enabled)
          It switches on and off the sampling mode.
 
Methods inherited from class statalign.postprocess.Postprocess
addTrack, getDependences, getModExtPlugins, getToolBarItems, getTracks, init, newPeek, newSample, refToDependences, reloadPanel, setSelected
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

public java.util.ArrayList<LogLikelihoodTraceContainer> list
Constructor Detail

LogLikelihoodTrace

public LogLikelihoodTrace()
It constructs a postprocess handler that is screenable (=can be shown on the GUI), outputable (= can be written into the log file) and postprocessable (= can generate its own output file). The default setting is that it writes loglikelihoods both into the logfile and its own output file.

Method Detail

getTabName

public java.lang.String getTabName()
Returns the name of the postprocess, 'Loglikelihood'.

Specified by:
getTabName in class Postprocess
Returns:
Returns with the name that will appear on the label of the tabulated panel.

getIcon

public javax.swing.Icon getIcon()
Returns the icon generated from the picture in file icons/loglikelihood1.gif.

Specified by:
getIcon in class Postprocess
Returns:
Returns with the icon that will appear on the label of the tabulated panel.

getJPanel

public javax.swing.JPanel getJPanel()
It generates a panel and returns it.

Specified by:
getJPanel in class Postprocess
Returns:
Returns with the panel of the GUI

getTip

public java.lang.String getTip()
Returns the tip of the tabulated panel 'Log-likelihood trace' (shown when mouse is moved over the panel)

Specified by:
getTip in class Postprocess

getTabOrder

public double getTabOrder()
Description copied from class: Postprocess
Specifies the order of the tab for this plugin in the GUI.

E.g. we probably always want the "sequence input"-tab to appear first and therefore it returns a 1.0d here. The "current alignment"-tab returns 2.0d here and so if we want to make a tab get ordered between the "sequence input" and the "current alignment"-tabs we just make that plugin return 1.5d or something similar here. By default tabs get ordered last.

Overrides:
getTabOrder in class Postprocess
Returns:
the tab order of the tab associated with this plugin, if running in a GUI.

getFileExtension

public java.lang.String getFileExtension()
Description copied from class: Postprocess
Returns default file extension that is to appended to the input file name to get the file this plugin is writing into.

Overrides:
getFileExtension in class Postprocess

newSample

public void newSample(McmcModule coreModel,
                      State state,
                      int no,
                      int total)
Writes the loglikelihoods into a logfile, if sampling mode is switched on.

Overrides:
newSample in class Postprocess

newStep

public void newStep(McmcStep mcmcStep)
It makes a dynamically updated list containing <300 samples evenly distributed from the steps already made. The graphical interface draws the loglikelihood chain based on this list.

Overrides:
newStep in class Postprocess

beforeFirstSample

public void beforeFirstSample(InputData input)
Initialises the graphical interface.

Overrides:
beforeFirstSample in class Postprocess

afterLastSample

public void afterLastSample()
It writes the sampled loglikelihood values into a separate file.

Overrides:
afterLastSample in class Postprocess

setSampling

public void setSampling(boolean enabled)
It switches on and off the sampling mode.

Specified by:
setSampling in class Postprocess
Parameters:
enabled - Set it true if you need samples.