Documentation
¶
Index ¶
- Constants
- type Actor
- type Arc
- type Cell
- type Coords
- type Fn
- type MetaModel
- func (m *MetaModel) AppendArc(a Arc)
- func (m *MetaModel) AssertFrozen()
- func (m *MetaModel) Freeze() *MetaModel
- func (m *MetaModel) GetVars() []*VarMap
- func (m *MetaModel) IsFrozen() bool
- func (m *MetaModel) NewVar() Var
- func (m *MetaModel) PTNet() *ptnet.PTNet
- func (m *MetaModel) Place(label string, place ptnet.Place) *Node
- func (m *MetaModel) Role(label string) statemachine.Role
- func (m *MetaModel) ToAny() (n *any.Any, err error)
- func (m *MetaModel) Transition(label string, transition statemachine.Transition) *Node
- type Node
- type ProtoModel
- type Ref
- type Var
- type VarMap
Constants ¶
View Source
const ( PLACE nodeType = 0 TRANSITION nodeType = 1 ARC arcType = 0 INHIBITOR arcType = 1 )
View Source
const CapacityVar varType = 2
View Source
const InitialVar varType = 0
View Source
const WeightVar varType = 1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetaModel ¶
type MetaModel struct { ProtoModel `json:"-"` Schema string `json:"schema"` Places map[string]*ptnet.Place `json:"places"` Transitions map[statemachine.Action]*statemachine.Transition `json:"transitions"` VectorSize int `json:"-"` // contains filtered or unexported fields }
an MetaModel is used as scaffolding for constructing petri-nets
func (*MetaModel) AppendArc ¶
store are declaration in model arcs are indexed only after model is frozen
func (*MetaModel) AssertFrozen ¶
func (m *MetaModel) AssertFrozen()
func (*MetaModel) Transition ¶
func (m *MetaModel) Transition(label string, transition statemachine.Transition) *Node
type Node ¶
type Node struct { Label string *ptnet.Place *statemachine.Transition // contains filtered or unexported fields }
nodes are used to generate state machine model
type ProtoModel ¶
type Ref ¶
allow relative addressing for variable binding Ref{Target, source} points to an arc place -> tx or tx -> place Ref{source} points to a place
type Var ¶
type Var interface { // set max capacity Capacity(t string) Var // set input values Initial(t string) Var // adjust multiple on arc Weight(n ...string) Var Bind(bindFunc binding) // contains filtered or unexported methods }
syntactic sugar for variable declaration
type VarMap ¶
type VarMap struct { Var Ref Coords Label string Offset int Description string // contains filtered or unexported fields }
map input vars to MetaModel
func (*VarMap) Bind ¶
func (v *VarMap) Bind(bindFunc binding)
bind variable to a value producing function
Click to show internal directories.
Click to hide internal directories.