All submissions must be made through Kaggle. Each participant must submit exactly two notebooks:

### A. Training Notebook
This notebook serves as proof of training and acts as an audit trail. It must include:
* Definition and implementation of the environment (e.g., using Gymnasium, PyGame).
* The training loop for the agent.
* A clear, visible learning curve (e.g., reward vs. episode, loss vs. epoch).
* Code to save the trained model weights.

### B. Evaluation Notebook 
This notebook runs your trained agent against the automated judge to generate your leaderboard score.

**Step 1: Create `submission.py`**
You must generate a file named `submission.py` in your Kaggle working directory. It must contain a class named `Solution` with an `__init__` method (to load your weights) and a `predict` method (to return actions). 

**CRITICAL:** The evaluation environment will *always* pass an array of exactly **16 dimensions** to your `predict` function. If your model expects a different size, it will crash. You must slice, pad, or filter this array inside `predict` before passing it to your model.

*Example format:*
```python
# 1. Create the submission.py file
submission_code = """
import numpy as np
# Import your libraries (torch, tensorflow, stable_baselines3, etc.)

class Solution:
    def __init__(self):
        # Load your weights for different level types
        # self.model_nav = ...
        # self.model_fuel = ...
        pass

    def predict(self, observation):
        
        #The judge passes a 16-element array.
        #Use index [10] (Status) and [11] (Timer) to identify the level.
        
        # Identification Logic (The Switchboard)
        fuel_val = observation[10]
        timer_val = observation[11]

        # Case A: Level 14 (Solar Flare)
        if timer_val > 0:
            # action = self.model_flare.predict(observation)
            return np.array([0.0, 0.0])

        # Case B: Level 5 (Fuel Navigation)
        if fuel_val > 1.0:
            # action = self.model_fuel.predict(observation)
            return np.array([0.1, 0.1])

        # Case C: Level 2 (Toggle Switch)
        if fuel_val == 0.0 or fuel_val == 1.0:
            # action = self.model_toggle.predict(observation)
            return np.array([0.5, 0.5])

        # Default: General Navigation
        return np.array([1.0, 1.0])

"""

with open("submission.py", "w") as f:
    f.write(submission_code)

```

**Step 2: Add the Judge Dataset**

On the right-hand sidebar of your Kaggle Notebook, click Add Input.

Search for the public dataset named: Cosmic Carnage Judge.

Click the + icon to add it to your notebook environment.

Add the following code in the final cell of your notebook and run it:

```python

import sys
sys.path.append("/kaggle/input/cosmic-carnage-judge")

import cosmic_judge

cosmic_judge.run_full_competition_for_kaggle(submission_folder=".")
```

**Note:** The Kaggle Leaderboard updates automatically. However, winning notebooks will be manually audited. Any attempt to bypass the auto-judge in any way instead of a trained agent, will result in immediate disqualification.