Package org.ptolemy.machineImprovisation
Class FactorOracleTop
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.InstantiableNamedObj
-
- ptolemy.kernel.Entity<T>
-
- ptolemy.kernel.ComponentEntity
-
- ptolemy.kernel.CompositeEntity
-
- ptolemy.actor.CompositeActor
-
- ptolemy.actor.TypedCompositeActor
-
- ptolemy.domains.modal.modal.ModalModel
-
- org.ptolemy.machineImprovisation.FactorOracleTop
-
- All Implemented Interfaces:
java.lang.Cloneable
,Actor
,Executable
,FiringsRecordable
,Initializable
,TypedActor
,Changeable
,ChangeListener
,Debuggable
,DebugListener
,Derivable
,Instantiable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
public class FactorOracleTop extends ModalModel
This modal model actor supports mirroring of its ports in its container (which is required to be a refinement of a state in a ModalModel). This in turn assures mirroring of ports in each of the refinements.Note that this actor has no attributes of its own. Requests for attributes are delegated to the container.
- Since:
- Ptolemy II 10.0
- Version:
- $Id$
- Author:
- Ilge Akkaya
- Pt.AcceptedRating:
- Pt.ProposedRating:
- Red (ilgea)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.CompositeEntity
CompositeEntity.ContainedObjectsIterator
-
-
Field Summary
-
Fields inherited from class ptolemy.domains.modal.modal.ModalModel
_controller, directorClass, stateDependentCausality
-
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 FactorOracleTop(CompositeEntity container, java.lang.String name)
Construct a modal controller with a name and a container.FactorOracleTop(CompositeEntity container, java.lang.String name, java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate)
Constructs a FactorOracleTop object.FactorOracleTop(Workspace workspace)
Constructs a FactorOracleTop object.FactorOracleTop(Workspace workspace, java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate)
Constructs a FactorOracleTop object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FactorOracle
_createController(java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate)
Create a Factor Oracle to be used within the hierarchical FO that is used for generation of improvised jazz "licks".java.lang.Object
clone(Workspace workspace)
Override the base class to ensure that the _controller private variable is reset to the controller of the cloned object.void
setController(FactorOracle f)
Specify the controller.-
Methods inherited from class ptolemy.domains.modal.modal.ModalModel
attributeChanged, changeExecuted, changeFailed, exportMoML, getAttribute, getCausalityInterface, getController, handleModelError, initialize, newPort
-
Methods inherited from class ptolemy.actor.TypedCompositeActor
_addEntity, _addPort, _addRelation, _checkTypesFromTo, _destinationTypeConstraints, attributeTypeChanged, isBackwardTypeInferenceEnabled, newRelation, resolveTypes, typeConstraintList, typeConstraints
-
Methods inherited from class ptolemy.actor.CompositeActor
_actorFiring, _actorFiring, _finishedAddEntity, _setDirector, _transferPortParameterInputs, addActorFiringListener, addInitializable, addPiggyback, connectionsChanged, createReceivers, createSchedule, fire, getDirector, getExecutiveDirector, getManager, getPublishedPort, getPublishedPortChannel, getPublishedPorts, getSubscribedPortChannel, inferringWidths, inferWidths, inputPortList, isFireFunctional, isOpaque, isPublishedPort, isStrict, iterate, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, linkToPublishedPort, needsWidthInference, newInsideReceiver, newReceiver, notifyConnectivityChange, outputPortList, postfire, prefire, preinitialize, recordFiring, registerPublisherPort, registerPublisherPort, removeActorFiringListener, removeInitializable, removePiggyback, requestChange, setContainer, setDirector, setManager, stop, stopFire, terminate, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unlinkToPublishedPort, unregisterPublisherPort, unregisterPublisherPort, wrapup
-
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, 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, 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, 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, preinitialize, removeInitializable, wrapup
-
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
-
-
-
-
Constructor Detail
-
FactorOracleTop
public FactorOracleTop(Workspace workspace) throws IllegalActionException, NameDuplicationException
Constructs a FactorOracleTop object.- Parameters:
workspace
- The workspace- Throws:
IllegalActionException
NameDuplicationException
-
FactorOracleTop
public FactorOracleTop(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
Construct a modal controller with a name and a container. The container argument must not be null, or a NullPointerException will be thrown.- Parameters:
container
- The container.name
- The name of this actor.- Throws:
IllegalActionException
- If the container is incompatible with this actor.NameDuplicationException
- If the name coincides with an actor already in the container.
-
FactorOracleTop
public FactorOracleTop(CompositeEntity container, java.lang.String name, java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate) throws NameDuplicationException, IllegalActionException
Constructs a FactorOracleTop object.- Parameters:
container
- The container.name
- Name of this actor.trainingSequence
- The training sequence as an Object array.repetitionFactor
- a double indicating the repetition factor on the forward links.pitch
- a boolean -- true if music pitch specifications are being used.validate
- a boolean -- true if pitches are subject to validation.- Throws:
NameDuplicationException
- ...IllegalActionException
- ...
-
FactorOracleTop
public FactorOracleTop(Workspace workspace, java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate) throws NameDuplicationException, IllegalActionException
Constructs a FactorOracleTop object.- Parameters:
workspace
- The workspace.trainingSequence
- The training sequence as an Object array.repetitionFactor
- a double indicating the repetition factor on the forward links.pitch
- a boolean -- true if music pitch specifications are being used.validate
- a boolean -- true if pitches are subject to validation.- Throws:
NameDuplicationException
- ...IllegalActionException
- ...
-
-
Method Detail
-
setController
public void setController(FactorOracle f)
Specify the controller.- Parameters:
f
- The controller
-
_createController
protected FactorOracle _createController(java.lang.Object[] trainingSequence, double repetitionFactor, boolean pitch, boolean validate) throws IllegalActionException, NameDuplicationException
Create a Factor Oracle to be used within the hierarchical FO that is used for generation of improvised jazz "licks".- Parameters:
trainingSequence
- the training sequencerepetitionFactor
- the repetition factor on the forward linkspitch
- boolean indicating a pitch oraclevalidate
- boolean indicating whether the pitches should be validated- Returns:
- A controller to be used in the top level hierarchical FO
- Throws:
IllegalActionException
- If the modal model is incompatible with the controller.NameDuplicationException
- If the name of the controller collides with a name already in the container.
-
clone
public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
Override the base class to ensure that the _controller private variable is reset to the controller of the cloned object.- Overrides:
clone
in classModalModel
- Parameters:
workspace
- The workspace for the cloned object.- Returns:
- The new Entity.
- Throws:
java.lang.CloneNotSupportedException
- If cloned ports cannot have as their container the cloned entity (this should not occur), or if one of the attributes cannot be cloned.- See Also:
NamedObj.exportMoML(Writer, int, String)
,NamedObj.setDeferringChangeRequests(boolean)
-
-