Ptolemy II

Ptolemy II Planet


  1. Development Version - Source code and installers, updated nightly
  2. Ptolemy II 11.0 - Source code and installers, updated on June 19, 2018

Ptolemy II [1][6] is an open-source software framework supporting experimentation with actor-oriented design. Actors are software components that execute concurrently and communicate through messages sent via interconnected ports. A model is a hierarchical interconnection of actors. In Ptolemy II, the semantics of a model is not determined by the framework, but rather by a software component in the model called a director, which implements a model of computation. The Ptolemy Project has developed directors supporting process networks (PN), discrete-events (DE), dataflow (SDF), synchronous/reactive(SR), rendezvous-based models, 3-D visualization, and continuous-time models. Each level of the hierarchy in a model can have its own director, and distinct directors can be composed hierarchically. A major emphasis of the project has been on understanding the heterogeneous combinations of models of computation realized by these directors. Directors can be combined hierarchically with state machines to make modal models [2]. A hierarchical combination of continuous-time models with state machines yields hybrid systems [3]; a combination of synchronous/reactive with state machines yields StateCharts [4] (the Ptolemy II variant is close to SyncCharts).

Ptolemy II has been under development since 1996; it is a successor to Ptolemy Classic, which was developed since 1990. The core of Ptolemy II is a collection of Java classes and packages, layered to provide increasingly specific capabilities. The kernel supports an abstract syntax, a hierarchical structure of entities with ports and interconnections. A graphical editor called Vergil supports visual editing of this abstract syntax. An XML concrete syntax called MoML provides a persistent file format for the models[5]. Various specialized tools have been created from this framework, including HyVisual (for hybrid systems modeling), Kepler (for scientific workflows), VisualSense (for modeling and simulation of wireless networks), Viptos (for sensor network design), and some commercial products. Key parts of the infrastructure include an actor abstract semantics, which enables the interoperability of distinct models of computation with a well-defined semantics; a model of time (specifically, super-dense time, which enables interaction of continuous dynamics and imperative logic); and a sophisticated type system supporting type checking, type inference, and polymorphism. The type system has recently been extended to support user-defined ontologies [6]. Various experiments with synthesis of implementation code and abstractions for verification are included in the project.

Current work in Ptolemy II is focusing on Accessors, which are a technology for making the Internet of Things accessible to a broader community of citizens, inventors, and service providers through open interfaces, an open community of developers, and an open repository of technology. Ptolemy II includes the Cape Code Accessor Host [7].

Ptolemy is being used as the execution engine in Eclipse Triquetrum[8].


[1] Johan Eker, Jorn Janneck, Edward A. Lee, Jie Liu, Xiaojun Liu, Jozsef Ludvig, Sonia Sachs, Yuhong Xiong. Taming heterogeneity - the Ptolemy approach, Proceedings of the IEEE, 91(1):127-144, January 2003.
(Key citation for the Ptolemy project)

[2] Edward A. Lee. Finite State Machines and Modal Models in Ptolemy II, Technical report, EECS Department, University of California, Berkeley, UCB/EECS-2009-151, December, 2009.

[3] E. A. Lee and H. Zheng, "Operational Semantics of Hybrid Systems," Invited paper in Proceedings of Hybrid Systems: Computation and Control (HSCC) LNCS 3414, Zurich, Switzerland, March 9-11, 2005, pp.25-53.

[4] E. A. Lee, H. Zheng, "Leveraging Synchronous Language Principles for Heterogeneous Modeling and Design of Embedded Systems," EMSOFT '07, September 30 - October 3, 2007, Salzburg, Austria.

[6] Christopher Brooks, Edward A. Lee. Ptolemy II: An open-source platform for experimenting with actor-oriented design, 11 February, 2016; Poster presented at the 2016 Berkeley EECS Annual Research Symposium (BEARS).

