public class FactorOracle extends ModalController
As an example, if a transition that would generate a "C4" upon firing, the guard expression would look like: validatePitch("C4") && probability(p) , where p is a double in range [0.0,1.0]. This transition would be taken (i) if the probability() transition evaluates to true AND (ii) if validatePitch() returns true.
References
[1] C. Allauzen, M. Crochemore, and M. Raffinot. "Factor oracle: A new structure for pattern matching." SOFSEM’99: Theory and Practice of Informatics . Springer Berlin Heidelberg, 1999.
Red (ilgea) |
Modifier and Type | Class and Description |
---|---|
protected class |
FactorOracle.ChordFunction
A function that evaluates to true if the "pitch" that would be produced
as a result of taking this transition satisfies chord specifications.
|
protected class |
FactorOracle.ChordFunctionToken
An inner class that defines a Chord Function Token, which is used in
pitch validation.
|
FSMActor.PortScope
CompositeEntity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
TypedIOPort |
currentChord
Current chord in improvisation
|
Parameter |
repetitionFactor
The repetition probability P(moving along the original sequence rather than taking a jump along
a suffix link)
|
Parameter |
validatePitch
Boolean that when set to true, enables the transitions to have a condition that validates each
pitch against a specification.
|
_mirrorDisable
_currentState, _disabledRefinements, _initializables, _inputTokenMap, _lastChosenTransition, _lastChosenTransitions, _lastTakenTransitions, _stateRefinementsToPostfire, _stopRequested, errorCause, errorClass, errorMessage, finalStateNames, initialStateName, probability, resetOnEachRun, seed, stateDependentCausality, timeout
_levelCrossingLinks
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
FactorOracle(CompositeEntity container,
java.lang.String name)
Constructs a FactorOracle object.
|
FactorOracle(CompositeEntity container,
java.lang.String name,
java.lang.Object[] trainingSequence,
double repetitionFactor)
Construct an actor with the given container and name.
|
FactorOracle(CompositeEntity container,
java.lang.String name,
java.lang.Object[] trainingSequence,
double repetitionFactor,
boolean symbolicOutput,
boolean validateSymbols)
Constructs a FactorOracle object.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<java.lang.Integer> |
_getTransitionsFrom(java.lang.Integer node)
Get a list of transitions originating from node
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
_addPort, _checkContainer, _getRefinementClasses, addRefinement, dropObject, getRefinedState, newPort, setMirrorDisable
_addEntity, _addRelation, _areAllImmediateTransitionsDisabled, _chooseTransitions, _destinationState, _getChannelForIdentifier, _getPortForIdentifier, _getStateRefinementsToPostfire, _getTransitionRefinementsToPostfire, _initializeRefinements, _isRefinementOutput, _isSafeToClear, _readInputs, _schedule, _setCurrentConnectionMap, _setTimeForRefinement, addChosenTransition, addInitializable, attributeChanged, createReceivers, currentState, enabledTransitions, exportSubmodel, fire, foundUnknown, getCausalityInterface, getContext, getDirector, getExecutiveDirector, getInitialState, getLastChosenTransition, getLastChosenTransitions, getLastTakenTransitions, getManager, getModifiedVariables, getPortScope, handleModelError, hasInput, hasInput, initialize, inputPortList, isBackwardTypeInferenceEnabled, isFireFunctional, isOpaque, isStrict, iterate, newReceiver, newRelation, outputPortList, postfire, prefire, preinitialize, readInputs, readOutputsFromRefinement, removeInitializable, reset, setLastChosenTransition, setNewIteration, setSupportMultirate, stop, stopFire, terminate, typeConstraints, wasTransitionTaken, wrapup
_adjustDeferrals, _containedDecorators, _deepOpaqueEntityList, _description, _exportMoMLContents, _finishedAddEntity, _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, setContainer, statistics, uniqueName
_checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_removePort, connectedPortList, connectedPorts, connectionsChanged, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts
_setParent, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_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, attributeTypeChanged, 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, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isBackwardTypeInferenceEnabled, typeConstraints
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
fire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter repetitionFactor
public Parameter validatePitch
public TypedIOPort currentChord
public FactorOracle(CompositeEntity container, java.lang.String name, java.lang.Object[] trainingSequence, double repetitionFactor) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actortrainingSequence
- The input string that the oracle is built fromrepetitionFactor
- a double indicating the factor repetition probabilityIllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public FactorOracle(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The containername
- The nameNameDuplicationException
IllegalActionException
public FactorOracle(CompositeEntity container, java.lang.String name, java.lang.Object[] trainingSequence, double repetitionFactor, boolean symbolicOutput, boolean validateSymbols) throws IllegalActionException, NameDuplicationException
container
- The Containername
- The nametrainingSequence
- An object array containing the training sequencerepetitionFactor
- a double indicating the factor repetition probabilitysymbolicOutput
- a boolean that determines whether symbolic outputs should be producedvalidateSymbols
- a boolean -- true if symbol validation should be included in guard expressionsIllegalActionException
- repetition factor range checkingNameDuplicationException
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
FSMActor
clone
in class FSMActor
workspace
- The workspace for the new actor.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
protected java.util.List<java.lang.Integer> _getTransitionsFrom(java.lang.Integer node)
node
- Node index