# tf_agents.trajectories.TimeStep

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/time_step.py#L54-L110) |

Returned with every call to `step` and `reset` on an environment.

#### View aliases


**Main aliases**

[`tf_agents.trajectories.time_step.TimeStep`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/TimeStep)

<br />

    tf_agents.trajectories.TimeStep(
        step_type, reward, discount, observation
    )

A `TimeStep` contains the data emitted by an environment at each step of
interaction. A `TimeStep` holds a `step_type`, an `observation` (typically a
NumPy array or a dict or list of arrays), and an associated `reward` and
`discount`.

The first `TimeStep` in a sequence will equal [`StepType.FIRST`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/StepType#FIRST). The final
`TimeStep` will equal [`StepType.LAST`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/trajectories/StepType#LAST). All other `TimeStep`s in a sequence
will equal \`StepType.MID.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `step_type` | a `Tensor` or array of `StepType` enum values. |
| `reward` | a `Tensor` or array of reward values. |
| `discount` | A discount value in the range `[0, 1]`. |
| `observation` | A NumPy array, or a nested dict, list or tuple of arrays. |

<br />

## Methods

### `is_first`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/time_step.py#L85-L88)

    is_first() -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Bool

### `is_last`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/time_step.py#L95-L98)

    is_last() -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Bool

### `is_mid`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/trajectories/time_step.py#L90-L93)

    is_mid() -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Bool