Skip to content

Commit

Permalink
Net -- has transitionEntries and placeEntries
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Nov 15, 2023
1 parent feb67d7 commit be41d97
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
20 changes: 17 additions & 3 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 18 additions & 5 deletions src/lang/net/Net.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
import { Place } from "../place"
import { Transition } from "../transition"

export type Net = {
places: Map<string, Place>
transitions: Map<string, Transition>
placeEntries: Map<string, PlaceEntry>
transitionEntries: Map<string, TransitionEntry>
}

export type TransitionEntry = {
id: string
name: string
inputs: Array<PlaceEntry>
outputs: Array<PlaceEntry>
}

export type PlaceEntry = {
id: string
name: string
}

export type ChoiceEntry = {
//
}

0 comments on commit be41d97

Please sign in to comment.