Tune.Space behaviour (Tune v0.5.0)

Copy Markdown View Source

A value space used by search strategies.

Built-in descriptors are normalized once before search. Custom spaces are structs whose module implements this behaviour.

Summary

Functions

Normalizes a built-in descriptor or custom space.

Types

random_state()

@type random_state() :: :rand.state()

Callbacks

crossover(struct, term, term, random_state)

@callback crossover(struct(), term(), term(), random_state()) :: {term(), random_state()}

mutate(struct, term, random_state)

@callback mutate(struct(), term(), random_state()) :: {term(), random_state()}

sample(struct, random_state)

@callback sample(struct(), random_state()) :: {term(), random_state()}

valid?(struct, term)

@callback valid?(struct(), term()) :: boolean()

Functions

new(space)

@spec new(term()) :: {:ok, struct()} | {:error, Exception.t()}

Normalizes a built-in descriptor or custom space.