Documentation
¶
Index ¶
- type Entity
- type EntityCore
- type EnvironmentInfo
- type Supervisor
- func (sv *Supervisor) Affect(envName string, entity *Entity, delay int) error
- func (sv *Supervisor) Attach(entity *Entity, joins, affects map[string]int) error
- func (sv *Supervisor) ClearEnvironments() error
- func (sv *Supervisor) CreateEnvironment(name string) error
- func (sv *Supervisor) DeleteEnvironment(envName string) error
- func (sv *Supervisor) DoIfIdle(timeout time.Duration, doFunc func()) bool
- func (sv *Supervisor) DoOnIdle(doFunc func())
- func (sv *Supervisor) EnvironmentInfo() map[string]*EnvironmentInfo
- func (sv *Supervisor) GetQuantCount() int64
- func (sv *Supervisor) Join(envName string, entity *Entity, limit int) error
- func (sv *Supervisor) NewEntity(name string, inSize, outSize int, core EntityCore) (*Entity, error)
- func (sv *Supervisor) PostEffect(envName string, effect Trits, delay int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Entity ¶
type Entity struct {
Supervisor *Supervisor
Name string
// contains filtered or unexported fields
}
func (*Entity) GetCore ¶
func (ent *Entity) GetCore() EntityCore
func (*Entity) GetQuantCount ¶
for calls from within entity core. For testing/debugging
type EntityCore ¶
type EntityCore interface {
Call(Trits, Trits) bool
}
type EnvironmentInfo ¶
type Supervisor ¶
type Supervisor struct {
Name string
// contains filtered or unexported fields
}
func NewSupervisor ¶
func NewSupervisor(name string, lockTimeout time.Duration) *Supervisor
func (*Supervisor) Affect ¶
func (sv *Supervisor) Affect(envName string, entity *Entity, delay int) error
func (*Supervisor) Attach ¶
func (sv *Supervisor) Attach(entity *Entity, joins, affects map[string]int) error
func (*Supervisor) ClearEnvironments ¶
func (sv *Supervisor) ClearEnvironments() error
func (*Supervisor) CreateEnvironment ¶
func (sv *Supervisor) CreateEnvironment(name string) error
func (*Supervisor) DeleteEnvironment ¶
func (sv *Supervisor) DeleteEnvironment(envName string) error
func (*Supervisor) DoIfIdle ¶
func (sv *Supervisor) DoIfIdle(timeout time.Duration, doFunc func()) bool
func (*Supervisor) DoOnIdle ¶
func (sv *Supervisor) DoOnIdle(doFunc func())
loops until Supervisor becomes idle and calls doFunc
func (*Supervisor) EnvironmentInfo ¶
func (sv *Supervisor) EnvironmentInfo() map[string]*EnvironmentInfo
func (*Supervisor) GetQuantCount ¶
func (sv *Supervisor) GetQuantCount() int64
func (*Supervisor) Join ¶
func (sv *Supervisor) Join(envName string, entity *Entity, limit int) error
func (*Supervisor) NewEntity ¶
func (sv *Supervisor) NewEntity(name string, inSize, outSize int, core EntityCore) (*Entity, error)
func (*Supervisor) PostEffect ¶
func (sv *Supervisor) PostEffect(envName string, effect Trits, delay int) error
Click to show internal directories.
Click to hide internal directories.