Giter Site home page Giter Site logo

kagera's Introduction

Kagera: A discrete, colored Petri Net DSL and executor.

The credits for this library go to @merlijn. I've merely forked the library back in the day when we started Baker together. It now seems that Merlijn removed it from his own GitHub account.

Example of a simple colored Petri net with functions acting on the data in the tokens.

val sum = {

    // places
    val a = Place[Int](id = 1, label = "a")
    val b = Place[Int](id = 2, label = "b")
    val c = Place[Int](id = 3, label = "result")

    // transitions
    val init = Transition(id = 1, label = "init") {
      () ⇒ (5, 5)
    }

    val sum = Transition(id = 2, label = "sum") {
      (a: Int, b: Int) ⇒ a + b
    }

    // process topology
    process(
      init    ~> %(a, b),
      %(a, b) ~> sum,
      sum     ~> c)
  }

Transition Model

Transition Model

Input:

  • M is the in-adjacent marking of the transition.
  • S is the type of state the transition closes over, Unit indicates no state.
  • I Is the type of input the transition requires (provided from outside the process), Unit indicates case no input is required.

Output:

  • M' is the out-adjacent marking of the transition.
  • E Is the type of event or output the transition emits. Unit indicates no event / output.

The transition's behaviour is defined by 2 functions

  1. (M, I, S) => (M', E) A function producing the out-adjacent marking and event from in-adjancent marking, state and input.
  2. S => E => S An event sourcing function which updates the state using the emitted event / output object.

Roadmap

Short term:

  • HTTP API (using Akka HTTP)
  • Clustering & Sharding
  • Analysis (using Apache Spark or Apache Flink), some examples:
    • Path querying
    • Path prediction
    • Transition timing

Long term:

  • Hierarchical petri nets
  • Timed petri nets
  • Other execution models, such as:
  • Process migration
    • Providing tools to migrate process state when the petri net topology changes.
  • Visual process editor

kagera's People

Contributors

merlijn avatar nikolakasev avatar nightscape avatar adilakhter avatar transducer avatar

Watchers

James Cloos 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.