Package org.ptolemy.ssm
Class ParticleFilter
- java.lang.Object
-
- All Implemented Interfaces:
java.lang.Cloneable
,InferenceActor
,MapConstrained
,StateSpaceActor
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class ParticleFilter extends AbstractParticleFilter implements InferenceActor
A particle filter implementation that expects a state-space model and several measurements to be tied with itself via decorators.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Ilge Akkaya
- Pt.AcceptedRating:
- Pt.ProposedRating:
- Red (ilgea)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ptolemy.machineLearning.particleFilter.AbstractParticleFilter
AbstractParticleFilter.InputType
-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class org.ptolemy.machineLearning.particleFilter.AbstractParticleFilter
_inputRelations, _particleLabels, _particleTypes, _Sigma, _stateLabels, _stateNames, _stateTypes, _upToDate, bootstrap, lowVarianceSampler, MEASUREMENT_NOISE, MEASUREMENT_POSTFIX, outputParticleCount, particleCount, particleOutput, PRIOR_NAME, PROCESS_NOISE, resetOnEachRun, seed, STATE_VARIABLE_NAMES, stateEstimate, t, UPDATE_POSTFIX
-
Fields inherited from class ptolemy.actor.CompositeActor
_actorFiringListeners, _causalityInterface, _derivedPiggybacks, _initializables, _notifyingActorFiring, _piggybacks, _publishedPorts, _publisherRelations, _stopRequested, _subscribedPorts
-
Fields inherited from class ptolemy.kernel.CompositeEntity
_levelCrossingLinks
-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
-
-
Constructor Summary
Constructors Constructor Description ParticleFilter(CompositeEntity container, java.lang.String name)
Instantiate a particle filter actor.ParticleFilter(Workspace workspace)
Instantiate a particle filter actor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
_checkParameters()
Check the dimensions of all parameters and ports.protected AbstractParticleFilter.InputType
getInputType(java.lang.String inputName)
Get input type by name referenceprotected Parameter
getMeasurementParameter(java.lang.String fullName)
Return the first encountered value for now.protected Parameter
getNoiseParameter(java.lang.String fullName)
Returns a parameter value corresponding to a noise distribution.protected Parameter
getUserDefinedParameter(java.lang.String eqnName)
Return the Parameter that is part of a state space model.boolean
satisfiesMapConstraints(double[] coordinates)
Return true if the the coordinates satisfy the map constraints.boolean
validDecoratorAssociationExists()
Check if the Actor is associated with a unique enabled StateSpaceModel.-
Methods inherited from class org.ptolemy.machineLearning.particleFilter.AbstractParticleFilter
_constrainParticles, attributeChanged, fire, getMeasurementParameterExpression, getUserDefinedParameterExpression, preinitialize, wrapup
-
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newPort, newRelation, resolveTypes, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, clone, connectionsChanged, createReceivers, createSchedule, getCausalityInterface, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, initialize, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort
-
Methods inherited from class ptolemy.kernel.CompositeEntity
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _removeEntity, _removeRelation, _validateSettables, allAtomicEntityList, allowLevelCrossingConnect, classDefinitionList, connect, connect, containedObjectsIterator, deepCompositeEntityList, deepEntityList, deepGetEntities, deepNamedObjList, deepOpaqueEntityList, deepRelationSet, entityList, entityList, exportLinks, exportMoML, getAttribute, getEntities, getEntity, getPort, getRelation, getRelations, isAtomic, lazyAllAtomicEntityList, lazyAllCompositeEntityList, lazyAllCompositeTransparentAndOpaqueEntityList, lazyClassDefinitionList, lazyDeepEntityList, lazyEntityList, lazyRelationList, numberOfEntities, numberOfRelations, numEntities, numRelations, relationList, removeAllEntities, removeAllRelations, setClassDefinition, statistics, uniqueName
-
Methods inherited from class ptolemy.kernel.ComponentEntity
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
-
Methods inherited from class ptolemy.kernel.Entity
_removePort, connectedPortList, connectedPorts, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
-
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
-
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, clone, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Actor
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
-
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
-
Methods inherited from interface ptolemy.actor.Executable
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
-
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, initialize, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
ParticleFilter
public ParticleFilter(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
Instantiate a particle filter actor.- Parameters:
container
- The containername
- The name- Throws:
IllegalActionException
- If the actor cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
ParticleFilter
public ParticleFilter(Workspace workspace) throws NameDuplicationException, IllegalActionException
Instantiate a particle filter actor.- Parameters:
workspace
- The workspace in which to instantiate actor.- Throws:
IllegalActionException
- If the actor cannot be contained by the proposed container.NameDuplicationException
- If the container already has an actor with this name.
-
-
Method Detail
-
_checkParameters
protected void _checkParameters() throws IllegalActionException
Check the dimensions of all parameters and ports.- Specified by:
_checkParameters
in classAbstractParticleFilter
- Throws:
IllegalActionException
- If the dimensions are illegal.
-
validDecoratorAssociationExists
public boolean validDecoratorAssociationExists() throws IllegalActionException
Check if the Actor is associated with a unique enabled StateSpaceModel. Ideally, here, we would also be checking whether the enabled decorator provides the parameters expected by the actor.- Specified by:
validDecoratorAssociationExists
in interfaceStateSpaceActor
- Returns:
- true if a valid decorator association exists.
- Throws:
IllegalActionException
-
getUserDefinedParameter
protected Parameter getUserDefinedParameter(java.lang.String eqnName) throws IllegalActionException
Description copied from class:AbstractParticleFilter
Return the Parameter that is part of a state space model.- Specified by:
getUserDefinedParameter
in classAbstractParticleFilter
- Parameters:
eqnName
- Name of parameter- Returns:
- Parameter object
- Throws:
IllegalActionException
-
getMeasurementParameter
protected Parameter getMeasurementParameter(java.lang.String fullName) throws IllegalActionException
Return the first encountered value for now.- Specified by:
getMeasurementParameter
in classAbstractParticleFilter
- Parameters:
fullName
- The name of the measurement parameter.- Returns:
- THe value of the measurement parameter.
- Throws:
IllegalActionException
- If there is a problem getting the parameter.
-
getInputType
protected AbstractParticleFilter.InputType getInputType(java.lang.String inputName)
Description copied from class:AbstractParticleFilter
Get input type by name reference- Specified by:
getInputType
in classAbstractParticleFilter
- Parameters:
inputName
- The name of the input- Returns:
- an InputType object indicating the type of input
-
getNoiseParameter
protected Parameter getNoiseParameter(java.lang.String fullName) throws IllegalActionException
Description copied from class:AbstractParticleFilter
Returns a parameter value corresponding to a noise distribution.- Specified by:
getNoiseParameter
in classAbstractParticleFilter
- Parameters:
fullName
- Name of noise parameter- Returns:
- a Parameter object that by name reference corresponds to a specific noise distribution
- Throws:
IllegalActionException
-
satisfiesMapConstraints
public boolean satisfiesMapConstraints(double[] coordinates)
Description copied from interface:MapConstrained
Return true if the the coordinates satisfy the map constraints.- Specified by:
satisfiesMapConstraints
in interfaceMapConstrained
- Parameters:
coordinates
- The coordinates- Returns:
- true if the the coordinates satisfy the map constraints.
-
-