Logo

software

data structures and software dependability

computer science department

brandenburg university of technology cottbus - senftenberg

S P I K E

latest update: October 16, 2018, at 04:50 PM


51.7678,14.3253,ff0000
BTU Cottbus
51.50920104980469,-0.09549999982118607,365ab0
(17) London; United Kingdom
51.766700744628906,14.33329963684082,3c64c3
(14) Cottbus; Germany
53.555301666259766,9.994999885559082,6383cf
(3) Hamburg; Germany
52.25,21,6383cf
(2) Warsaw; Poland
52.516700744628906,13.399999618530273,6383cf
(2) Berlin; Germany
52.160099029541016,14.555000305175781,6383cf
(2) Eisenhüttenstadt; Germany











News

  • 2018-10-08 First release for Linux & OSX is ready.
  • 2018-08-09 First news: we are here.

Downloads

General Description

Spike is a tool for efficient and reproducible simulation of stochastic/continuous/hybrid Petri net (PN) models. It is a command line tool with a set of commands and allows for executing a configuration script to run a simulation.

Features:

  • runs on: Linux, Mac, Windows (in preparation)
  • support for SBML models
  • conversion between different file formats:
    • SBML to: ANDL, PNML, ERODE
    • CANDL to: ANDL, PNML, ERODE
    • ANDL to: PNML, ERODE
    • ERODE to: ANDL, PNML
  • support for simulation: stochastic, continuous, hybrid
  • pruning of clean siphons and constant places
  • unfolding coloured net
  • human readable configuration script that allows configuring model and simulation parameters

Manuals and Tutorials

Spike has a list of commands, each with its own list of parameters, which can be executed. The commands are processed in a sequential way, This means, when the model is not in memory, the "load" command must be at the beginning of the command chain. Let's consider the following use case: model pruning and saving the pruned model to a file:

spike load -f fileName prune -cs save -f prunedFileName

First, we told Spike to load the model from a file into the memory, then to prune clean siphons, and at the end to save the pruned model to the given file.


List of commands:

  • help
    • -c [command] - display help for a given command
  • version - display the version of Spike
  • load - load a model from a file (ANDL, CANDL, SBML, PNML, ERODE)
    • -f [fileName] - load a file from a given path
    • -a - add scaling factors for massaction kinetics
    • -net [CPN | SPN] - load SBML as continuous or stochastic PN
    • -r - load SBML with reversible reactions
    • -b - load SBML with boundary conditions
  • save - save the model to a file
    • -f [fileName] - save a file to a given path (ANDL, CANDL, PNML, ERODE)
    • -erode [SMB | FE | BE] - while saving ERODE file extend it by a given reduction method
  • prune - pruning of clean siphons and constant places
    • -cs - prune clean siphons
    • -lcs [fileName] - load clean siphons from the file and prune
    • -scs [fileName] - save clean siphons to a file
    • -cp - prune constant places
    • -lcp [fileName] - load constant places from the file and prune
    • -scp [fileName] - save constant places to the file
  • unfold - unfold coloured net
    • -e - evaluate value expressions (tokens, multiplicity)
    • -c [constantName=value,...] - specifying new values for existing constants
  • eval - evaluation of constants and places
    • -p - evaluate places
    • -c - evaluate constants
  • exe - execute configuration script
    • -f [fileName] - load a file from a given path

Configuration script

To comply with the demand for reproducible simulation experiments, Spike is supported by a script which allows for model and simulation configuration. The structure of the script is easily readable for a user and does not require any special tools for editing: a simple text editor is enough. The following example contains almost all possible use cases, supported so far.

// - line comment
/* 
   - block comment
*/

