csli.dialog.app.calo.topic.classification.mit
Class GibbsSamplerService

java.lang.Object
  extended by csli.dialog.app.calo.topic.classification.mit.GibbsSamplerService
All Implemented Interfaces:
Service

public class GibbsSamplerService
extends Object
implements Service

A service providing the Gibbs sampler used in the MIT/Brown topic model. Newly imported meetings can be added to a queue, and processed in batch mode.

Author:
mpurver

Constructor Summary
GibbsSamplerService()
           
 
Method Summary
 boolean addMeeting(String meeting)
          Add a meeting to the set (queue) of meetings to process
 void clear()
          Clear the queue and the record of meetings done, and any temporary files
 JPanel getGui()
          Get a Swing JPanel which provides a GUI to this service.
static GibbsSamplerService getInstance()
           
 Set<String> getMeetingsDone()
           
 Set<String> getMeetingsToDo()
           
 double getMinutesToNextRun()
           
 String getTitle()
          Get the name of this service as it should appear in the GUI.
 boolean isBusy()
           
 boolean isServiceAlive()
          Is the service happy and alive?
 boolean runSampler()
          The main piece of action: write the data, run the sampler, write the .dat files
 boolean runSampler(boolean evenIfQueueEmpty)
          The main piece of action: write the data, run the sampler, write the .dat files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GibbsSamplerService

public GibbsSamplerService()
Method Detail

getInstance

public static GibbsSamplerService getInstance()
Returns:
the static instance, creating one only if necessary

getMeetingsDone

public Set<String> getMeetingsDone()
Returns:
the set of meetings already processed

getMeetingsToDo

public Set<String> getMeetingsToDo()
Returns:
the set (queue) of meetings to process

isBusy

public boolean isBusy()
Returns:
is the sampler in the middle of a run?

addMeeting

public boolean addMeeting(String meeting)
Add a meeting to the set (queue) of meetings to process

Parameters:
meeting -
Returns:
true if the meeting was added; false if it was already queued or has already been done

getMinutesToNextRun

public double getMinutesToNextRun()
Returns:
the number of minutes until the next run

runSampler

public boolean runSampler()
The main piece of action: write the data, run the sampler, write the .dat files

Returns:
false on error, or if the sampler is already running, or if the meeting queue is empty; true if it actually ran

runSampler

public boolean runSampler(boolean evenIfQueueEmpty)
The main piece of action: write the data, run the sampler, write the .dat files

Parameters:
evenIfQueueEmpty - if true, run even if meetingsToDo is empty
Returns:
false on error, or if the sampler is already running, or if the meeting queue is empty and evenIfQueueEmpty is not set; true if it actually ran

clear

public void clear()
Clear the queue and the record of meetings done, and any temporary files


getGui

public JPanel getGui()
Description copied from interface: Service
Get a Swing JPanel which provides a GUI to this service.

Specified by:
getGui in interface Service

getTitle

public String getTitle()
Description copied from interface: Service
Get the name of this service as it should appear in the GUI.

Specified by:
getTitle in interface Service

isServiceAlive

public boolean isServiceAlive()
Description copied from interface: Service
Is the service happy and alive?

Specified by:
isServiceAlive in interface Service
Returns: