Crate petri_net_simulation

Source
Expand description

This crate provides a safe and convenient Rust interface for simulating petri nets, specifically designed for modeling non-linear plots in stories and games. It builds upon the pns crate, which is a low-level Rust binding to the petri net simulator written in C.

The crate extends the functionality of the pns crate by providing a higher-level, idiomatic Rust API that abstracts away the low-level details and ensures safe usage. It allows you to easily create, modify, and simulate petri nets using a more expressive and Rust-friendly interface.

Structs§

EditNet
A wrapper type for net which only supports safe edits.
PetriNetInfo
A wrapper type representing petri net for simulation.
StateLoadingError
An error that occurs when loading a petri net state.

Enums§

DynamicNetEdit
A type for editing a dynamic net safely.

Traits§

SimulationExtensions
Extension trait for the petri net simulation.

Functions§

maximum_fire_count
Calculate how often a transaction could theoretically be fired.
maximum_unfire_count
Calculate how often a transaction could theoretically be unfired.

Type Aliases§

BorrowedPetriNetSimulation
A borrowed petri net simulation that holds an immutable reference to the petri net info and owns the simulation state.
DynamicNet
Represents a dynamic net.
MultiPetriNetEdit
Helper type for safely editing the info of a multi petri net simulation without invalidating the state.
MultiPetriNetSimulation
A petri net simulation with support for multiple states.
PetriNetEdit
Helper type for safely editing the info of an owned petri net simulation without invalidating the state.
PetriNetSimulation
A basic petri net simulation that holds the petri net info and the simulation state.
PetriNetSimulationBorrow
Represents a single immutable petri net simulation.
PetriNetSimulationBorrowMut
Represents a single mutable petri net simulation.