decorators

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inverter

type Inverter struct {
	Decorator
}

*

  • The Inverter decorator inverts the result of the child, returning `SUCCESS`
  • for `FAILURE` and `FAILURE` for `SUCCESS`. *
  • @module b3
  • @class Inverter
  • @extends Decorator

*

func (*Inverter) OnTick

func (this *Inverter) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

type Limiter

type Limiter struct {
	Decorator
	// contains filtered or unexported fields
}

*

  • This decorator limit the number of times its child can be called. After a
  • certain number of times, the Limiter decorator returns `FAILURE` without
  • executing the child. *
  • @module b3
  • @class Limiter
  • @extends Decorator

*

func (*Limiter) Initialize

func (this *Limiter) Initialize(setting *BTNodeCfg)

*

  • Initialization method. *
  • Settings parameters: *
  • - **milliseconds** (*Integer*) Maximum time, in milliseconds, a child
  • can execute. *
  • @method Initialize
  • @param {Object} settings Object with parameters.
  • @construCtor

*

func (*Limiter) OnTick

func (this *Limiter) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

type MaxTime

type MaxTime struct {
	Decorator
	// contains filtered or unexported fields
}

*

  • The MaxTime decorator limits the maximum time the node child can execute.
  • Notice that it does not interrupt the execution itself (i.e., the child
  • must be non-preemptive), it only interrupts the node after a `RUNNING`
  • status. *
  • @module b3
  • @class MaxTime
  • @extends Decorator

*

func (*MaxTime) Initialize

func (this *MaxTime) Initialize(setting *BTNodeCfg)

*

  • Initialization method. *
  • Settings parameters: *
  • - **milliseconds** (*Integer*) Maximum time, in milliseconds, a child
  • can execute. *
  • @method Initialize
  • @param {Object} settings Object with parameters.
  • @construCtor

*

func (*MaxTime) OnOpen

func (this *MaxTime) OnOpen(tick *Tick)

*

  • Open method.
  • @method open
  • @param {Tick} tick A tick instance.

*

func (*MaxTime) OnTick

func (this *MaxTime) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

type RepeatUntilFailure

type RepeatUntilFailure struct {
	Decorator
	// contains filtered or unexported fields
}

*

  • The MaxTime decorator limits the maximum time the node child can execute.
  • Notice that it does not interrupt the execution itself (i.e., the child
  • must be non-preemptive), it only interrupts the node after a `RUNNING`
  • status. *
  • @module b3
  • @class MaxTime
  • @extends Decorator

*

func (*RepeatUntilFailure) Initialize

func (this *RepeatUntilFailure) Initialize(setting *BTNodeCfg)

*

  • Initialization method. *
  • Settings parameters: *
  • - **milliseconds** (*Integer*) Maximum time, in milliseconds, a child
  • can execute. *
  • @method Initialize
  • @param {Object} settings Object with parameters.
  • @construCtor

*

func (*RepeatUntilFailure) OnOpen

func (this *RepeatUntilFailure) OnOpen(tick *Tick)

*

  • Open method.
  • @method open
  • @param {Tick} tick A tick instance.

*

func (*RepeatUntilFailure) OnTick

func (this *RepeatUntilFailure) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

type RepeatUntilSuccess

type RepeatUntilSuccess struct {
	Decorator
	// contains filtered or unexported fields
}

*

  • The MaxTime decorator limits the maximum time the node child can execute.
  • Notice that it does not interrupt the execution itself (i.e., the child
  • must be non-preemptive), it only interrupts the node after a `RUNNING`
  • status. *
  • @module b3
  • @class MaxTime
  • @extends Decorator

*

func (*RepeatUntilSuccess) Initialize

func (this *RepeatUntilSuccess) Initialize(setting *BTNodeCfg)

*

  • Initialization method. *
  • Settings parameters: *
  • - **milliseconds** (*Integer*) Maximum time, in milliseconds, a child
  • can execute. *
  • @method Initialize
  • @param {Object} settings Object with parameters.
  • @construCtor

*

func (*RepeatUntilSuccess) OnOpen

func (this *RepeatUntilSuccess) OnOpen(tick *Tick)

*

  • Open method.
  • @method open
  • @param {Tick} tick A tick instance.

*

func (*RepeatUntilSuccess) OnTick

func (this *RepeatUntilSuccess) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

type Repeater

type Repeater struct {
	Decorator
	// contains filtered or unexported fields
}

*

  • Repeater is a decorator that repeats the tick signal until the child node
  • return `RUNNING` or `ERROR`. Optionally, a maximum number of repetitions
  • can be defined. *
  • @module b3
  • @class Repeater
  • @extends Decorator

*

func (*Repeater) Initialize

func (this *Repeater) Initialize(setting *BTNodeCfg)

*

  • Initialization method. *
  • Settings parameters: *
  • - **milliseconds** (*Integer*) Maximum time, in milliseconds, a child
  • can execute. *
  • @method Initialize
  • @param {Object} settings Object with parameters.
  • @construCtor

*

func (*Repeater) OnOpen

func (this *Repeater) OnOpen(tick *Tick)

*

  • Open method.
  • @method open
  • @param {Tick} tick A tick instance.

*

func (*Repeater) OnTick

func (this *Repeater) OnTick(tick *Tick) b3.Status

*

  • Tick method.
  • @method tick
  • @param {b3.Tick} tick A tick instance.
  • @return {Constant} A state constant.

*

Jump to

Keyboard shortcuts

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