statemachine

package
v0.0.0-...-1354865 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

type Condition

type Condition string

type Delta

type Delta []int64

type Role

type Role string

type StateMachine

type StateMachine struct {
	Initial     StateVector
	Capacity    StateVector
	Transitions map[Action]Transition
}

func (StateMachine) String

func (s StateMachine) String() string

func (*StateMachine) Transform

func (s *StateMachine) Transform(state []uint64, action string, multiplier uint64) (vectorOut []int64, role Role, err error)

func (*StateMachine) ValidActions

func (s *StateMachine) ValidActions(state []uint64, roles []Role, multiplier uint64) (map[string][]uint64, bool)

type StateVector

type StateVector []uint64

type Transition

type Transition struct {
	Delta  Delta
	Role   Role
	Guards map[Condition]Delta
}

func (Transition) String

func (t Transition) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL