Petri Net Simulator

Petri Net Simulator

Experiment with tokens in places and weighted transition firings, then inspect reachable deadlock candidates.

Finite-capacity P/T net: up to 12 places, 16 transitions, 80 arcs, capacity 30/place. No inhibitor, reset, timed or colored arcs. Reachability uses single-transition interleaving.

1. Build or load a net

Each place has id, label, capacity and initial tokens; each transition has id and label. Arcs connect a place to a transition or vice versa with weight 1–10. Edit JSON, then apply.

2. Fire tokens in the live marking

ready=2 · branch_a=0 · branch_b=0 · done=0

Total tokens now: 2

Enabled transitions: start_a, start_b

Two transitions may fire in one step only when their combined input tokens are present and final capacities fit. The reachability search below uses single-transition interleaving instead.

3. Reachability and deadlock candidates

Breadth-first search follows one enabled transition per edge, at most 1,200 edges. Each deadlock row shows a shortest firing path. This analyzes only this finite-capacity model.

7Reached markings
7Firing edges
3No-enabled states
81Capacity state upper bound
YesTotal tokens conserved

Exploration is complete for single-transition interleaving in this declared capacity-bounded net.

Transition token deltas: start_a=+0 · start_b=+0 · join=+0

No-enabled-transition states

An intentional completed marking also appears here. If the search was truncated, other such states may be undiscovered.

StateTokens by placeShortest firing path
M3ready=0 · branch_a=2 · branch_b=0 · done=0start_a → start_a
M5ready=0 · branch_a=0 · branch_b=2 · done=0start_b → start_b
M6ready=0 · branch_a=0 · branch_b=0 · done=2start_a → start_b → join

Comments & questions

Petri Net Simulator

Explore a finite-capacity place/transition net with weighted arcs. Token markings enable or block firings, and a breadth-first search shows reachable markings and no-enabled-transition states. A state cap keeps exploration responsive and is never mistaken for exhaustive proof.

Key features

  • Validate places, transitions, bipartite weighted arcs, initial tokens and each place capacity
  • Fire one enabled transition or a jointly enabled pair; undo and reset the live marking
  • Draw the current token marking and arc weights as a local SVG without external graph services
  • Explore the interleaving reachability graph with an explicit state and edge ceiling
  • Report deadlock markings with shortest firing paths and distinguish incomplete searches
  • Check exact per-transition token delta and whether total token count is conserved
  • Export normalized project JSON, reachability report, state CSV and current-marking SVG

How to use

  1. Load the two-branch example, a local JSON file or a version 1 project in the editor.
  2. Apply the project, then click an enabled transition to change the live marking.
  3. Choose a jointly enabled pair to fire both with aggregate token consumption and output capacity checks.
  4. Set a state limit and run breadth-first reachability analysis from the initial marking.
  5. Inspect no-enabled-transition states, shortest firing paths, conservation, and whether exploration was complete.
  6. Download the project, report, state CSV or current SVG diagram.

Use cases

  • Reveal resource conflicts caused by two jobs choosing the same branch
  • Check whether a synchronization join can be reached
  • Compare a concurrent pair with individual transition firings
  • Teach token conservation and how capacity bounds state explosion

Frequently asked questions

What makes a transition enabled?

Its input arcs must have enough tokens, and after all input tokens are consumed and output tokens are produced no place may exceed its declared capacity. Arc weights are positive integers. A pair is jointly enabled only when aggregate input and final capacities both pass.

Is a no-enabled-transition state always a defect?

No. A finished workflow may intentionally have no enabled transition. The report lists every such reachable marking as a deadlock candidate; you decide whether it is expected completion or an unwanted stall.

Does the reachability report include simultaneous steps?

Reachability explores one transition per edge (interleaving semantics). The live controls can fire a pair simultaneously. A capacity-constrained simultaneous step can sometimes reach a marking that no serial order reaches, so the report is not a proof about all step-semantic executions.

What happens when the search hits a limit?

The tool records whether the state or edge ceiling was hit. Found deadlocks remain valid witnesses, but an absence of deadlocks and unseen transitions is not a global conclusion when search is truncated. All places have finite declared capacities.

How is token conservation checked?

For each transition, total output arc weight minus total input arc weight is calculated. If every delta is zero, total tokens are conserved by any firing. This is a structural total-token test, not a full place-invariant or liveness proof.

Is the project sent to a server?

No. JSON parsing, simulation, diagrams and downloads run in the current browser tab. No external layout engine, account or automatic storage is used.

Privacy

Projects are processed in the current browser tab without automatic upload or storage. Exported JSON contains the model you entered.

References

Related Tools

State Machine TesterProcess Swimlane DesignerLogic Grid Puzzle MakerWasm Module InspectorHreflang Matrix CheckerAST Query PlaygroundContainer Build GraphDependency Graph ExplorerSemver Range LabCron Schedule AuditorPatch Review WorkbenchSource Map ExplorerLocalization Catalog AuditorStructured Data ReviewerHTTP Archive AnalyzerWebhook Signature LabProtobuf Schema WorkbenchGraphQL Schema LabAvro Schema EvolutionLocal SQL WorkbenchSchema Form BuilderMesh Repair WorkbenchPipe Network LabRobot Arm Kinematics LabThermal Network LabBeam Response LabGear Train DesignerTolerance Stackup LabSensor Calibration FitPCB Stackup PlannerDigital Filter DesignerNetwork Reachability MapSun Shadow MapGPS Error SimulatorDigital Logic SimulatorAnalog Circuit LabMechanism Linkage LabAnalysis Mesh GeneratorOpenAPI Contract InspectorDatabase Migration PlannerDimensional Equation CheckerTruss Force LabBoolean Minimization LabControl Response LabQueueing Simulation LabGeofence Event SimulatorCoordinate Reference LabSurvey Traverse LabRaster Classification LabChoropleth Design LabMap Print ComposerRaster Reprojection LabElevation Contour MakerTerrain Viewshed LabWatershed DelineatorMap Tile PackagerText File Encoding WorkbenchFilesystem Portability AuditorSBOM License ExplorerFile Signature Auditornpm Lockfile Conflict ResolverSource Secret AuditorOffline Web Package BuilderCertificate Chain InspectorTorrent Metainfo InspectorChunked File PackagerEncrypted File VaultDuplicate File FinderArchive WorkbenchDesign Token ManagerSpacing Token DesignerResponsive Type SystemPackaging Dieline DesignerSVG Icon Sprite PackerFlex Layout PlaygroundCSS Grid PlaygroundRegex Equivalence LabMarkdown Repository AuditorLog Template MinerResponsive Layout AuditorEmail Template PreviewInternal Link GraphGit History VisualizerCurl Request WorkbenchBinary Protocol DesignerHex File EditorBinary Patch WorkbenchFile Signature WorkbenchAPI Mock SandboxSchema Column MapperEvent Log SessionizerER Diagram DesignerTime Series Gap AuditorStratified Data SplitterData Lineage DesignerDecision Tree LabData Anonymization WorkbenchData Expectation RunnerJSON Schema ValidatorBasket Pattern AnalyzerRobots Policy TesterSEO HTML AuditorAccessibility Structure AuditorSyndication Feed WorkbenchIndexNow Payload BuilderCrawl Log AnalyzerCSP Policy WorkbenchSearch Performance AnalyzerCSV Formula Risk AuditorCORS Response SimulatorCache Header LabCookie Policy InspectorWeb Vitals Trace LabSitemap Health AuditorBatch File RenamerFile Manifest VerifierFolder Space MapFolder Difference ReviewerRoute Order OptimizerGeoJSON Map EditorPolygon Overlay LabCartographic Label PlacerSpatial Table JoinGeoJSON Topology AuditorGPX Track AnalyzerTrack Privacy RedactorCSV Table JoinCSV Pivot WorkbenchScientific Data ProfilerTabular Cleaning WorkbenchRecord ReconciliationData Dictionary BuilderCanonical Graph AuditorRedirect Plan TesterHTTP response and ping reference testBrowser and System InformationJSON ↔ YAML ConverterXML ↔ JSON ConverterHTML FormatterJavaScript MinifierMock Data Generator.gitignore GeneratorLicense GeneratorUser-Agent ParserPassword Strength CheckerCode to ImageXML FormatterHTTP Status Code LookupMIME Type LookupJS & SQL String EscapeCSS Box Shadow GeneratorCSS Gradient GeneratorIndent ConverterNumber Base ConverterUnicode Escape ConverterUnicode InspectorJSON Structure DiffMarkdown Table GeneratorBase64 EncoderJSON FormatterURL EncoderSQL FormatterCron Expression GeneratorRegex TesterUUID GeneratorHash GeneratorTimestamp ConverterJWT DecoderHTML Entity ConverterMarkdown PreviewCSS MinifierMeta Tag GeneratorJSON ↔ CSVCase ConverterImage to Base64
Explore all Dev Tools tools →Image/Media →Text/Convert →Life/Fun →