alpaca/alpacka/agents/shooting_test.py
def mock_bstep_class():
    """Mock batch stepper class with fixed run_episode_batch return."""
    bstep_cls = mock.create_autospec(batch_steppers.LocalBatchStepper)
    bstep_cls.return_value.run_episode_batch.return_value = construct_episodes(
        actions=[
            [0], [0], [0],  # Three first episodes action 0
            [1], [1], [1],  # Three last episodes action 1
        ],
        rewards=[
            [1], [1], [1],  # Higher mean, action 0
            [0], [0], [2],  # Higher max, action 1
        ])
    return bstep_cls
Mock batch stepper class with fixed run_episode_batch return.
Mock batch stepper class with fixed run_episode_batch return.
Mock batch stepper class with fixed run_episode_batch return .
def mock_bstep_class():
    bstep_cls = mock.create_autospec(batch_steppers.LocalBatchStepper)
    bstep_cls.return_value.run_episode_batch.return_value = construct_episodes(
        actions=[
            [0], [0], [0],  
            [1], [1], [1],  
        ],
        rewards=[
            [1], [1], [1],  
            [0], [0], [2],  
        ])
    return bstep_cls
def mock_bstep_class ( ) : bstep_cls = mock . create_autospec ( batch_steppers . LocalBatchStepper ) bstep_cls . return_value . run_episode_batch . return_value = construct_episodes ( actions = [ [ 0 ] , [ 0 ] , [ 0 ] , [ 1 ] , [ 1 ] , [ 1 ] , ] , rewards = [ [ 1 ] , [ 1 ] , [ 1 ] , [ 0 ] , [ 0 ] , [ 2 ] , ] ) return bstep_cls
Mock batch stepper class with fixed run_episode_batch return.
Mock batch stepper class with fixed run_episode_batch return .
"""Mock batch stepper class with fixed run_episode_batch return.""" # Three first episodes action 0 # Three last episodes action 1 # Higher mean, action 0 # Higher max, action 1