components

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlerterAndOptions added in v0.11.0

func NewAlerterAndOptions(alerterProto *policylangv1.Alerter, _ int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewAlerterAndOptions creates alerter and its fx options.

func NewArithmeticCombinatorAndOptions

func NewArithmeticCombinatorAndOptions(arithmeticCombinatorProto *policylangv1.ArithmeticCombinator, _ int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewArithmeticCombinatorAndOptions returns a new ArithmeticCombinator and its Fx options.

func NewConstant added in v0.15.0

func NewConstant(value float64) runtime.Component

NewConstant creates a constant component with a given value.

func NewConstantAndOptions

func NewConstantAndOptions(constant *policylangv1.Constant, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewConstantAndOptions creates a constant components and its fx options.

func NewDeciderAndOptions

func NewDeciderAndOptions(deciderProto *policylangv1.Decider, _ int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewDeciderAndOptions creates timed controller and its fx options.

func NewExtrapolatorAndOptions

func NewExtrapolatorAndOptions(extrapolatorProto *policylangv1.Extrapolator, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewExtrapolatorAndOptions creates a new Extrapolator Component.

func NewIntegrator added in v0.16.0

func NewIntegrator() runtime.Component

NewIntegrator creates an integrator component.

func NewIntegratorAndOptions added in v0.16.0

func NewIntegratorAndOptions(_ *policylangv1.Integrator, _ int, _ iface.Policy) (runtime.Component, fx.Option, error)

NewIntegratorAndOptions creates an integrator component and its fx options.

func NewMaxAndOptions

func NewMaxAndOptions(maxProto *policylangv1.Max, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewMaxAndOptions creates a new Max Component.

func NewMinAndOptions

func NewMinAndOptions(minProto *policylangv1.Min, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewMinAndOptions creates a new Min Component.

func NewSqrtAndOptions

func NewSqrtAndOptions(sqrtProto *policylangv1.Sqrt, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewSqrtAndOptions creates a new Sqrt Component.

func NewSwitcherAndOptions added in v0.3.0

func NewSwitcherAndOptions(switcherProto *policylangv1.Switcher, componentIndex int, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewSwitcherAndOptions creates a new Switcher Component.

Types

type Alerter added in v0.11.0

type Alerter struct {
	// contains filtered or unexported fields
}

Alerter is a component that monitors signal value and creates alert on true value.

func (*Alerter) DynamicConfigUpdate added in v0.11.0

func (a *Alerter) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Alerter.

func (*Alerter) Execute added in v0.11.0

func (a *Alerter) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Alerter) Name added in v0.14.0

func (*Alerter) Name() string

Name implements runtime.Component.

func (*Alerter) Type added in v0.14.0

func (*Alerter) Type() runtime.ComponentType

Type implements runtime.Component.

type ArithmeticCombinator

type ArithmeticCombinator struct {
	// contains filtered or unexported fields
}

ArithmeticCombinator takes lhs, rhs input signals and emits computed output via arithmetic operation.

func (*ArithmeticCombinator) DynamicConfigUpdate added in v0.4.0

func (arith *ArithmeticCombinator) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for ArithmeticCombinator.

func (*ArithmeticCombinator) Execute

func (arith *ArithmeticCombinator) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*ArithmeticCombinator) Name added in v0.14.0

func (*ArithmeticCombinator) Name() string

Name implements runtime.Component.

func (*ArithmeticCombinator) Type added in v0.14.0

Type implements runtime.Component.

type Constant

type Constant struct {
	// contains filtered or unexported fields
}

Constant is a constant signal.

func (*Constant) DynamicConfigUpdate added in v0.4.0

func (con *Constant) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Constant.

func (*Constant) Execute

func (con *Constant) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Constant) Name added in v0.14.0

func (*Constant) Name() string

Name implements runtime.Component.

func (*Constant) Type added in v0.14.0

func (*Constant) Type() runtime.ComponentType

Type implements runtime.Component.

type Decider

type Decider struct {
	// contains filtered or unexported fields
}

Decider controller for testing.

func (*Decider) DynamicConfigUpdate added in v0.4.0

func (dec *Decider) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Decider.

func (*Decider) Execute

func (dec *Decider) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Decider) Name added in v0.14.0

func (*Decider) Name() string

Name implements runtime.Component.

func (*Decider) Type added in v0.14.0

func (*Decider) Type() runtime.ComponentType

Type implements runtime.Component.

type EMA

type EMA struct {
	// contains filtered or unexported fields
}

EMA is an Exponential Moving Average filter.

func NewEMAAndOptions

func NewEMAAndOptions(emaProto *policylangv1.EMA,
	_ int,
	policyReadAPI iface.Policy,
) (*EMA, fx.Option, error)

NewEMAAndOptions returns a new EMA filter and its Fx options.

func (*EMA) DynamicConfigUpdate added in v0.4.0

func (ema *EMA) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for EMA.

func (*EMA) Execute

func (ema *EMA) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*EMA) Name added in v0.14.0

func (*EMA) Name() string

Name implements runtime.Component.

func (*EMA) Type added in v0.14.0

func (*EMA) Type() runtime.ComponentType

Type implements runtime.Component.

type Extrapolator

type Extrapolator struct {
	// contains filtered or unexported fields
}

Extrapolator takes an input signal and emits an output signal.

func (*Extrapolator) DynamicConfigUpdate added in v0.4.0

func (exp *Extrapolator) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Extrapolator.

func (*Extrapolator) Execute

func (exp *Extrapolator) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Extrapolator) Name added in v0.14.0

func (*Extrapolator) Name() string

Name implements runtime.Component.

func (*Extrapolator) Type added in v0.14.0

Type implements runtime.Component.

type FirstValid added in v0.5.1

type FirstValid struct{}

FirstValid picks the first valid input signal from the array of input signals and emits it as an output signal.

func NewFirstValidAndOptions added in v0.5.1

func NewFirstValidAndOptions(firstValidProto *policylangv1.FirstValid, componentIndex int, policyReadAPI iface.Policy) (*FirstValid, fx.Option, error)

NewFirstValidAndOptions creates a new FirstValid component and its Fx option.

func (*FirstValid) DynamicConfigUpdate added in v0.5.1

func (fv *FirstValid) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for FirstValid.

func (*FirstValid) Execute added in v0.5.1

func (fv *FirstValid) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*FirstValid) Name added in v0.14.0

func (*FirstValid) Name() string

Name implements runtime.Component.

func (*FirstValid) Type added in v0.14.0

Type implements runtime.Component.

type Integrator added in v0.16.0

type Integrator struct {
	// contains filtered or unexported fields
}

Integrator is a component that accumulates sum of signal every tick.

func (*Integrator) DynamicConfigUpdate added in v0.16.0

func (in *Integrator) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Integrator.

func (*Integrator) Execute added in v0.16.0

func (in *Integrator) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Integrator) Name added in v0.16.0

func (*Integrator) Name() string

Name implements runtime.Component.

func (*Integrator) Type added in v0.16.0

Type implements runtime.Component.

type Max

type Max struct{}

Max takes array of signals and emits maximum value.

func (*Max) DynamicConfigUpdate added in v0.4.0

func (max *Max) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Max.

func (*Max) Execute

func (max *Max) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Max) Name added in v0.14.0

