liveBook · Manning

Action

As explained in Optimization Algorithms: AI techniques for design, planning, and control problems

An action is a choice made by a reinforcement-learning agent in a given state that affects subsequent states and rewards.

An action is a choice an agent makes while interacting with an environment. In a Markov decision process (MDP), the agent selects an action from the permissible action set, receives a reward, and moves to a new state. A policy maps states—or the observations available to the agent—to actions. Learning aims to choose actions that maximize cumulative reward, not just the next reward. section 12.1.2 section 12.1

Choose a commute

From home, choosing the train, car, or bike is an action. If travel were deterministic, each choice would have a predictable result. Under uncertainty, taking the train might get you to work on time or leave you waiting for the next one; driving can produce different travel times as traffic changes. The choice therefore needs to account for possible outcomes, not a single promised arrival time. section 12.1.1

What counts as an action depends on the problem:

  • In an MDP, actions affect the environment and may have consequences across multiple time steps. Actions can be discrete, as in a board game, or continuous, as in robot control. section 12.1 section 12.1.2
  • In a multi-armed bandit, selecting an arm produces a reward but does not change the environment’s state. The task is to balance trying arms against choosing a promising one. section 12.1.6
  • In a contextual bandit, the best arm can change with the current context; expected reward depends on both the context and the chosen action. section 12.1
def epsilon_greedy(epsilon):
    total_regret = 0
    for _ in range(num_trials):
        if np.random.random() < epsilon:
            selected_machine = np.random.randint(K)                #1
        else:
            selected_machine = np.argmax([payoff_params[i]["mean"] 
             for i in range(K)])                                 #2
        reward = sample_payoff(selected_machine)                   #3
        regret = max_reward - reward
        total_regret += regret
    average_regret = total_regret / num_trials
    return average_regret
#1 Randomly select a slot machine for exploration.
#2 Select the slot machine with the highest mean payoff for exploitation.
#3 Sample the payoff from the selected slot machine.

The epsilon-greedy listing makes action selection concrete: sometimes it selects a slot machine randomly, and otherwise it selects the one with the highest specified mean payoff. Compare those two branches to see the exploration–exploitation choice; the listing uses supplied payoff means for its exploitation branch. section 12.1.6

For a sequential optimization problem, defining the actions also defines the decisions an agent can make while constructing a solution. Routing problems are examples of this RL framing: the goal is to learn a policy that maps states to choices yielding strong long-term rewards. Start by identifying the permissible choices, then ask whether each choice changes a future state; that distinction helps determine whether an MDP or bandit model fits. section 12.2 section 12.1

How Optimization Algorithms: AI techniques for design, planning, and control problems covers it

How deep it goes
Defines permissible actions and their place in policy-driven reward and state transitions, then contrasts MDP and bandit choices.
Examples
Uses uncertain commute choices and a three-slot-machine Python simulation of action-selection strategies.
What it assumes
Introduces core reinforcement-learning terms through agent–environment interaction and familiar commute choices rather than assuming advanced theory.
What you can do after
Evaluate/understand whether a choice changes future states or merely yields a reward, and identify actions available to an agent.
How it connects
Links actions to policies, observations, rewards, state transitions, Markov decision processes, and multi-armed bandits.

Also explained in

Compare how 13 books explain action →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Optimization Algorithms: AI techniques for design, planning, and control problems. The section links point to the parts of the book it draws on.