public class HistogramPlotter extends PlotterBase
The output plot consists of a set of vertical bars, each representing a histogram bin. The height of the bar is the count of the number of inputs that have been observed that fall within that bin. The n-th bin represents values in the range (x - w/2 + o, x + w/2 + o), where w is the value of the binWidth parameter, and o is the value of the binOffset parameter. So for example, if o = w/2, then each bin represents values from nw to (n + 1)w for some integer n. The default offset is 0.5, half the default bin width, which is 1.0.
This actor has a legend parameter, which gives a comma-separated list of labels to attach to each dataset. Normally, the number of elements in this list should equal the number of input channels, although this is not enforced.
Histogram
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
binOffset
The offset for bins of the histogram.
|
Parameter |
binWidth
The width of the bin of the histogram.
|
TypedIOPort |
input
The input port, which is a multiport.
|
_base, _source, _text, automaticRescale, fillOnWrapup, legend, plot
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_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 |
---|
HistogramPlotter(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_implementDeferredConfigurations()
If configurations have been deferred, implement them now.
|
protected PlotBox |
_newPlot()
Create a new Histogram plot.
|
void |
attributeChanged(Attribute attribute)
If the parameter is binWidth or binOffset, then
configure the histogram with the specified bin width or offset.
|
void |
configure(java.net.URL base,
java.lang.String source,
java.lang.String text)
Configure the plot with data from the specified input source
(a URL) and/or textual data, assumed to be in PlotML format.
|
java.lang.String |
getSource()
Return the input source that was specified the last time the configure
method was called.
|
void |
initialize()
If the histogram has not already been created, create it using
place().
|
boolean |
postfire()
Read at most one input token from each input channel
and update the histogram.
|
_exportMoMLContents, _getImplementation, _isMoMLSuppressed, _propagateValue, cleanUp, clone, getConfigureSource, getConfigureText, place, preinitialize, setContainer, setDisplayName, setFrame, setName, wrapup
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, fire, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, prefire, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, stop, stopFire, terminate
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence
_addPort, _description, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, 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, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
fire, isFireFunctional, isStrict, iterate, prefire, stop, stopFire, terminate
addInitializable, removeInitializable
description, getContainer, getDisplayName, getFullName, getName, getName
getDerivedLevel, getDerivedList, propagateValue
public Parameter binWidth
public Parameter binOffset
public TypedIOPort input
public HistogramPlotter(CompositeEntity container, java.lang.String name) throws IllegalActionException, NameDuplicationException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class PlotterBase
attribute
- The attribute that changed.IllegalActionException
- If the bin width is not positive.public void configure(java.net.URL base, java.lang.String source, java.lang.String text) throws java.lang.Exception
configure
in interface Configurable
configure
in class PlotterBase
base
- The base relative to which references within the input
stream are found, or null if this is not known.source
- The input source, which specifies a URL.text
- Configuration information given as text.java.lang.Exception
- If the configuration source cannot be read
or if the configuration information is incorrect.public java.lang.String getSource()
getSource
in interface MoMLExportable
getSource
in class NamedObj
NamedObj.setSource(String)
,
MoMLExportable
public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If the parent class throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.protected void _implementDeferredConfigurations()
_implementDeferredConfigurations
in class PlotterBase
protected PlotBox _newPlot()
_newPlot
in class PlotterBase