'Return a concatenated state, using the last concat_length -
1, plus state.'

def concat_state(self, state):

    if self.concat_observations:
        indexes = np.arange(((self.top - self.concat_length) + 1), self.top)
        concat_state = np.empty(((self.concat_length,) + self.observation_shape), dtype=floatX)
        concat_state[0:(self.concat_length - 1)] = self.observations.take(indexes, axis=0, mode='wrap')
        concat_state[(-1)] = state
        return concat_state
    else:
        return state
