Solving a small problem with a table provides a baseline for comparing complex function approximation models.
Before practice
01 What does one Q-table entry estimate?
Description
Q(s,a) ← Q(s,a)+α[r+γ max Q(s′,·)−Q(s,a)]. Exclude future value when the task itself terminates. Interpret time limits separately.
02 Are exploration return and evaluation return the same?
Description
Exploratory actions are needed during training, but evaluate policies separately under the same conditions. Also inspect Q-values for unvisited states.
Execution conditions
Run the baseline Queue example with NumPy. Compare policies on seed=100…104, which were not used for training.
Applications
Throughput and cost of equipment and communication resources
An average of 2 items arrive at the synthetic queue each time step. Increasing service capacity reduces queue length but increases energy cost.
Observation·State
Queue length …20. Observation .
Action
Choose a processing capacity of 0, 2, or 4.
Reward·Constraint
−(next queue length + 0.2×capacity² + 10×dropped items). Time limit at 100 steps.
Comparison baseline
Constant capacity of 2, and a threshold policy based on queue length.
Metrics to check
Evaluation return, mean queue length, mean capacity², and dropped-item count.
Mobile robot paths and safety
An application design case choosing either grid paths or continuous velocity control.
Observation·State
Position, target-relative position, and nearby obstacle observations.
Action
Grid direction selection or bounded linear and angular velocities.
Reward·Constraint
Separate arrival, collision, and movement costs. Distinguish collisions from timeouts.
Comparison baseline
Shortest path and rule-based avoidance.
Metrics to check
Success rate, collision rate, travel distance, and time. Evaluate on unseen maps.
Learn Queue's and three actions using a Q-table. Use , , and , and run 50 episodes with at most 100 steps per episode.
Procedure
Run the provided training loop and tabulate the Q-values and selected actions for .
For evaluation, set and compare with the rule-based policy using the same seed.
If low capacity is chosen for large queues, first check visit counts and the reward structure.
Results to retain
A portion of the Q-table by state, a policy comparison table, and a return plot by training episode.
Items to record and points to check
q
Q()
Q()
Q()
Selected action
Visit count
Points to check
Did you distinguish action selection from exploration during evaluation?
Did you retain bootstrapping at time limits and separate evaluation seeds from training seeds?
2. Discount factor and decision making
Starting conditions
Compare and .95. Keep other training conditions and the total number of transitions fixed.
Procedure
Wrap the Q-table training loop in a train_q(gamma) function, and replace constant .95 in the target formula with argument gamma. Run this function for both discount factors.
Compare queue length, capacity², and dropped items on the same evaluation set.
If the selected action changed at a particular q, explain it in terms of short-term cost and future queue length.
Results to retain
A comparison table for both configurations and a plot of the selected action for each q.
Items to record and points to check
γ
Evaluation return
Mean queue length
Capacity²
Dropped items
q values where the policy changed
Points to check
Did you keep the training budget unchanged?
Did you compare policies on a common evaluation set rather than one chance episode?
3. Apply this to your research problem
Starting conditions
Based on the preceding experiments, choose Queue, Motor, or one of your research problems and design an experiment for real application.
Procedure
Define state, observation, action, reward, termination, and time limit in one table. Record each variable's units and the information you can actually obtain.
Write 3 expected transitions numerically and check whether rewards for good and bad actions match your intent.
Choose one rule-based comparison baseline, one evaluation condition, and one failure case of greatest concern. Also list the required measurements or simulator.
Results to retain
MDP design table, 3 transition examples, and comparative experiment plan.
If real research data are unavailable, design using synthetic conditions from an application case.
You may continue with the research problem and design table selected earlier. Revisit existing entries and transition examples using the concepts learned in this activity, and update changed entries or reasons for retaining them.
Items to record and points to check
Item
Concrete definition and units
Observability and verification method
Points to check
Did you exclude future information and evaluation labels from observations?
Did you define domain-specific metrics rather than judging the research contribution solely by training return?