## Problem Description and Formulation

The problem is a classic example of a linear programming problem. We need to maximize the number of action figures that can be stored given the constraints on space and budget.

Let's define the decision variables:
- `x`: the number of small shelves to buy
- `y`: the number of large shelves to buy

The objective function to maximize is the total number of action figures that can be stored:
- `20x + 30y` (since a small shelf can hold 20 action figures and a large shelf can hold 30 action figures)

The constraints are:
- Space constraint: `3x + 6y <= 100` (since a small shelf takes 3 sq ft and a large shelf takes 6 sq ft, and there are 100 sq ft available)
- Budget constraint: `50x + 80y <= 1250` (since a small shelf costs $50 and a large shelf costs $80, and there is a budget of $1250)
- Non-negativity constraints: `x >= 0, y >= 0` (since we cannot buy a negative number of shelves)

## Gurobi Code

```python
import gurobi

def solve_shelf_problem():
    # Create a new model
    model = gurobi.Model()

    # Define the decision variables
    x = model.addVar(lb=0, name="small_shelves")  # number of small shelves
    y = model.addVar(lb=0, name="large_shelves")  # number of large shelves

    # Objective function: maximize the number of action figures
    model.setObjective(20*x + 30*y, gurobi.GRB.MAXIMIZE)

    # Space constraint: 3x + 6y <= 100
    model.addConstr(3*x + 6*y <= 100, name="space_constraint")

    # Budget constraint: 50x + 80y <= 1250
    model.addConstr(50*x + 80*y <= 1250, name="budget_constraint")

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: x = {x.varValue}, y = {y.varValue}")
        print(f"Maximum number of action figures: {20*x.varValue + 30*y.varValue}")
    else:
        print("No optimal solution found")

solve_shelf_problem()
```