Skip to content

Swing Plotter

tomvej edited this page Jul 23, 2012 · 2 revisions

Description

This extension provides a simple means of plotting a result of verification processs.

Maven dependency

Include in pom.xml.

<dependency>
    <groupId>org.sybila.parasim.extension</groupId>
    <artifactId>visualisation-plot-impl</artifactId>
    <version>${parasim.version}</version>
</dependency>

Usage

This extensions provides two classes: PlotterFactory, which generates Plotter for individual verification results (as of VerificationResult class). The key method is Plotter.plot which creates a window containing plotted result. This window runs in an independent thread, which terminates when the window is closed.

To create a plotter, you need a VerificationResult and a PointVariableMapping, which may be obtained from OdeSystem.

import org.sybila.parasim.core.Manager;
import org.sybila.parasim.core.annotations.Any;
import org.sybila.parasim.model.ode.OdeVariableMapping
import org.sybila.parasim.model.ode.PointVariableMapping;
import org.sybila.parasim.model.verification.result.VerificationResult;
import org.sybila.parasim.visualisation.plot.api.PlotterFactory;
import org.sybila.parasim.visualisation.plot.api.Plotter;
import org.sybila.parasim.visualisation.plot.api.annotations.Strict;

/* ... */

public static void plotResult(Manager manager, VerificationResult result, OdeSystem system) {
    PointVariableMapping mapping = new OdeVariableMapping(system); //get variable mapping from ODE system
    PlotterFactory factory = manager.resolve(PlotterFactory.class, Strict.class, manager.getRootContext);
    Plotter plotter = factory.getPlotter(result, mapping);
    plotter.plot();
}

Configuration

Property Type Meaning
plotterWindowWidth int Width of plotter window
plotterWindowHeight int Height of plotter window
statusFontSize int Font size of status bar
statusDecimalDigits int Number of decimal digits shown in status bar
showGuides boolean Whether to show guides connecting mouse pointer in plot with rules
guidesColor Color Color of guides (see above)
pointColorValid Color Color of valid points (positive robustness)
pointColorInvalid Color Color of invalid points (negative robustness)
pointRadius float Size of points
flatDimensionPadding float Amount of padding received by a flat dimension
minimumDifference float Minimal discernable difference between two floats
ruleWidth int Width of vertical rule
ruleHeight int Height of horizontal rule
ruleTickSpacing int Spacing between ticks on a rule
ruleTickRatio int Number of spaces between big ticks
ruleBigTick int Length of big tick
ruleSmallTick int Length of small tick
ruleDecimalDigits int Number of decimal digits displayed in labels