// Import - exactly one model
import: {
    from: "path/to/file.andl"
    sbml: {
        net: "CPN"
        boundary: false
        reversible: false
    }
    as: "ModelName" // optional - If not present or empty try to get name from model
    checksum: a5s7w6e7w // optional – for checking version of the model !!! Not in use yet !!!
}
configuration: {
    // configuration of the model
    model: {
        // name: "confModel1"// name of configuration !!! Not in use yet !!!

        // set constants (for coloured models - before unfolding)
        constants: {
            all: { // name of a group
                C01: 2 // constantName:value
                // if constant does not exists then it’ll be created and can be used in configuration e.g. defining place markings
                M: "D/2 + 1" 
            }
        }
        // set markings (for coloured models - before unfolding)
        places: {
            place1: 1 //placeName:value
            P: "1000`(M,M)" // example of use of newly created constant
            P_2_2: 500
        }

        observers: {
            place: {
                OP01: {
                    function: "P_1_1 + P_2_3"
                }
                // override (if observer is already defined in andl file then override its value)
                OP1: {
                    "function": "(P_1_1 + P_2_3) / 2"
                }
            }
            transition: {
                OT01: {
                    function: "t3_1_1_1_2 / 4"
                }
            }
            // defining observers which can observe mixed values
            mixed: {
                M01: {
                    function: "t3_1_1_1_2 + P_1_1" // transition + place
                }
                M02: {
                    function: "P2  + M" // place + constant
                }
            }  
        }
    }
    // configuration of the simulation SIM01
    simulation : {
        name: "SIM01" // Name of the simulation
        type: continuous // [continuous, stochastic, hybrid]
        solver: BDF // [BDF, classic, direct, delta-leaping, static, staticAcc]
        threads: 1 // 0 - try to get the number of concurrent threads supported by the hardware
        interval: 1:1:1000// start:step:end (startTimePoint:intervalSize:endTimePoint)
        // runs: 1000000 // Applicable only for stochastic simulation
        // configuration for continues simulation
        iniStep: 0.1
        linSolver: CVDense //[CVDense, CVSpgmr, CVDiag, CVSpbcg, and CVSptfqmr]
        relTol: 1.0e-5
        absTol: 1.0e-10

        // Export results to the file
        export: {
            // Array of places to save, including coloured places like P in this example (if empty export all)
            places: ["P_1_1", "OP01", "Grid.*", "D", "P"]
            // Array of transitions to save, including coloured transitions (if empty export all)
            transitions: ["t3_1_1_1_2", "t3", "t3" ]
            observers: ["M01", "OT01"] // Array of observers to save (if empty export all)
            to: "sim01-file01.csv"
        }
        export: {
            places: ["P2", "P", "P_2_2"]
            places: ["P2", "P_1_1", "P"]
            transitions: ["t3"]
            observers: ["M01", "M02"]
            to: "sim01-file02 .csv"
        }
        export: {
            places: ["P_1_.*","P_2_.*","P_3_.*"] // Array of places to save (if empty export all)
            to: "sim01-file03.csv"        
        }
    }

    // the next simulation will start when previous will end, in the future this behaviour will change
    // configuration of the simulation SIM02 
    simulation : {
        name: "SIM02" // Name of the simulation
        type: stochastic // [continuous, stochastic, hybrid]
        solver: direct // [BDF, classic, direct, delta-leaping, static, staticAcc]
        threads: 100 // 0 - try to get the number of concurrent threads supported by the hardware
        interval: 1:1:1000// start:step:end (startTimePoint:intervalSize:endTimePoint)
        runs: 1000000 // Applicable only for stochastic simulation

        // Export results to the file
        export: {
            // Array of places to save, including coloured places like P in this example (if empty export all)
            places: ["P_1_1", "OP01", "Grid.*", "D", "P"]
            // Array of transitions to save, including coloured transitions (if empty export all)
            transitions: ["t3_1_1_1_2", "t3", "t3" ]
            observers: ["M01", "OT01"] // Array of observers to save (if empty export all)
            to: "sim02-file01.csv"
        }
        export: {
            places: ["P2", "P", "P_2_2"]
            places: ["P2", "P_1_1", "P"]
            transitions: ["t3"]
            observers: ["M01", "M02"]
            to: "sim02-file02 .csv"
        }
        export: {
            places: ["P_1_.*","P_2_.*","P_3_.*"] // Array of places to save (if empty export all)
            to: "sim02-file03.csv"        
        }
    }

}

Finally, the command to run simulation controlled by the configuration script:

spike exe -f path/to/the/fileName

Related Papers

  • [CH18]
    J Chodak and M Heiner:
    Spike - a command line tool for continuous, stochastic & hybrid simulation of (coloured) Petri nets;
    In Proc. 21th German Workshop on Algorithms and Tools for Petri Nets (AWPN 2018), University of Augsburg, pages 1-6, October 2018. [ url ] [ pdf ] [ BibTeX ]
  • [CH18.sld]
    J Chodak and M Heiner:
    Spike - a command line tool for continuous, stochastic & hybrid simulation of (coloured) Petri nets;
    Talk, AWPN2018, University of Augsburg, October 2018. [ pdf ] [ BibTeX ]

Related Tools

Bug Reports

Submit your bug reports and comments about Spike to jacek [period] chodak [snail] b-tu [period] de

… the end …

Any comments or questions are welcome. Please direct them to monika [period] heiner [snail] b-tu [period] de Privacy Policy