components

package
v2.23.1-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const NestedSignalPortName = "signal"

NestedSignalPortName is the port name for nested signal ingress and egress components.

Variables

This section is empty.

Functions

func AddNestedEgress

func AddNestedEgress(nestedCircuit *policylangv1.NestedCircuit, portName, signalName string)

AddNestedEgress adds a nested egress to the nested circuit.

func AddNestedIngress

func AddNestedIngress(nestedCircuit *policylangv1.NestedCircuit, portName, signalName string)

AddNestedIngress adds a nested ingress to the nested circuit.

func ArithmeticOperatorStrings

func ArithmeticOperatorStrings() []string

ArithmeticOperatorStrings returns a slice of all String values of the enum

func ComparisonOperatorStrings

func ComparisonOperatorStrings() []string

ComparisonOperatorStrings returns a slice of all String values of the enum

func NewAlerterAndOptions

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

NewAlerterAndOptions creates alerter and its fx options.

func NewAndAndOptions

func NewAndAndOptions(
	_ *policylangv1.And,
	_ runtime.ComponentID,
	_ iface.Policy,
) (runtime.Component, fx.Option, error)

NewAndAndOptions creates a new And Component.

func NewArithmeticCombinatorAndOptions

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

NewArithmeticCombinatorAndOptions returns a new ArithmeticCombinator and its Fx options.

func NewBoolVariableAndOptions added in v2.2.0

