Chapter 2. Writing Stars for Simulation
2.1 Introduction
2.2 Adding stars dynamically to Ptolemy
2.3 The Ptolemy preprocessor language (ptlang)
2.3.1 Invoking the preprocessor
2.3.2 An example
2.3.3 Items that appear in a defstar
name
domain
derivedfrom
descriptor
version
author
acknowledge
copyright
location
explanation
htmldoc
state
input, output, inout, inmulti, outmulti, inoutmulti
constructor
conscalls
destructor
setup
begin
go
wrapup
public, protected, private
ccinclude, hinclude
code
header
method
exectime
codeblock
2.4 Writing C++ code for stars
2.4.1 The structure of a Ptolemy star
2.4.2 Reading inputs and writing outputs
PortHoles and Particles
SDF PortHole parameters
Multiple PortHoles
Type conversion
2.4.3 States
2.4.4 Array States
2.5 Modifying PortHoles and States in Derived Classes
2.6 Programming examples
2.7 Preventing Memory Leaks in C++ Code
Authors: Joseph T. Buck
Soonhoi Ha
Edward A. Lee
Other Contributors: Most of the Ptolemy team
Copyright © 1990-1997, University of California. All rights reserved.