Code Monkey home page Code Monkey logo

uppaal-latex's Introduction

Uppaal Style for LaTeX

LaTeX package to typeset Uppaal timed automata specifications.

The style depends on listings.sty, xcolor.sty and xspace.sty.

Inline Examples

Properties in a table:

Properties in uppaalcode

Timed automata labels:

Inline uppaalcode

Listing Examples

Minimal uppaalcode environment:

Minimal uppaalcode

Customized using lstlisting options:

Customized uppaalcode

Instructions

  1. Make sure that listings, xcolor and xspace are installed. In Linux distributions this is usually found in texlive-latex-recommended (sudo apt-get install texlive-latex-recommended).

  2. Make sure that the font beramono is installed (usually ships as fvm* files with texlive-font-extra)

  3. Download uppaal.sty from releases and put it into your LaTeX project directory.

  4. Add \usepackage{uppaal} to your main .tex file.

  5. Embed Uppaal code into your .tex files, like:

\begin{uppaalcode}[caption={Updates velocity and position.},label={lst:updatecode}]
int lIZERO = 0;   // note the characters l, I, 0 and O
int distance = 5; // approximated distance between cars
int velocityEgo, velocityFront; /* approximated velocities */
int accelerationEgo, accelerationFront; /** acceleration */
void updateDiscrete() {
    int newVel, oldVel = velocityFront - velocityEgo;
    velocityEgo = velocityEgo + accelerationEgo;
    velocityFront = velocityFront + accelerationFront;
    newVel = velocityFront - velocityEgo;
    if (distance > maxSensorDistance) {
        distance = maxSensorDistance + 1;
    } else { // $d \approx \sum_i \frac{v_i+v_{i+1}}{2}\Delta t$
        distance += (oldVel + newVel)/2;
    }
}
\end{uppaalcode}

See manual.pdf from releases for more details on how to customize.

uppaal-latex's People

Contributors

gordin508 avatar mikucionisaau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.