@crinkle/petrinets
Version:
js petrinet
26 lines (25 loc) • 512 B
TypeScript
declare type Place = {
key: string;
};
declare type InputArc = {
source: string;
};
declare type OutputArc = {
target: string;
};
declare type Transition = {
key: string;
input: InputArc[];
output: OutputArc[];
};
declare type Token = {
place: string;
amount: number;
};
declare type PetriNet = {
marking: Token[];
fire(name: string): void;
add(token: Token): void;
};
export default function petrinet(places: Place[], transitions: Transition[]): PetriNet;
export {};