## Problem Description and Formulation

The company produces two products: action figures and toy cars. The goal is to maximize earnings given the production constraints.

### Variables
- \(x\): Number of action figures produced
- \(y\): Number of toy cars produced

### Objective Function
Maximize earnings: \(2x + 3y\)

### Constraints
1. Production time: \(5x + 8y \leq 1000\)
2. Plastic cost: \(2x + 2.5y \leq 1000\)
3. Non-negativity: \(x \geq 0, y \geq 0\)
4. Integer solutions: \(x \in \mathbb{Z}, y \in \mathbb{Z}\) (though not explicitly stated, we'll assume integer solutions are required since partial products are unlikely)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(name="action_figures", vtype=gurobi.GRB.INTEGER)
    y = model.addVar(name="toy_cars", vtype=gurobi.GRB.INTEGER)

    # Objective function: Maximize earnings
    model.setObjective(2 * x + 3 * y, sense=gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(5 * x + 8 * y <= 1000, name="production_time")
    model.addConstr(2 * x + 2.5 * y <= 1000, name="plastic_cost")
    model.addConstr(x >= 0, name="non_negativity_x")
    model.addConstr(y >= 0, name="non_negativity_y")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: action figures = {x.varValue}, toy cars = {y.varValue}")
        print(f"Max earnings: ${model.objVal:.2f}")
    else:
        print("No optimal solution found")

solve_production_problem()
```

This code defines the optimization problem as described, using Gurobi's Python interface. It sets up the model with the correct objective function and constraints, then solves it. The solution is printed out, including the optimal number of action figures and toy cars to produce, and the maximum earnings achievable.