public interface SamplingComponent
initForSampling(int)
is called. extendSampling(int, boolean)
is called. acceptParameters()
. samplingStopped()
is called. parseParameterSet(int, int)
and
parseNextParameterSet()
will be used for
computing for instance the (log-) likelihoods. isInSamplingMode()
can be used to
check whether an object is currently used for sampling. If the object is in
sampling mode, it should not support any other method for changing the
parameters than the specialized sampling method of the sub-interfaces and
parseParameterSet(int, int)
. Furthermore it is
legal to throw an Exception
when the object is in sampling mode and a
method for saving, cloning or training the parameters is called.Modifier and Type | Method and Description |
---|---|
void |
acceptParameters()
This methods accepts the drawn parameters.
|
void |
extendSampling(int sampling,
boolean append)
This method allows to extend a sampling.
|
void |
initForSampling(int starts)
This method initializes the instance for the sampling.
|
boolean |
isInSamplingMode()
This method returns
true if the object is currently used in
a sampling, otherwise false . |
boolean |
parseNextParameterSet()
This method allows the user to parse the next set of parameters (from a
file).
|
boolean |
parseParameterSet(int sampling,
int n)
This method allows the user to parse the set of parameters with index
n of a certain sampling (from a file). |
void |
samplingStopped()
This method is the opposite of the method
extendSampling(int, boolean) . |
boolean parseParameterSet(int sampling, int n) throws Exception
n
of a certain sampling
(from a file). The
internal numbering should start with 0. The parameter set with index 0 is
the initial (random) parameter set. It is recommended that a series of
parameter sets is accessed by the following lines:
for( sampling = 0; sampling < numSampling; sampling++ )
{
boolean b = parseParameterSet( sampling, n );
while( b )
{
//do something
b = parseNextParameterSet();
}
}
sampling
- the index of the samplingn
- the index of the parameter settrue
if the parameter set could be parsedException
- if there is a problem with parsing the parametersparseNextParameterSet()
boolean parseNextParameterSet()
true
if the parameters could be parsed, otherwise
false
parseParameterSet(int, int)
void initForSampling(int starts) throws IOException
starts
- the number of different sampling starts that will be doneIOException
- if something went wrongFile.createTempFile(String, String, java.io.File )
void extendSampling(int sampling, boolean append) throws IOException
sampling
- the index of the samplingappend
- whether to append the sampled parameters to an existing file
or to overwrite the fileIOException
- if the file could not be handled correctlyvoid samplingStopped() throws IOException
extendSampling(int, boolean)
. It can be
used for closing any streams of writer, ...IOException
- if something went wrongextendSampling(int, boolean)
boolean isInSamplingMode()
true
if the object is currently used in
a sampling, otherwise false
.true
if the object is currently used in a sampling,
otherwise false
void acceptParameters() throws IOException
IOException
- if the file could not be handled correctly