func NewBoolVariableAndOptions(variableProto *policylangv1.BoolVariable, _ runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewBoolVariableAndOptions creates a new BoolVariable component and its fx options.

func NewConstantSignal

func NewConstantSignal(value float64) runtime.Component

NewConstantSignal creates a variable component with a value that is always valid.

func NewDeciderAndOptions

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

NewDeciderAndOptions creates timed controller and its fx options.

func NewDifferentiator

func NewDifferentiator(diffProto *policylangv1.Differentiator) runtime.Component

NewDifferentiator creates a differentiator component.

func NewDifferentiatorAndOptions

func NewDifferentiatorAndOptions(diffProto *policylangv1.Differentiator, _ runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewDifferentiatorAndOptions creates a differentiator component and its fx options.

func NewExtrapolatorAndOptions

func NewExtrapolatorAndOptions(extrapolatorProto *policylangv1.Extrapolator, _ runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewExtrapolatorAndOptions creates a new Extrapolator Component.

func NewGradientControllerAndOptions added in v2.22.0

func NewGradientControllerAndOptions(
	gradientControllerProto *policylangv1.GradientController,
	componentID runtime.ComponentID,
	policyReadAPI iface.Policy,
) (runtime.Component, fx.Option, error)

NewGradientControllerAndOptions creates a Gradient Controller Component and its fx options.

func NewHolderAndOptions

func NewHolderAndOptions(holderProto *policylangv1.Holder, _ runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewHolderAndOptions creates a holder component and its fx options.

func NewIntegratorAndOptions

func NewIntegratorAndOptions(integratorProto *policylangv1.Integrator, componentID runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewIntegratorAndOptions creates an integrator component and its fx options.

func NewInverterAndOptions

func NewInverterAndOptions(
	_ *policylangv1.Inverter,
	_ runtime.ComponentID,
	_ iface.Policy,
) (runtime.Component, fx.Option, error)

NewInverterAndOptions creates a new Inverter Component.

func NewMaxAndOptions

NewMaxAndOptions creates a new Max Component.

func NewMinAndOptions

NewMinAndOptions creates a new Min Component.

func NewNestedSignalEgressAndOptions

func NewNestedSignalEgressAndOptions(nestedSignalEgressProto *policylangv1.NestedSignalEgress, _ runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewNestedSignalEgressAndOptions creates a new NestedSignalEgress and its options.

func NewNestedSignalIngressAndOptions

func NewNestedSignalIngressAndOptions(nestedSignalIngressProto *policylangv1.NestedSignalIngress, _ runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewNestedSignalIngressAndOptions creates a new NestedSignalIngress and its options.

func NewOrAndOptions

func NewOrAndOptions(
	_ *policylangv1.Or,
	_ runtime.ComponentID,
	_ iface.Policy,
) (runtime.Component, fx.Option, error)

NewOrAndOptions creates a new Or Component.

func NewPIDControllerAndOptions added in v2.14.0

func NewPIDControllerAndOptions(
	pidProto *policylangv1.PIDController,
	componentID runtime.ComponentID,
	policyReadAPI iface.Policy,
) (runtime.Component, fx.Option, error)

NewPIDControllerAndOptions creates a PID component and its fx options.

func NewPolynomialRangeFunctionAndOptions added in v2.17.0

func NewPolynomialRangeFunctionAndOptions(rangeFunctionProto *policylangv1.PolynomialRangeFunction, componentID runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewPolynomialRangeFunctionAndOptions returns a new PolynomialRangeFunction and its Fx options.

func NewPulseGeneratorAndOptions

func NewPulseGeneratorAndOptions(generatorProto *policylangv1.PulseGenerator, _ runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewPulseGeneratorAndOptions creates an pulse generator component and its fx options.

func NewSignalGeneratorAndOptions

func NewSignalGeneratorAndOptions(generatorProto *policylangv1.SignalGenerator, _ runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewSignalGeneratorAndOptions creates a signal generator component and its fx options.

func NewSwitcherAndOptions

func NewSwitcherAndOptions(_ *policylangv1.Switcher, componentID runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewSwitcherAndOptions creates a new Switcher Component.

func NewUnaryOperatorAndOptions

func NewUnaryOperatorAndOptions(unaryOperatorProto *policylangv1.UnaryOperator, _ runtime.ComponentID, _ iface.Policy) (runtime.Component, fx.Option, error)

NewUnaryOperatorAndOptions creates a new UnaryOperator Component.

func NewVariableAndOptions

func NewVariableAndOptions(variableProto *policylangv1.Variable, _ runtime.ComponentID, policyReadAPI iface.Policy) (runtime.Component, fx.Option, error)

NewVariableAndOptions creates a variable components and its fx options.

func UnaryOpStrings

func UnaryOpStrings() []string

UnaryOpStrings returns a slice of all String values of the enum

Types

type Alerter

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

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

DynamicConfigUpdate is a no-op for Alerter.

func (*Alerter) Execute

func (a *Alerter) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Alerter) IsActuator

func (*Alerter) IsActuator() bool

IsActuator implements runtime.Component.

func (*Alerter) Name

func (*Alerter) Name() string

Name implements runtime.Component.

func (*Alerter) ShortDescription

func (a *Alerter) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Alerter) Type

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

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*ArithmeticCombinator) IsActuator

func (*ArithmeticCombinator) IsActuator() bool

IsActuator implements runtime.Component.

func (*ArithmeticCombinator) Name

func (*ArithmeticCombinator) Name() string

Name implements runtime.Component.

func (*ArithmeticCombinator) ShortDescription

func (arith *ArithmeticCombinator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*ArithmeticCombinator) Type

Type implements runtime.Component.

type ArithmeticOperator

type ArithmeticOperator int8

ArithmeticOperator is the type of arithmetic operation.

const (
	UnknownArithmetic ArithmeticOperator = iota
	Add
	Sub
	Mul
	Div
	Xor
	LShift
	RShift
)

func ArithmeticOperatorString

func ArithmeticOperatorString(s string) (ArithmeticOperator, error)

ArithmeticOperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ArithmeticOperatorValues

func ArithmeticOperatorValues() []ArithmeticOperator

ArithmeticOperatorValues returns all values of the enum

func (ArithmeticOperator) IsAArithmeticOperator

func (i ArithmeticOperator) IsAArithmeticOperator() bool

IsAArithmeticOperator returns "true" if the value is listed in the enum definition. "false" otherwise

func (ArithmeticOperator) String

func (i ArithmeticOperator) String() string

type BoolVariable added in v2.2.0

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

BoolVariable is a dynamically configurable boolean variable signal.

func (*BoolVariable) DynamicConfigUpdate added in v2.2.0

func (v *BoolVariable) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate updates the boolean value when the configuration changes.

func (*BoolVariable) Execute added in v2.2.0

func (v *BoolVariable) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute executes the BoolVariable component and emits the current boolean value.

func (*BoolVariable) IsActuator added in v2.2.0

func (*BoolVariable) IsActuator() bool

IsActuator returns whether the BoolVariable component is an actuator.

func (*BoolVariable) Name added in v2.2.0

func (*BoolVariable) Name() string

Name returns the name of the BoolVariable component.

func (*BoolVariable) ShortDescription added in v2.2.0

func (v *BoolVariable) ShortDescription() string

ShortDescription returns a short description of the BoolVariable component.

func (*BoolVariable) Type added in v2.2.0

Type returns the type of the BoolVariable component.

type ComparisonOperator

type ComparisonOperator int8

ComparisonOperator is the type of comparison operator.

const (
	UnknownComparison ComparisonOperator = iota
	GT
	LT
	GTE
	LTE
	EQ
	NEQ
)

func ComparisonOperatorString

func ComparisonOperatorString(s string) (ComparisonOperator, error)

ComparisonOperatorString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ComparisonOperatorValues

func ComparisonOperatorValues() []ComparisonOperator

ComparisonOperatorValues returns all values of the enum

func (ComparisonOperator) IsAComparisonOperator

func (i ComparisonOperator) IsAComparisonOperator() bool

IsAComparisonOperator returns "true" if the value is listed in the enum definition. "false" otherwise

func (ComparisonOperator) String

func (i ComparisonOperator) String() string

type Decider

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

Decider controller for testing.

func (*Decider) DynamicConfigUpdate

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Decider) IsActuator

func (*Decider) IsActuator() bool

IsActuator implements runtime.Component.

func (*Decider) Name

func (*Decider) Name() string

Name implements runtime.Component.

func (*Decider) ShortDescription

func (dec *Decider) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Decider) Type

func (*Decider) Type() runtime.ComponentType

Type implements runtime.Component.

type Differentiator

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

Differentiator is a component that calculates rate of change per tick.

func (*Differentiator) DynamicConfigUpdate

func (d *Differentiator) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for Differentiator.

func (*Differentiator) Execute

func (d *Differentiator) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Differentiator) IsActuator

func (*Differentiator) IsActuator() bool

IsActuator implements runtime.Component.

func (*Differentiator) Name

func (*Differentiator) Name() string

Name implements runtime.Component.

func (*Differentiator) ShortDescription

func (d *Differentiator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Differentiator) Type

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, _ runtime.ComponentID, policyReadAPI iface.Policy) (*EMA, fx.Option, error)

NewEMAAndOptions returns a new EMA filter and its Fx options.

func (*EMA) DynamicConfigUpdate

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*EMA) IsActuator

func (*EMA) IsActuator() bool

IsActuator implements runtime.Component.

func (*EMA) Name

func (*EMA) Name() string

Name implements runtime.Component.

func (*EMA) ShortDescription

func (ema *EMA) ShortDescription() string

ShortDescription implements runtime.Component.

func (*EMA) Type

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

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Extrapolator) IsActuator

func (*Extrapolator) IsActuator() bool

IsActuator implements runtime.Component.

func (*Extrapolator) Name

func (*Extrapolator) Name() string

Name implements runtime.Component.

func (*Extrapolator) ShortDescription

func (exp *Extrapolator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Extrapolator) Type

Type implements runtime.Component.

type FirstValid

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

func NewFirstValidAndOptions(firstValidProto *policylangv1.FirstValid, _ runtime.ComponentID, policyReadAPI iface.Policy) (*FirstValid, fx.Option, error)

NewFirstValidAndOptions creates a new FirstValid component and its Fx option.

func (*FirstValid) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for FirstValid.

func (*FirstValid) Execute

func (fv *FirstValid) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*FirstValid) IsActuator

func (*FirstValid) IsActuator() bool

IsActuator implements runtime.Component.

func (*FirstValid) Name

func (*FirstValid) Name() string

Name implements runtime.Component.

func (*FirstValid) ShortDescription

func (*FirstValid) ShortDescription() string

ShortDescription implements runtime.Component.

func (*FirstValid) Type

Type implements runtime.Component.

type GradientController added in v2.22.0

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

GradientController describes gradient values.

func (*GradientController) DynamicConfigUpdate added in v2.22.0

func (g *GradientController) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate handles setting of controller.ControllerMode.

func (*GradientController) Execute added in v2.22.0

func (g *GradientController) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (outPortReadings runtime.PortToReading, err error)

Execute implements runtime.Component.Execute.

func (*GradientController) IsActuator added in v2.22.0

func (g *GradientController) IsActuator() bool

IsActuator implements runtime.Component.

func (*GradientController) Name added in v2.22.0

func (g *GradientController) Name() string

Name implements runtime.Component.

func (*GradientController) ShortDescription added in v2.22.0

func (g *GradientController) ShortDescription() string

ShortDescription implements runtime.Component.

func (*GradientController) Type added in v2.22.0

Type implements runtime.Component.

type Holder

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

Holder is a component that holds the last valid signal value for the specified duration then waits for next valid value to hold.

func (*Holder) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for Holder.

func (*Holder) Execute

func (h *Holder) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Holder) IsActuator

