-
Notifications
You must be signed in to change notification settings - Fork 24
/
controller.go
15 lines (13 loc) · 1.04 KB
/
controller.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package controller
import (
"github.com/fluxninja/aperture/pkg/policies/controlplane/runtime"
)
// Controller is the interface for the controller.
type Controller interface {
// ComputeOutput: Compute the output given the current and previous signal readings. Refer to last values of other readings via ControlLoopReadAPI.
ComputeOutput(signal, setpoint, controlVariable runtime.Reading, controllerStateReadAPI ControllerStateReadAPI, tickInfo runtime.TickInfo) (runtime.Reading, error)
// WindOutput: Wind the output given the previous and target output readings. Refer to last values of other readings via ControlLoopReadAPI.
WindOutput(currentOutput, targetOutput runtime.Reading, controllerStateReadAPI ControllerStateReadAPI, tickInfo runtime.TickInfo) (runtime.Reading, error)
// MaintainOutput: Try to maintain the output on setpoint change. Refer to last values of other readings via ControlLoopReadAPI.
MaintainOutput(prevSetpoint, currentSetpoint runtime.Reading, controllerStateReadAPI ControllerStateReadAPI, tickInfo runtime.TickInfo) error
}