Skip to content

A web-based simulator for Generalized Stochastic Petri Nets (GSPNs) using React and React Flow. Supports net creation, stochastic firing simulation, marking and tangible marking graph generation, and analysis of properties like boundedness, liveness, reachability, and deadlocks.

License

Notifications You must be signed in to change notification settings

ChakerChourouk/PetriGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PetriGo

PetriGo is a web application for modeling, simulating, and analyzing Petri Nets. It combines an intuitive React-based interface with a robust JavaScript simulation core, enabling users to visually create nets, run simulations, and explore advanced properties such as liveness, boundedness, and persistence.


Features

  • Interactive Visual Editor: Build Petri Nets by adding places, transitions, and arcs via a drag-and-drop UI.
  • Simulation Engine: Simulate the dynamic behavior of your net with immediate and timed transitions.
  • Property Analysis: Check for net properties such as boundedness, liveness, and persistence.
  • Customizable Tokens and Capacities: Configure places, transitions, arc weights, and inhibitor arcs.
  • Real-time Feedback: Visualize token movements and transition firings during simulation.
  • Export/Import: Save and load your Petri Net models.
  • Marking Graphs: Generate and explore the full marking graph (graphe de marquages) and the tangible marking graph (graphe de marquage tangible) for your net to analyze its reachable states and tangible states.
  • Educational Resources & Guide: A comprehensive user guide is included to explain the features of PetriGo and help you get the most out of the tool.

Getting Started

Prerequisites

  • Node.js (v12 or higher recommended)
  • npm

Installation

Clone the repository and install dependencies:

git clone https://github.com/MarwaOB/PetriGo.git
cd PetriGo
npm install

Available Scripts

  • Start development server:

    npm start

    Visit http://localhost:3000 in your browser.

  • Run tests:

    npm test
  • Build for production:

    npm run build
  • Eject (advanced, irreversible):

    npm run eject

Project Structure

  • /src/modules/Petri_Net.js – Core Petri Net implementation (places, transitions, arcs, simulation logic).
  • /src/modules/Marking.js – Marking and state management, transition enabling, property checking, marking graph generation.
  • /src/modules/Arc.js – Arc types, weights, and connections.
  • /src/Functions/simulate.js – Simulation helpers and user feedback.
  • /public/ – Static assets (including token images).
  • /src/components/ – React UI components (editor, visualization, controls).
  • /docs/guide.md – User guide explaining all features and usage of PetriGo.

How It Works

  1. Create a Petri Net: Add places, transitions, and connect them with arcs (regular or inhibitor).
  2. Assign Tokens: Set initial tokens and place capacities.
  3. Simulate: Click run to watch tokens flow and transitions fire according to the net's rules.
  4. Analyze: Use built-in tools to check properties like liveness, boundedness, and persistence.
  5. Marking Graphs: Automatically generate the marking graph and tangible marking graph to visualize all possible (and only tangible) states reachable by your net.

Advanced Topics


Learn More


License

This project is licensed under the MIT License.


Contact

Questions, feedback, or contributions?
Open an issue or reach out to ChakerChourouk.


About

A web-based simulator for Generalized Stochastic Petri Nets (GSPNs) using React and React Flow. Supports net creation, stochastic firing simulation, marking and tangible marking graph generation, and analysis of properties like boundedness, liveness, reachability, and deadlocks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published