func (*Holder) IsActuator() bool

IsActuator implements runtime.Component.

func (*Holder) Name

func (*Holder) Name() string

Name implements runtime.Component.

func (*Holder) ShortDescription

func (h *Holder) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Holder) Type

func (*Holder) Type() runtime.ComponentType

Type implements runtime.Component.

type Integrator

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

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

func (*Integrator) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for Integrator.

func (*Integrator) Execute

func (in *Integrator) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Integrator) GetJob added in v2.15.0

func (in *Integrator) GetJob() jobs.Job

GetJob implements runtime.BackgroundJob.GetJob.

func (*Integrator) IsActuator

func (*Integrator) IsActuator() bool

IsActuator implements runtime.Component.

func (*Integrator) Name

func (*Integrator) Name() string

Name implements runtime.Component.

func (*Integrator) NotifyCompletion added in v2.15.0

func (in *Integrator) NotifyCompletion()

NotifyCompletion implements runtime.BackgroundJob.NotifyCompletion.

func (*Integrator) ShortDescription

func (in *Integrator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Integrator) Type

Type implements runtime.Component.

type Max

type Max struct{}

Max takes array of signals and emits maximum value.

func (*Max) DynamicConfigUpdate

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Max) IsActuator

func (*Max) IsActuator() bool