[6] M.-K. Leung, T. Mandl, E. A. Lee, E. Latronico, C. Shelton, S. Tripakis, and B. Lickly, "Scalable Semantic Annotation using Lattice-based Ontologies," ACM/IEEE 12th International Conference on Model Driven Engineering Languages and Systems (MODELS), Denver, CO, USA, 4-9 October, 2009.

[7] Elizabeth Latronico, Edward A. Lee, Marten Lohstroh, Chris Shaver, Armin Wasicek, Matt Weber. A Vision of Swarmlets, IEEE Internet Computing, Special Issue on Building Internet of Things Software, 19(2):20-29, March 2015. See also Accessors Publications.

[8] Christopher Brooks, Erwin De Ley. Triquetrum: Models of Computation for Workflows, Talk or presentation, 8, March, 2016; Presented at EclipseCon NA 2016, Reston, VA.


The Ptolemy Project web page contains much more information about the project. The work is conducted in the Department of Electrical Engineering and Computer Sciences of the University of California at Berkeley. The project is directed by Prof. Edward Lee. The project is named after Claudius Ptolemaeus, the second century Greek astronomer, mathematician, and geographer.

The Ptolemy project has a long history of folding in software contributions from off site developers, see the Ptolemy II FAQ for details.

Openhub's third-party assessment of the Ptolemy II, as of August, 2019, says about Ptolemy II:

  1. has had 74,846 commits made by 208 contributors representing 4,001,635 lines of code
  2. is mostly written in Java with a well-commented source code
  3. has a well established, mature codebase maintained by a large development team with decreasing Y-O-Y commits
  4. took an estimated 1,174 years of effort (COCOMO model) starting with its first commit in December, 1996 ending with its most recent commit 4 days ago

Recent Releases and News

The Ptolemy II development sources are always available via Git.

The nightly build includes links to installers, though we encourage people to build from the source repository.

Ptolemy II 11.0.1 was made available on June 18, 2018. See the Ptolemy II 11.0 page for details about new features.

Ptolemy II 10.0.1 was made available on December 17, 2014.

Ptolemy II 10.0 is the first complete release since Ptolemy II 8.0 and thus includes many changes.

The key driving force for the release is to be a companion to the Ptolemy Book:
Claudius Ptolemaeus, Editor, "System Design, Modeling, and Simulation Using Ptolemy II",, 2014. (included in the release as $PTII/doc/books/systems/PtolemyII_DigitalV1_02.pdf, but not present in the SVN developer tree.)

Below are the highlights of this release.


The Ptolemy II Ontologies package extends the Ptolemy II type inference engine to provide an efficient and scalable framework for general static analysis of arbitrary properties on a Ptolemy model. The framework supports properties that are specified as concepts in an ontology graph that must be structured as a lattice. The usefulness of this framework is demonstrated with an example of a physical dimensions ontology. This ontology labels different signals as representing acceleration, velocity, position, and time. In a Ptolemy model of physical dynamics, the dimensional properties of input and output signals can be automatically inferred using the ontology analysis. Ptolemy model developers can use the ontologies package to define their own ontologies for structural and semantic property analysis. This can prevent interface connection problems during model construction by identifying when incompatible signals are erroneously connected. This work draws on concepts from compiler optimization static analysis techniques and applies them to Ptolemy actor-oriented models.

Export to Web

Ptolemy II includes a flexible mechanism for creating web pages from models and for building web services. The more basic mechanism is the export to web , which simply makes a model available as a web page for browsing using a web browser. Such a web page provides easy access and documentation for models that archives both the structure of the models and the results of executing the models. It can be used to share information about models or their execution without requiring installation of any software, since an ordinary web browser is sufficient. More interestingly, the mechanism is extensible and customizable, allowing for creation of fairly sophisticated web pages. You can associate hyperlinks or actions defined in JavaScript with icons in a model. The customization can be done for individual icons in a model or for sets of icons in a model.

CG Code Generator

Ptolemy II 10.0 includes the "cg" code generator at $PTII/ptolemy/cg.

