ptolemy.codegen.c.actor.lib
Class Gaussian

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.codegen.kernel.CodeGeneratorHelper
          extended by ptolemy.codegen.c.kernel.CCodeGeneratorHelper
              extended by ptolemy.codegen.c.actor.lib.RandomSource
                  extended by ptolemy.codegen.c.actor.lib.Gaussian
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, ActorCodeGenerator, ComponentCodeGenerator, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

public class Gaussian
extends RandomSource

A helper class for ptolemy.actor.lib.Gaussian.

Since:
Ptolemy II 6.0
Version:
$Id: Gaussian.java 46972 2007-10-02 17:16:38Z cxh $
Author:
Man-Kit Leung
See Also:
Serialized Form
Accepted Rating:
Green (mankit)
Proposed Rating:
Green (mankit)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
CodeGeneratorHelper.Channel, CodeGeneratorHelper.VariableScope
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
_codeGenerator, _codeStream, _eol, _INDENT1, _INDENT2, _parseTreeCodeGenerator, _portConversions, _referencedParameters
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
Gaussian(Gaussian actor)
          Construct a Gaussian helper.
 
Method Summary
protected  java.lang.String _generateRandomNumber()
          Generate code for producing a new random number.
 java.util.Set getHeaderFiles()
          Get the files needed by the code generated for the Gaussian actor.
 java.util.Set getSharedCode()
          Generate shared code.
 
Methods inherited from class ptolemy.codegen.c.actor.lib.RandomSource
_generateFireCode, generateInitializeCode
 
Methods inherited from class ptolemy.codegen.c.kernel.CCodeGeneratorHelper
_generateInputVariableDeclaration, _generateOutputVariableDeclaration, _generateReferencedParameterDeclaration, _generateTypeConvertStatement, _generateTypeConvertVariableDeclaration, _getFireFunctionArguments, _replaceMacro, generateVariableDeclaration, getCodeGenerator, getJVMHeaderFiles, getParseTreeCodeGenerator
 
Methods inherited from class ptolemy.codegen.kernel.CodeGeneratorHelper
_createBufferSizeAndOffsetMap, _createInputBufferSizeAndOffsetMap, _findClosedParen, _generateBlockCode, _generateBlockCode, _generateTypeConvertMethod, _generateTypeConvertStatements, _getCastType, _getChannelAndOffset, _getHelper, _getHelper, _getIndentPrefix, _getReference, _getReferenceChannels, _getTypeConvertChannels, _getTypeConvertReference, _indexOf, addFunctionUsed, addNewTypeUsed, analyzeTypeConvert, checkLocal, checkRemote, codeGenType, copyFilesToCodeDirectory, createOffsetVariablesIfNeeded, generateChannelOffset, generateFireCode, generateFireFunctionCode, generateFireFunctionCode2, generateModeTransitionCode, generateName, generateOffset, generatePortReference, generatePostfireCode, generatePrefireCode, generatePreinitializeCode, generateSimpleName, generateTypeConvertFireCode, generateTypeConvertFireCode, generateVariableInitialization, generateVariableName, generateWrapupCode, getBufferSize, getBufferSize, getComponent, getDefaultBlocks, getDirector, getDirectorHelper, getFunctionInvocation, getIncludeDirectories, getLibraries, getLibraryDirectories, getModifiedVariables, getNewInvocation, getObject, getParameterValue, getPort, getRates, getReadOffset, getReference, getReference, getReference, getReference, getSinkChannels, getSize, getSourceChannel, getWCET, getWriteOffset, isPrimitive, isPrimitive, parseList, processCode, resetInputPortsOffset, setBufferSize, setCodeGenerator, setReadOffset, setWriteOffset, targetType, toString
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getContainedObject, _isMoMLSuppressed, _markContentsDerived, _propagateExistence, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getContainer, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setName, setPersistent, setSource, sortContainedObjects, toplevel, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gaussian

public Gaussian(Gaussian actor)
Construct a Gaussian helper.

Parameters:
actor - the associated actor
Method Detail

getSharedCode

public java.util.Set getSharedCode()
                            throws IllegalActionException
Generate shared code. Read from Gaussian.c, replace macros with their values and return the processed code string.

Specified by:
getSharedCode in interface ActorCodeGenerator
Overrides:
getSharedCode in class CodeGeneratorHelper
Returns:
The processed code string.
Throws:
IllegalActionException - If the code stream encounters an error in processing the specified code block(s).

getHeaderFiles

public java.util.Set getHeaderFiles()
                             throws IllegalActionException
Get the files needed by the code generated for the Gaussian actor.

Specified by:
getHeaderFiles in interface ActorCodeGenerator
Overrides:
getHeaderFiles in class RandomSource
Returns:
A set of Strings that are names of the files needed by the code generated for the Gaussian actor.
Throws:
IllegalActionException - Not Thrown in this subclass.

_generateRandomNumber

protected java.lang.String _generateRandomNumber()
                                          throws IllegalActionException
Generate code for producing a new random number.

Specified by:
_generateRandomNumber in class RandomSource
Returns:
The code that produces a new random number.
Throws:
IllegalActionException - Not thrown in this base class.