IsActuator implements runtime.Component.

func (*Max) Name

func (*Max) Name() string

Name implements runtime.Component.

func (*Max) ShortDescription

func (*Max) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Max) Type

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

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.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Min) IsActuator

func (*Min) IsActuator() bool

IsActuator implements runtime.Component.

func (*Min) Name

func (*Min) Name() string

Name implements runtime.Component.

func (*Min) ShortDescription

func (*Min) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Min) Type

func (*Min) Type() runtime.ComponentType

Type implements runtime.Component.

type NestedSignalEgress

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

NestedSignalEgress is a component that ingresses a signal into a nested circuit.

func (*NestedSignalEgress) Name

func (nse *NestedSignalEgress) Name() string

Name returns the name of the component.

func (*NestedSignalEgress) PortName

func (nsi *NestedSignalEgress) PortName() string

PortName returns the port name.

type NestedSignalIngress

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

NestedSignalIngress is a component that ingresses a signal into a nested circuit.

func (*NestedSignalIngress) Name

func (nsi *NestedSignalIngress) Name() string

Name returns the name of the component.

func (*NestedSignalIngress) PortName

func (nsi *NestedSignalIngress) PortName() string

PortName returns the port name.

type NoOp

type NoOp struct{}

NoOp takes array of signals and emits noOpimum value.

func (*NoOp) DynamicConfigUpdate

