relife.reward.Reward

relife.reward.Reward

class relife.reward.Reward[source]

Bases: abc.ABC

Generic reward class.

Methods

conditional_expectation

Conditional expected reward.

sample

Reward conditional sampling.

abstract conditional_expectation(x: numpy.ndarray, *reward_args: numpy.ndarray) numpy.ndarray[source]

Conditional expected reward.

Parameters
  • x (ndarray) – Duration.

  • *reward_args (ndarray) – Extra arguments of the reward random variable.

Returns

The conditional expected reward with respect to the duration.

Return type

ndarray

sample(x: numpy.ndarray, *reward_args: numpy.ndarray) numpy.ndarray[source]

Reward conditional sampling.

Parameters
  • x (ndarray) – Duration.

  • *reward_args (ndarray) – Extra arguments of the reward random variable.

Returns

Random drawing of a reward with respect to the duration.

Return type

ndarray