ptolemy.actor.kiel
Class KielerCombine

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.InstantiableNamedObj
          extended by ptolemy.kernel.Entity
              extended by ptolemy.kernel.ComponentEntity
                  extended by ptolemy.actor.AtomicActor
                      extended by ptolemy.actor.TypedAtomicActor
                          extended by ptolemy.actor.kiel.KielerCombine
All Implemented Interfaces:
Serializable, Cloneable, ptolemy.actor.Actor, ptolemy.actor.Executable, ptolemy.actor.FiringsRecordable, ptolemy.actor.Initializable, ptolemy.actor.TypedActor, ptolemy.kernel.util.Changeable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Moveable, ptolemy.kernel.util.Nameable

public class KielerCombine
extends ptolemy.actor.TypedAtomicActor

KielerCombine Actor for SyncCharts Simulation within Ptolemy II.

See Also:
Serialized Form
Pt.AcceptedRating:
Red (cmot)
Rating red

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
protected  int _ADD
           
protected  int _AND
           
protected  int _CONST
           
protected  int _MAX
           
protected  int _MIN
           
protected  int _MULT
           
protected  int _NONE
           
protected  int _OR
           
 ptolemy.kernel.util.StringAttribute function
          The function to compute a combine operation on signals.
 ptolemy.actor.TypedIOPort input
          This is a multiport for input (known) signals.
 ptolemy.actor.TypedIOPort output
          Output a signal here iff any connected input signal is known.
 ptolemy.actor.TypedIOPort value
          Output a resulting This is a constant value of "1", always.
 
Fields inherited from class ptolemy.actor.AtomicActor
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _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
KielerCombine(ptolemy.kernel.CompositeEntity container, String name)
          Construct an actor with the given container and name.
 
Method Summary
protected  int _updateFunction(int in, int old)
          Calculate the function on the given arguments.
 void attributeChanged(ptolemy.kernel.util.Attribute attribute)
          Override the base class to determine which function is being specified.
 void fire()
          Collect the integer tokens of all available inputs and combine them using the combine function.
 void initialize()
          Set the RailwayInterface and open a TCP connection to the Model Railway interface program w/ the given host and port parameters.
 boolean isStrict()
          This actor must be *NON-strict* because it must not wait for more than one input within an SR director iteration.
 boolean postfire()
           
 boolean prefire()
           
 void wrapup()
          Terminate the TCP connection of the Model Railway interface.
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, _fireAt, _fireAt, attributeTypeChanged, clone, newPort, typeConstraintList, typeConstraints
 
Methods inherited from class ptolemy.actor.AtomicActor
_actorFiring, _actorFiring, addActorFiringListener, addInitializable, clone, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeList, attributeList, 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, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, 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.actor.Executable
isFireFunctional, iterate, stop, stopFire, terminate
 
Methods inherited from interface ptolemy.actor.Initializable
addInitializable, preinitialize, removeInitializable
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getContainer, getDisplayName, getFullName, getName, getName, setName
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 

Field Detail

function

public ptolemy.kernel.util.StringAttribute function
The function to compute a combine operation on signals. This is a string-valued attribute that defaults to "add".


input

public ptolemy.actor.TypedIOPort input
This is a multiport for input (known) signals.


output

public ptolemy.actor.TypedIOPort output
Output a signal here iff any connected input signal is known. This is a constant value of "1" indicating the presence, always.


value

public ptolemy.actor.TypedIOPort value
Output a resulting This is a constant value of "1", always.


_NONE

protected final int _NONE
See Also:
Constant Field Values

_ADD

protected final int _ADD
See Also:
Constant Field Values

_MULT

protected final int _MULT
See Also:
Constant Field Values

_MAX

protected final int _MAX
See Also:
Constant Field Values

_MIN

protected final int _MIN
See Also:
Constant Field Values

_OR

protected final int _OR
See Also:
Constant Field Values

_AND

protected final int _AND
See Also:
Constant Field Values

_CONST

protected final int _CONST
See Also:
Constant Field Values
Constructor Detail

KielerCombine

public KielerCombine(ptolemy.kernel.CompositeEntity container,
                     String name)
              throws ptolemy.kernel.util.NameDuplicationException,
                     ptolemy.kernel.util.IllegalActionException
Construct an actor with the given container and name.

Parameters:
container - The container.
name - The name of this actor.
Throws:
ptolemy.kernel.util.IllegalActionException - If the actor cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an actor with this name.
Method Detail

fire

public void fire()
          throws ptolemy.kernel.util.IllegalActionException
Collect the integer tokens of all available inputs and combine them using the combine function. Do this non-strict to take part in a fixed point iteration process.

Specified by:
fire in interface ptolemy.actor.Executable
Overrides:
fire in class ptolemy.actor.AtomicActor
Throws:
ptolemy.kernel.util.IllegalActionException - If calling send() or super.fire() throws it.

isStrict

public boolean isStrict()
This actor must be *NON-strict* because it must not wait for more than one input within an SR director iteration.

Specified by:
isStrict in interface ptolemy.actor.Executable
Overrides:
isStrict in class ptolemy.actor.AtomicActor

prefire

public boolean prefire()
                throws ptolemy.kernel.util.IllegalActionException
Specified by:
prefire in interface ptolemy.actor.Executable
Overrides:
prefire in class ptolemy.actor.AtomicActor
Throws:
ptolemy.kernel.util.IllegalActionException

postfire

public boolean postfire()
                 throws ptolemy.kernel.util.IllegalActionException
Specified by:
postfire in interface ptolemy.actor.Executable
Overrides:
postfire in class ptolemy.actor.AtomicActor
Throws:
ptolemy.kernel.util.IllegalActionException

initialize

public void initialize()
                throws ptolemy.kernel.util.IllegalActionException
Set the RailwayInterface and open a TCP connection to the Model Railway interface program w/ the given host and port parameters.

Specified by:
initialize in interface ptolemy.actor.Initializable
Overrides:
initialize in class ptolemy.actor.AtomicActor
Throws:
ptolemy.kernel.util.IllegalActionException - If the parent class throws it.

wrapup

public void wrapup()
            throws ptolemy.kernel.util.IllegalActionException
Terminate the TCP connection of the Model Railway interface. Set RI object to null so that for the next execution a new connection will be made.

Specified by:
wrapup in interface ptolemy.actor.Initializable
Overrides:
wrapup in class ptolemy.actor.AtomicActor
Throws:
ptolemy.kernel.util.IllegalActionException - Not thrown in this base class.

_updateFunction

protected int _updateFunction(int in,
                              int old)
                       throws ptolemy.kernel.util.IllegalActionException
Calculate the function on the given arguments.

Parameters:
in - The new input value. Should never be null.
old - The old result value, or null if there is none.
Returns:
The result of applying the function.
Throws:
ptolemy.kernel.util.IllegalActionException - If thrown by BooleanToken operations.

attributeChanged

public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
                      throws ptolemy.kernel.util.IllegalActionException
Override the base class to determine which function is being specified. Read the value of the function attribute and set the cached value appropriately.

Overrides:
attributeChanged in class ptolemy.kernel.util.NamedObj
Parameters:
attribute - The attribute that changed.
Throws:
ptolemy.kernel.util.IllegalActionException - If the function is not recognized.