func (noOp *NoOp) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for NoOp.

func (*NoOp) Execute

func (noOp *NoOp) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*NoOp) IsActuator

func (*NoOp) IsActuator() bool

IsActuator implements runtime.Component.

func (*NoOp) Name

func (*NoOp) Name() string

Name implements runtime.Component.

func (*NoOp) ShortDescription

func (*NoOp) ShortDescription() string

ShortDescription implements runtime.Component.

func (*NoOp) Type

func (*NoOp) Type() runtime.ComponentType

Type implements runtime.Component.

type PIDController added in v2.14.0

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

PIDController .

func (*PIDController) DynamicConfigUpdate added in v2.14.0

func (pid *PIDController) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for PID.

func (*PIDController) Execute added in v2.14.0

func (pid *PIDController) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*PIDController) GetJob added in v2.15.0

func (pid *PIDController) GetJob() jobs.Job

GetJob implements runtime.BackgroundJob.GetJob.

func (*PIDController) IsActuator added in v2.14.0

func (*PIDController) IsActuator() bool

IsActuator implements runtime.Component.

func (*PIDController) Name added in v2.14.0

func (*PIDController) Name() string

Name implements runtime.Component.

func (*PIDController) NotifyCompletion added in v2.15.0

func (pid *PIDController) NotifyCompletion()

NotifyCompletion implements runtime.BackgroundJob.NotifyCompletion.

func (*PIDController) ShortDescription added in v2.14.0

func (*PIDController) ShortDescription() string

ShortDescription implements runtime.Component.

func (*PIDController) Type added in v2.14.0

Type implements runtime.Component.

type PolynomialRangeFunction added in v2.17.0

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

PolynomialRangeFunction .

func (*PolynomialRangeFunction) DynamicConfigUpdate added in v2.17.0

func (rangeFunc *PolynomialRangeFunction) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for PolynomialRangeFunction.

func (*PolynomialRangeFunction) Execute added in v2.17.0

func (rangeFunc *PolynomialRangeFunction) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*PolynomialRangeFunction) IsActuator added in v2.17.0

func (*PolynomialRangeFunction) IsActuator() bool

IsActuator implements runtime.Component.

func (*PolynomialRangeFunction) Name added in v2.17.0

Name implements runtime.Component.

func (*PolynomialRangeFunction) ShortDescription added in v2.17.0

func (rangeFunc *PolynomialRangeFunction) ShortDescription() string

ShortDescription implements runtime.Component.

func (*PolynomialRangeFunction) Type added in v2.17.0

Type implements runtime.Component.

type PulseGenerator

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

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

func (*PulseGenerator) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for PulseGenerator.

func (*PulseGenerator) Execute

func (pg *PulseGenerator) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*PulseGenerator) IsActuator

func (*PulseGenerator) IsActuator() bool

IsActuator implements runtime.Component.

func (*PulseGenerator) Name

func (*PulseGenerator) Name() string

Name implements runtime.Component.

func (*PulseGenerator) ShortDescription

func (pg *PulseGenerator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*PulseGenerator) Type

Type implements runtime.Component.

type SMA

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

SMA is a Simple Moving Average filter.

func NewSMAAndOptions

func NewSMAAndOptions(smaProto *policylangv1.SMA, _ runtime.ComponentID, policyReadAPI iface.Policy) (*SMA, fx.Option, error)

NewSMAAndOptions returns a new SMA filter and its Fx options.

func (*SMA) DynamicConfigUpdate

func (sma *SMA) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for SMA.

func (*SMA) Execute

func (sma *SMA) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*SMA) IsActuator

func (*SMA) IsActuator() bool

IsActuator returns whether this component is a actuator or not.

func (*SMA) Name

func (sma *SMA) Name() string

Name returns the name of the component.

func (*SMA) ShortDescription

func (sma *SMA) ShortDescription() string

ShortDescription returns a short description of the component.

func (*SMA) Type

func (sma *SMA) Type() runtime.ComponentType

Type returns the type of the component.

type SignalGenerator

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

