## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The woodshop aims to maximize its profit by producing the optimal number of dining tables and bed frames given the available oak and mahogany wood.

Let's define the decision variables:
- \(x\): the number of dining tables to be produced
- \(y\): the number of bed frames to be produced

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 300x + 400y \]

Subject to the constraints:
1. Oak wood availability: \( 3x + 5y \leq 300 \)
2. Mahogany wood availability: \( 5x + 2y \leq 400 \)
3. Non-negativity constraints: \( x \geq 0, y \geq 0 \)

## Gurobi Code

To solve this problem using Gurobi in Python, we will use the Gurobi Python API. First, ensure you have Gurobi installed in your Python environment. You can install it via pip:
```bash
pip install gurobi
```

Here's the Gurobi code for the problem:

```python
import gurobi as gp

# Create a new model
model = gp.Model("Woodshop_Optimization")

# Define the decision variables
x = model.addVar(name="dining_tables", lb=0, vtype=gp.GRB.CONTINUOUS)
y = model.addVar(name="bed_frames", lb=0, vtype=gp.GRB.CONTINUOUS)

# Define the objective function
model.setObjective(300*x + 400*y, gp.GRB.MAXIMIZE)

# Add constraints
model.addConstr(3*x + 5*y <= 300, name="oak_wood_constraint")
model.addConstr(5*x + 2*y <= 400, name="mahogany_wood_constraint")

# Optimize the model
model.optimize()

# Check if the model is optimized
if model.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Dining Tables: {x.varValue}")
    print(f"Bed Frames: {y.varValue}")
    print(f"Max Profit: {model.objVal}")
else:
    print("The model is infeasible or unbounded.")
```

This code defines the optimization problem as described, sets up the model with Gurobi, and solves it. The solution will provide the number of dining tables and bed frames the woodshop should produce to maximize profit, given the available wood.