deluca.agents.PID

class deluca.agents.PID(*args, **kwargs)[source]

PID: agent that plays a PID policy

Public Data Attributes:

Inherited from JaxObject

name

attrs

Public Methods:

__init__([K, RC, dt])

Description: initializes the PID agent

__call__(state)

Description: provide an action given a state

Inherited from Agent

__init_subclass__(*args, **kwargs)

For avoiding a decorator for each subclass

__call__(state)

Description: provide an action given a state

reset()

feed(reward)

Inherited from JaxObject

__new__(cls, *args, **kwargs)

For avoiding super().__init__()

__init_subclass__(*args, **kwargs)

For avoiding a decorator for each subclass

__str__()

Return str(self).

__setattr__(key, val)

Implement setattr(self, name, value).

save(path)

load(path)

throw(err, msg)


__call__(state: jax._src.numpy.lax_numpy.ndarray) → jax._src.numpy.lax_numpy.ndarray[source]

Description: provide an action given a state

Parameters

state (jnp.ndarray) – the error PID must compensate for

Returns

action to take

Return type

jnp.ndarray

__init__(K: Sequence[int] = None, RC: numbers.Real = 0.5, dt: numbers.Real = 0.03, **kwargs) → None[source]

Description: initializes the PID agent

Parameters
  • K (Sequence[int]) – sequence of PID parameters

  • RC (Real) – decay parameter

  • dt (Real) – time increment

Returns

None