func (*Max) Name() string

Name implements runtime.Component.

func (*Max) Type added in v0.14.0

func (*Max) Type() runtime.ComponentType

Type implements runtime.Component.

type Min

type Min struct{}

Min takes array of signals and emits minimum value.

func (*Min) DynamicConfigUpdate added in v0.4.0

func (min *Min) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Min.

func (*Min) Execute

func (min *Min) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Min) Name added in v0.14.0

func (*Min) Name() string

Name implements runtime.Component.

func (*Min) Type added in v0.14.0

func (*Min) Type() runtime.ComponentType

Type implements runtime.Component.

type Sink added in v0.7.0

type Sink struct{}

Sink is a component that consumes array of input signals and does nothing with them.

func NewSinkAndOptions added in v0.7.0

func NewSinkAndOptions(sinkProto *policylangv1.Sink, componentIndex int, policyReadAPI iface.Policy) (*Sink, fx.Option, error)

NewSinkAndOptions creates a new Sink component.

func (*Sink) DynamicConfigUpdate added in v0.7.0

func (s *Sink) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Sink.

func (*Sink) Execute added in v0.7.0

func (s *Sink) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements Component interface.

func (*Sink) Name added in v0.14.0

func (*Sink) Name() string

Name implements runtime.Component.

func (*Sink) Type added in v0.14.0

func (*Sink) Type() runtime.ComponentType

Type implements runtime.Component.

type Sqrt

type Sqrt struct {
	// contains filtered or unexported fields
}

Sqrt takes an input signal and emits Square Root of it multiplied by scale as output.

func (*Sqrt) DynamicConfigUpdate added in v0.4.0

func (sqrt *Sqrt) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Sqrt.

func (*Sqrt) Execute

func (sqrt *Sqrt) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Sqrt) Name added in v0.14.0

func (*Sqrt) Name() string

Name implements runtime.Component.

func (*Sqrt) Type added in v0.14.0

func (*Sqrt) Type() runtime.ComponentType

Type implements runtime.Component.

type Switcher added in v0.3.0

type Switcher struct{}

Switcher switches between two inputs based on third input.

func (*Switcher) DynamicConfigUpdate added in v0.4.0

func (dec *Switcher) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Switcher.

func (*Switcher) Execute added in v0.3.0

func (dec *Switcher) Execute(inPortReadings runtime.PortToValue, tickInfo runtime.TickInfo) (runtime.PortToValue, error)

Execute implements runtime.Component.Execute.

func (*Switcher) Name added in v0.14.0

func (*Switcher) Name() string

Name implements runtime.Component.

func (*Switcher) Type added in v0.14.0

func (*Switcher) Type() runtime.ComponentType

Type implements runtime.Component.

Directories

Path Synopsis
actuators

Jump to

Keyboard shortcuts

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