From be41d971ffe80470762c9d1df8cd6b72c790daa6 Mon Sep 17 00:00:00 2001 From: Xie Yuheng Date: Wed, 15 Nov 2023 10:38:30 +0800 Subject: [PATCH] Net -- has transitionEntries and placeEntries --- TODO.md | 20 +++++++++++++++++--- src/lang/net/Net.ts | 23 ++++++++++++++++++----- 2 files changed, 35 insertions(+), 8 deletions(-) diff --git a/TODO.md b/TODO.md index f33dff8..758d13e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,25 @@ # net -Transition -- has input and output places -Place -Choice +createNet + +Transition and Place has id and name + +createNode + +TransitionEntry -- has inputs and outputs places +PlaceEntry apply/applyTransition +run + +- everytime a marking changes, + loop through and try to execute every transitions. + +# choice + +[maybe] as one kind of `Transition` + # lang env diff --git a/src/lang/net/Net.ts b/src/lang/net/Net.ts index 9557712..c3efcd2 100644 --- a/src/lang/net/Net.ts +++ b/src/lang/net/Net.ts @@ -1,7 +1,20 @@ -import { Place } from "../place" -import { Transition } from "../transition" - export type Net = { - places: Map - transitions: Map + placeEntries: Map + transitionEntries: Map +} + +export type TransitionEntry = { + id: string + name: string + inputs: Array + outputs: Array +} + +export type PlaceEntry = { + id: string + name: string +} + +export type ChoiceEntry = { + // }