List returns a list of all registered reduce strategy names.
NewLinear implements a reduce strategy that reduces the data through a linear search algorithm. Every step of the strategy generates a new valid token graph state. The generation is deterministic. The algorithm starts by deactivating all optional tokens, this includes for example reducing lists to their minimum repetition. Each step uses the feedback to determine which tokens to reactivate next.
Register registers a reduce strategy instance function with the given name.
Error holds a reduce strategy error
ErrorType the reduce strategy error type
ReduceFeedbackType the reduce strategy feedback type
const ( // Unknown the feedback is of unknown type, this is always a fatal error Unknown ReduceFeedbackType = iota // Good the reduce step produced a successful result Good // Bad the reduce step produced an unsuccessful result Bad )
go:generate stringer -type=ReduceFeedbackType
Strategy defines a reduce strategy The function starts the first step of the reduce strategy returning a channel which controls the step flow and a channel for the feedback of the step. The channel returns a value if the step is complete and waits with calculating the next step until a value is put in and feedback is given. The channels are automatically closed when there are no more steps. The error return argument is not nil if an error occurs during the initialization of the reduce strategy.
New returns a new reduce strategy instance given the registered name of the strategy. The error return argument is not nil, if the name does not exist in the registered reduce strategy list.