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.
| 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.PortScopeCompositeEntity.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, LINKSCOMPLETED, 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, _init, _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, workspaceequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisBackwardTypeInferenceEnabled, typeConstraintscreateReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortListfire, isFireFunctional, isStrict, iterate, postfire, prefire, stop, stopFire, terminateaddInitializable, initialize, preinitialize, removeInitializable, wrapupdescription, getContainer, getDisplayName, getFullName, getName, getName, setNamegetDerivedLevel, getDerivedList, propagateValuepublic 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 nameNameDuplicationExceptionIllegalActionExceptionpublic 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 checkingNameDuplicationExceptionpublic java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
FSMActorclone in class FSMActorworkspace - 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