Fork me on GitHub

bolero.representation.Behavior

class bolero.representation.Behavior[source]

Behavior interface.

A behavior maps input (e.g. state) to output (e.g. next state or action).

__init__()

x.__init__(…) initializes x; see help(type(x)) for signature

can_step()[source]

Returns if step() can be called again.

Returns:
can_step : bool

Can we call step() again?

get_args()

Get parameters for this estimator.

Returns:
params : mapping of string to any

Parameter names mapped to their values.

get_outputs(outputs)[source]

Get outputs of the last step.

If the output vector consists of positions and derivatives of these, by convention all positions and all derivatives should be stored contiguously.

Parameters:
outputs : array-like, shape = (n_outputs,)

outputs, e.g. next action, will be updated

init(n_inputs, n_outputs)[source]

Initialize the behavior.

Parameters:
n_inputs : int

number of inputs

n_outputs : int

number of outputs

set_inputs(inputs)[source]

Set input for the next step.

If the input vector consists of positions and derivatives of these, by convention all positions and all derivatives should be stored contiguously.

Parameters:
inputs : array-like, shape = (n_inputs,)

inputs, e.g. current state of the system

set_meta_parameters(keys, meta_parameters)[source]

Set meta-parameters.

Meta-parameters could be the goal, obstacles, …

Parameters:
keys : list of string

names of meta-parameters

meta_parameters : list of lists of float values

One list of floats for each parameter

step()[source]

Compute output for the received input.

Uses the inputs and meta-parameters to compute the outputs.