ObservationType
- Type of observations handled by the algorithm.ParameterType
- Type of parameters to infer.public abstract class AbstractParticleFilter<ObservationType,ParameterType> extends AbstractBatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>> implements ParticleFilter<ObservationType,ParameterType>
ParticleFilter.Updater<ObservationType,ParameterType>
Modifier and Type | Field and Description |
---|---|
protected int |
numParticles
Number of particles in the filter.
|
protected java.util.Random |
random
Random number generator.
|
protected ParticleFilter.Updater<ObservationType,ParameterType> |
updater
Updates the particle given an existing particle.
|
Constructor and Description |
---|
AbstractParticleFilter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
AbstractParticleFilter<ObservationType,ParameterType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
double |
computeEffectiveParticles(DataDistribution<ParameterType> particles)
Computes the effective number of particles.
|
DataDistribution<ParameterType> |
createInitialLearnedObject()
Creates a new initial learned object, before any data is given.
|
int |
getNumParticles()
Gets the number of particles
|
java.util.Random |
getRandom()
Gets the random number generator used by this object.
|
ParticleFilter.Updater<ObservationType,ParameterType> |
getUpdater()
Gets the updater
|
void |
setNumParticles(int numParticles)
Sets the number of particles
|
void |
setRandom(java.util.Random random)
Sets the random number generator used by this object.
|
void |
setUpdater(ParticleFilter.Updater<ObservationType,ParameterType> updater)
Setter for updater
|
learn, learn, update
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
learn
update, update
protected ParticleFilter.Updater<ObservationType,ParameterType> updater
protected transient java.util.Random random
protected int numParticles
public AbstractParticleFilter<ObservationType,ParameterType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractBatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>>
public ParticleFilter.Updater<ObservationType,ParameterType> getUpdater()
ParticleFilter
getUpdater
in interface ParticleFilter<ObservationType,ParameterType>
public void setUpdater(ParticleFilter.Updater<ObservationType,ParameterType> updater)
updater
- Updater algorithm that updates the particles.public java.util.Random getRandom()
Randomized
getRandom
in interface Randomized
public void setRandom(java.util.Random random)
Randomized
setRandom
in interface Randomized
random
- The random number generator for this object to use.public DataDistribution<ParameterType> createInitialLearnedObject()
IncrementalLearner
createInitialLearnedObject
in interface IncrementalLearner<ObservationType,DataDistribution<ParameterType>>
public double computeEffectiveParticles(DataDistribution<ParameterType> particles)
ParticleFilter
computeEffectiveParticles
in interface ParticleFilter<ObservationType,ParameterType>
particles
- Current state of the Particle filter.public int getNumParticles()
ParticleFilter
getNumParticles
in interface ParticleFilter<ObservationType,ParameterType>
public void setNumParticles(int numParticles)
ParticleFilter
setNumParticles
in interface ParticleFilter<ObservationType,ParameterType>
numParticles
- Number of particles.