We took the lessons learned from $PTII/ptolemy/codegen and applied them to cg. In particular, cg more easily supports multiple backends with less code duplication. The cg code generator is under active development, we are working on code generation for large systems. For details about cg, see $PTII/ptolemy/cg/README.html.

FSM/Modal Model updates

See Ptolemy II 10.0 for a complete list of features.

Ptolemy II 8.0.1 was made available on October 28, 2010
Ptolemy II 8.0.1 includes the following major new work since the previous release:

  • Model Transformation - The model transformation facility provides a framework for the analysis and transformation of actor models using model transformation techniques. (Thomas Huining Feng)
  • Ptera (Ptolemy Event Relationship Actor) Domain - The Ptera (Ptolemy Event Relationship Actor) domain is a discrete-event model of computation. A model in Ptera is represented with a graph of nodes and edges, where nodes represent events and directed edges between events represent scheduling relation. One or more events can be selected as initial events, which are scheduled at model time 0.0. When an event is fired, it possibly performs certain actions, and if there are outgoing edges from that event, the events at the end points of those edges are scheduled after non-negative delays. One or more events can also be selected as final events. The firing of final events causes the event queue to be emptied after their actions are performed, and therefore no more events can be processed. (Thomas Huining Feng)
  • Causality Analysis - Ptolemy II 8.0 includes an update to our Causality Analysis framework. We identified performance problems with our current non-conservative causality analysis for modal models within discrete-event (DE) systems. In this scheme, causality analysis is performed on the entire model at run time each time there is a mode change in the model. This mechanism is far too costly. We are investigating techniques for performing the causality analysis in a compositional way for the various modes at compile time. Unfortunately, brute force solutions result in exponentially growing memory requirements for the results of the causality analysis.

    We designed, implemented and reviewed an interface that defines a causality interfaces for actor networks as described in the paper Ye Zhou, Edward A. Lee. Causality Interfaces for Actor Networks, ACM Transactions on Embedded Computing Systems (TECS), 7(3):1-35, April 2008.
    (Ye Zhou, Edward A. Lee)

  • Continuous and Modal Domains

    Ptolemy II 8.0 includes a substantial rework of modal models and the underlying finite state machine infrastructure to make them work predictably and consistently across domains. (Haiyang Zheng, Edward A. Lee)

  • Ptolemy II 8.0.beta was made available on February 26, 2010

    Ptolemy II 7.0.1 was made available on April 4, 2008.
    Ptolemy II 7.0.1 includes

  • Ptolemy II C Code Generation
    The Ptolemy C Code generator can generate code for SDF, FSM and HDF models. Arbitrary C code may be embedded in a Java actor. The entire model can then be converted to C code and the C code with the Java actor is used.
    Primary Codegen Developers: Gang Zhou, Man-kit Leung.
    Codegen Contributors: Christopher Brooks, Teale Fristoe, Edward A. Lee, Ye Zhou
  • Ptalon
    Primary Ptalon Developer: Adam Cataldo
    Contributor: Elaine Cheong
    Actor-oriented design is a common design strategy in embedded system design, where actors are concurrent components which communicate through ports by sending signals to one another. Such systems are frequently modeled with block diagrams, where the blocks represent systems and lines or arrows between blocks represent signals. Examples include Simulink, LabView, and VHDL/Verilog. A common problem in such environments is managing complexity, particularly when the designs become large. Most actor-oriented design environments allow hierarchy, or systems (blocks) which are composed of other systems (blocks). To take this a step further, we are developing the Ptalon programming language, which allows users to parameterize components with other components.
  • Backtracking
    Primary Backtracking Developer: Thomas Huining Feng
    A backtracking facility enables the system to restore its old state. It has many applications in practice, and is especially important to high-performance distributed computation.
  • Continuous domain:
    Primary Continuous Domain Developers: Haiyang Zheng, Edward A. Lee
    The Continuous Domain is a redesign of the Continuous Time (CT) domain with a rigorous semantics.
  • Ptolemy II 7.0.beta was made available on February 7, 2008

    Ptolemy II 6.0.2 was made available on February 4, 2007
    Ptolemy II 6.0 includes

  • Ptolemy II C Code Generation

    Primary Developers: Jackie Leung, Gang Zhou, Ye Zhou, Edward A. Lee, Christopher Brooks
    Ptolemy II can now generate C code for SDF, FSM and HDF models. This new code generator consists of actor templates (called helpers) that contain C code stubs that are stitched together. Only a subset of actors have helpers, so only a subset of models can be converted to C. Creating new helpers is fairly easy though. The code generator has been written to be easily extensible to languages other than C.

  • The Rendezvous domain:
    Primary Authors: Thomas Huining Feng, Edward A. Lee
    In the Rendezvous domain in Ptolemy II, each actor executes in its own thread of control, and communication between actors is by rendezvous. If an actor is ready to send a message, it blocks until the receiving actor is ready to receive it. Similarly if an actor is ready to receive a message, it blocks until the sending actor is ready to send it.

    This domain supports both conditional and multi-way rendezvous. In conditional rendezvous, an actor is willing to rendezvous with any one of several other actors. In multiway rendezvous, an actor requires rendezvous with multiple other actors at the same time. When using conditional rendezvous, the choice of which rendezvous occurs is nondeterministic, in general.

    The model of computation is based on the Communicating Sequential Processesmodel first proposed by Hoare in 1978. Rendezvous-based communication is also known as synchronous message passing, but we avoid this term to avoid confusion with the SR (synchronous/reactive) domain.

  • Viptos Visual editor, code generator, and simulator for TinyOS programs.
    Primary Author: Elaine Cheong
    Viptos is an interface between TinyOS and Ptolemy II that provides a graphical user interface for TinyOS developers. Users can create TinyOS programs as block diagrams and use Viptos to generate code for any TinyOS-supported target hardware. Users can also simulate heterogenous networks of TinyOS-based nodes within Viptos. Viptos includes a tool to make existing libraries of TinyOS/nesC components available as graphical blocks (nc2moml), and another tool to transform existing TinyOS/nesC applications into Viptos models (ncapp2moml).
    Note: Viptos is not available in the Windows installer, Viptos must be built from source. (Viptos Installation Notes)

  • Distributed SDF Domain using Jini
    Authors: Daniel Lazaro Cuadrado (Aalborg University).
    The Distributed-SDF domain is an extended version of the existing SDF Domain that performs the simulation in a distributed manner using Jini. The Ptolemy II 6.0.2 Release Notes include a list of new features and actors.
  • Ptolemy II 6.0.1 was made available on January 15, 2006.

    Ptolemy II 6.0.beta was made available on October 31, 2006.

    Viptos 1.0.beta was released on October 30, 2006. Viptos is an interface between TinyOS and Ptolemy II.
    TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM). TinyOS, is used, for example, on the Berkeley MICA motes, which are small wireless sensor nodes.
    The Viptos1.0.beta release is a source only release that works under Linux and Windows.

    Ptolemy II 6.0.alpha was made available on October 2, 2006.

    Viptos 5.1-alpha was released on November 1, 2005. Viptos is an interface between TinyOS and Ptolemy II.
    TinyOS is an event-driven operating system designed for sensor network nodes that have very limited resources (e.g., 8K bytes of program memory, 512 bytes of RAM). TinyOS, is used, for example, on the Berkeley MICA motes, which are small wireless sensor nodes.
    The Viptos5.1-alpha release is a source only release that works under Linux only. Under Windows, Viptos will not run TinyOS models, though the models are viewable.

    HyVisual 5.0.1 was released on October 7, 2005.
    This release fixes a few bugs in the 5.0 release and includes a standalone HyVisual-5.0.1 installer.

    Ptolemy II 5.0.1 was made available on October 5, 2005.
    This is a bug fix release only, no new features were added.
    See the Ptolemy II 5.0.1 page for details.

    Ptolemy II 5.0 was made available on July 21, 2005
    Ptolemy II 5.0 includes

  • A Dynamic Dataflow (DDF) domain, in which actors are fired in response to available input data.
  • Modeling of Hybrid systems. Hybrid systems are a special case of modal models where finite-state machines (FSMs) are combined with the continuous-time (CT) models to get mixed continuous-time and discrete-event models.
  • Stochastic hybrid systems, which add random behavior to continuous-time models mixed with discrete events.
  • Heterochronous Dataflow (HDF), which is an extension of synchronous dataflow (SDF) that permits dynamically changing production and consumption patterns without sacrificing static scheduling.
  • HyVisual 5.0-alpha was made available on March 4, 2005
    HyVisual is a Hybrid Systems Visual Modeler based on Ptolemy II.
    The semantics of the Discrete Event and Continuous Time domains have changed slightly between HyVisual-4.0.2 and HyVisual 5.0-alpha.
    The semantics of HyVisual are described in the following paper:

    Edward A. Lee and Haiyang Zheng, " Operational Semantics of Hybrid Systems," Invited paper in Proceedings of Hybrid Systems: Computation and Control (HSCC) LNCS 3414, Zurich, Switzerland, March 9-11, 2005.

    Ptolemy II 4.0.1 was made available on August 4, 2004
    Ptolemy II 4.0.1 includes

  • Modeling for wireless sensor networks
  • Hierarchical classes, subclasses and inner classes
  • Lifecycle management actors, which are actors that control the execution of associated models. This example uses one model to control repeated runs of another.
  • VisualSense 4.0.1 was made available on August 4, 2004
    VisualSense is a visual editor and simulator for wireless sensor network systems.

    Older Releases

    HyVisual 4.0.2 was made available on October 28, 2004.
    HyVisual is a Hybrid Systems Visual Modeler based on Ptolemy II.

    Ptolemy II 3.0.2 was made available on August 21, 2003.

    Ptolemy II 3.0 includes a HSIF to Ptolemy converter, the expression language has been reworked and the code generator updated. It also includes a set of mature and experimental domains, and a more comprehensive actor library than previous releases.

    HyVisual 2.2 was made available on January 28, 2003. HyVisual is a Hybrid Systems Visual Modeler based on Ptolemy II.

    Ptolemy II 2.0.1 was made available on August 7, 2002

    Other recent news about Ptolemy II can be found on the Projects page.

    Ptolemy II 2.0.1 was the first release that includes a limited prototype of our code generation facility that will generate class files for non-hierarchical SDF models. This release also includes support for modal models, a Timed Multitasking domain and a Synchronous reactive domain.

    The release is available in several formats, see the Ptolemy II 2.0.1 page.

    Ptolemy II 1.0.1 was made available on March 19, 2001.

    Ptolemy II 1.0.1 was the first major release to include Vergil, a graphical user interface supporting block diagram editing of Ptolemy II models. It also includes a set of mature and experimental domains, and a more comprehensive actor library than previous releases. Ptolemy II 1.0.1 supports an XML schema called MoML for specifying component-based models.

    The release consists of on-line demonstrations and downloads.

    Ptolemy II 0.4beta was made available on February 7, 2000. Ptolemy II 0.4beta was the second Ptolemy II release to include domains, actors, and applets of sufficient quality and architectural stability to use as models for development. The domain-polymorphic actor libraries, in the and packages are still small, but reasonably solid.

    Ptolemy II 0.4beta supports an XML language called MoML for specifying component-based models. Chapter 2 of the Ptolemy II Design Document describes how to use MoML to create models.

    The release consists of on-line demonstrations and downloads.

    Ptolemy II 0.3 was made available on August 2, 1999. This release consists of domains, actors and applets to use as models for development and extensive documentation.

    The demonstrations that we ran during the 1999 Ptolemy Miniconference, are available online.

    The Ptolemy II 0.2devel snapshot release we used for the demonstrations is also available for downloading.