SignalGenerator generates a signal based on the steps specified.

func (*SignalGenerator) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for SignalGenerator.

func (*SignalGenerator) Execute

func (sg *SignalGenerator) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*SignalGenerator) IsActuator

func (*SignalGenerator) IsActuator() bool

IsActuator implements runtime.Component.

func (*SignalGenerator) Name

func (*SignalGenerator) Name() string

Name implements runtime.Component.

func (*SignalGenerator) ShortDescription

func (sg *SignalGenerator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*SignalGenerator) Type

Type implements runtime.Component.

type Switcher

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

Switcher switches between two inputs based on third input.

func (*Switcher) DynamicConfigUpdate

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

DynamicConfigUpdate is a no-op for Switcher.

func (*Switcher) Execute

func (dec *Switcher) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Switcher) IsActuator

func (*Switcher) IsActuator() bool

IsActuator implements runtime.Component.

func (*Switcher) Name

func (*Switcher) Name() string

Name implements runtime.Component.

func (*Switcher) ShortDescription

func (*Switcher) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Switcher) Type

func (*Switcher) Type() runtime.ComponentType

Type implements runtime.Component.

type UnaryOp

type UnaryOp int8

UnaryOp is the type of unary operation.

const (
	UnknownUnary UnaryOp = iota
	Abs
	Acos
	Acosh
	Asin
	Asinh
	Atan
	Atanh
	Cbrt
	Ceil
	Cos
	Cosh
	Erf
	Erfc
	Erfcinv
	Erfinv
	Exp
	Exp2
	Expm1
	Floor
	Gamma
	J0
	J1
	Lgamma
	Log
	Log10
	Log1p
	Log2
	Round
	RoundToEven
	Sin
	Sinh
	Sqrt
	Tan
	Tanh
	Trunc
	Y0
	Y1
)

func UnaryOpString

func UnaryOpString(s string) (UnaryOp, error)

UnaryOpString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func UnaryOpValues

func UnaryOpValues() []UnaryOp

UnaryOpValues returns all values of the enum

func (UnaryOp) IsAUnaryOp

func (i UnaryOp) IsAUnaryOp() bool

IsAUnaryOp returns "true" if the value is listed in the enum definition. "false" otherwise

func (UnaryOp) String

func (i UnaryOp) String() string

type UnaryOperator

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

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

func (*UnaryOperator) DynamicConfigUpdate

func (unaryOperator *UnaryOperator) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate is a no-op for UnaryOperator.

func (*UnaryOperator) Execute

func (unaryOperator *UnaryOperator) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*UnaryOperator) IsActuator

func (*UnaryOperator) IsActuator() bool

IsActuator implements runtime.Component.

func (*UnaryOperator) Name

func (*UnaryOperator) Name() string

Name implements runtime.Component.

func (*UnaryOperator) ShortDescription

func (unaryOperator *UnaryOperator) ShortDescription() string

ShortDescription implements runtime.Component.

func (*UnaryOperator) Type

Type implements runtime.Component.

type Variable

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

Variable is a dynamically configurable variable signal.

func (*Variable) DynamicConfigUpdate

func (v *Variable) DynamicConfigUpdate(event notifiers.Event, unmarshaller config.Unmarshaller)

DynamicConfigUpdate finds the dynamic config and syncs the constant value.

func (*Variable) Execute

func (v *Variable) Execute(inPortReadings runtime.PortToReading, circuitAPI runtime.CircuitAPI) (runtime.PortToReading, error)

Execute implements runtime.Component.Execute.

func (*Variable) IsActuator

func (*Variable) IsActuator() bool

IsActuator implements runtime.Component.

func (*Variable) Name

func (*Variable) Name() string

Name implements runtime.Component.

func (*Variable) ShortDescription

func (v *Variable) ShortDescription() string

ShortDescription implements runtime.Component.

func (*Variable) Type

func (*Variable) Type() runtime.ComponentType

Type implements runtime.Component.

Directories

Path Synopsis
flowcontrol
query

Jump to

Keyboard shortcuts

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