=== Instruction 1 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving object manipulation. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of specific objects, namely two tomatoes and a plate. 

The task consists of a series of steps: first, it pulls a top drawer, then picks the first tomato and places it on the plate, followed by picking the second tomato and placing it on the plate as well. After each action, it checks if the task is completed and prints appropriate messages. Finally, it ensures that the environment is shut down properly after the task execution. The overall behavior is to simulate a sequence of actions involving picking and placing objects in a controlled environment.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - **TASK**: Describes a specific instruction for a robot to follow, focusing on the actions of opening a drawer and placing tomatoes on a plate.
   - **CODE_FUNC**: Describes a function that simulates a sequence of actions involving object manipulation, including setup, execution, and cleanup.

2. **Level of Detail**:
   - **TASK**: Provides a high-level instruction without detailing the underlying mechanics or sequence of actions.
   - **CODE_FUNC**: Provides a detailed breakdown of the steps involved in the simulation, including initialization, action execution, and task completion checks.

3. **Action Sequence**:
   - **TASK**: Specifies a single sequence of actions (open drawer, place tomatoes).
   - **CODE_FUNC**: Describes multiple actions in a sequence (pull drawer, pick and place each tomato) and includes checks for task completion.

4. **Environment Setup**:
   - **TASK**: Assumes an environment is already set up for the instruction to be executed.
   - **CODE_FUNC**: Explicitly mentions setting up the environment and resetting the task to its initial state.

5. **Object Interaction**:
   - **TASK**: Focuses on the interaction with tomatoes and a plate.
   - **CODE_FUNC**: Involves interaction with multiple objects (drawer, tomatoes, plate) and includes the manipulation of the drawer.

6. **Completion Check**:
   - **TASK**: Does not include any mechanism for checking if the task is completed.
   - **CODE_FUNC**: Includes checks after each action to determine if the task is completed.

7. **Output Messages**:
   - **TASK**: Does not specify any output or feedback mechanism.
   - **CODE_FUNC**: Mentions printing appropriate messages after actions to indicate progress or completion.

8. **Shutdown Procedure**:
   - **TASK**: Does not include any mention of shutting down or cleaning up the environment.
   - **CODE_FUNC**: Explicitly states that the environment is shut down properly after task execution.

9. **Video Recording**:
   - **TASK**: Does not mention any form of recording or monitoring.
   - **CODE_FUNC**: Includes an optional step for initializing video recording during the simulation.

10. **Functionality**:
    - **TASK**: Represents a single task instruction.
    - **CODE_FUNC**: Represents a complete function that encompasses multiple tasks and their management within a simulation framework.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment

from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define positions for the tomatoes and the plate
        tomato1_pos = positions['item1']
        tomato2_pos = positions['item2']
        plate_pos = positions['plate']
        
        # Step 1: Pull the top drawer
        print("[Task] Pulling the top drawer.")
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='y')
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 2: Pick the first tomato
        print("[Task] Picking tomato1.")
        obs, reward, done = pick(env, task, target_pos=tomato1_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking tomato1!")
            return

        # Step 3: Place the first tomato on the plate
        print("[Task] Placing tomato1 on the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after placing tomato1!")
            return

        # Step 4: Pick the second tomato
        print("[Task] Picking tomato2.")
        obs, reward, done = pick(env, task, target_pos=tomato2_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking tomato2!")
            return

        # Step 5: Place the second tomato on the plate
        print("[Task] Placing tomato2 on the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")
-------------------

=== Instruction 2 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving object manipulation. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of objects in the environment and attempts to pull open an unlocked drawer. If successful, it proceeds to place two tomatoes onto a designated plate, checking for success after each placement. Finally, it ensures that the environment is properly shut down before concluding the task. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Nature of Content**: TASK is a detailed PDDL (Planning Domain Definition Language) representation of a robotic task, while CODE_FUNC is a high-level description of a function that simulates the task.
2. **Level of Abstraction**: TASK provides a low-level, formal representation of actions, predicates, and conditions, whereas CODE_FUNC describes the overall flow and purpose of the simulation in a more abstract manner.
3. **Specificity of Actions**: TASK specifies individual actions (e.g., `pull`, `pick-drawer`, `place`) with preconditions and effects, while CODE_FUNC summarizes the actions without detailing their conditions or effects.
4. **Contextual Information**: TASK includes specific domain knowledge (e.g., types of objects, predicates related to drawers), while CODE_FUNC lacks this detailed contextual information and focuses on the simulation process.
5. **Execution Environment**: TASK is designed for a planning system that interprets PDDL, while CODE_FUNC is intended for execution in a programming environment, likely involving a simulation framework.
6. **Error Handling**: TASK does not mention error handling or success checks, while CODE_FUNC explicitly states that it checks for success after each placement of tomatoes.
7. **Initialization Details**: TASK includes specific initialization of objects and their states in the PDDL format, while CODE_FUNC describes a more general initialization process without specific details on object states.
8. **Output and Conclusion**: TASK does not specify any output or conclusion mechanism, while CODE_FUNC mentions ensuring the environment is properly shut down before concluding the task.
9. **Execution Trigger**: TASK does not specify how it is triggered or executed, while CODE_FUNC states that it is executed when the script is run directly.

Overall, the two representations serve different purposes and audiences, with TASK being more technical and formal, and CODE_FUNC being more descriptive and high-level.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment
from skill_code import pull, place
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Pull open any unlocked drawer
        print("[Task] Attempting to pull open an unlocked drawer.")
        obs, _, done = pull(env, task, pull_distance=0.1, pull_axis='y', max_steps=100, threshold=0.01, timeout=10.0)
        if done:
            print("[Task] Drawer opened successfully!")
        else:
            print("[Task] Failed to open the drawer.")
            return

        # Place the first tomato onto the plate
        print("[Task] Placing tomato1 onto the plate.")
        obs, _, done = place(env, task, target_pos=positions['plate'], approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] tomato1 placed successfully!")
        else:
            print("[Task] Failed to place tomato1.")

        # Place the second tomato onto the plate
        print("[Task] Placing tomato2 onto the plate.")
        obs, _, done = place(env, task, target_pos=positions['plate'], approach_distance=0.15, max_steps=100, threshold=0.01, approach_axis='z', timeout=10.0)
        if done:
            print("[Task] tomato2 placed successfully!")
        else:
            print("[Task] Failed to place tomato2.")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 3 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function that simulates a task in a virtual environment. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of various objects in the environment.

The task consists of several steps: first, it pulls a top drawer, then picks up two tomatoes sequentially, and finally places each tomato on a designated plate. After each action, it checks if the task is completed and prints appropriate messages. If the task is completed at any step, it exits early. Finally, the environment is shut down to ensure proper cleanup. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Nature of Content**: TASK is a detailed instruction set for a specific action sequence, while CODE_FUNC describes a function that simulates a task in a virtual environment.
2. **Format**: TASK is presented in a structured format (PDDL), while CODE_FUNC is written in a narrative format describing the function's behavior.
3. **Purpose**: TASK is designed to define actions and their conditions in a planning domain, whereas CODE_FUNC is intended to implement and execute a simulation of those actions.
4. **Level of Abstraction**: TASK operates at a higher level of abstraction, focusing on the planning and logical structure of actions, while CODE_FUNC deals with the implementation details and execution flow.
5. **Execution Context**: TASK is a domain definition that can be used by a planner, while CODE_FUNC is a procedural implementation that runs in a programming environment.
6. **Action Specification**: TASK specifies actions with preconditions and effects, while CODE_FUNC describes the sequence of actions without formal preconditions or effects.
7. **State Management**: TASK defines the initial state and conditions for actions, while CODE_FUNC manages state through procedural steps and checks during execution.
8. **Output**: TASK does not produce output in the traditional sense but defines the effects of actions, while CODE_FUNC includes print statements to provide feedback during execution.
9. **Error Handling**: TASK does not include error handling mechanisms, while CODE_FUNC may include checks for task completion and early exits.
10. **Environment Interaction**: TASK describes interactions in a logical framework, while CODE_FUNC describes interactions in a simulated environment with specific object manipulations.

In summary, the semantic differences between TASK and CODE_FUNC are significant, reflecting their distinct purposes and formats.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment
from skill_code import *
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        descriptions, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions
        plate_pos = positions['plate']
        
        # Step 1: Pull the top drawer
        print("[Task] Pulling the top drawer.")
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='x')
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 2: Pick up tomato1
        print("[Task] Picking up tomato1.")
        obs, reward, done = pick(env, task, target_pos=positions['item1'], approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking up tomato1!")
            return

        # Step 3: Pick up tomato2
        print("[Task] Picking up tomato2.")
        obs, reward, done = pick(env, task, target_pos=positions['item2'], approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking up tomato2!")
            return

        # Step 4: Place tomato1 on the plate
        print("[Task] Placing tomato1 on the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after placing tomato1!")
            return

        # Step 5: Place tomato2 on the plate
        print("[Task] Placing tomato2 on the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

=== Instruction 4 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving object manipulation. It begins by setting up the environment and resetting the task to its initial state. Video recording is optionally initialized to capture the simulation. The positions of various objects, such as a table, plate, and tomatoes, are retrieved.

The task consists of a series of steps: first, the top drawer is opened; then, the first tomato is picked and placed on the plate; next, the second tomato is picked and also placed on the plate. After each action, the code checks if the task is completed and prints appropriate messages. Finally, the environment is shut down to ensure proper cleanup. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - TASK describes a specific sequence of actions to achieve a goal (unlocking a cabinet and transferring tomatoes).
   - CODE_FUNC outlines a function that simulates the execution of a task involving object manipulation.

2. **Structure**: 
   - TASK is presented in a PDDL format, defining a domain and problem with types, predicates, and actions.
   - CODE_FUNC is described in a narrative format, detailing the steps of a simulation without formal structure.

3. **Detail Level**: 
   - TASK includes detailed definitions of types, predicates, and actions necessary for planning and execution in a robotic context.
   - CODE_FUNC provides a high-level overview of the simulation process without delving into the specifics of the underlying logic or structure.

4. **Execution Context**: 
   - TASK is designed for a planning system that uses PDDL to determine how to achieve the goal.
   - CODE_FUNC is intended for execution in a programming environment, likely involving a simulation framework.

5. **Action Specification**: 
   - TASK specifies actions with preconditions and effects, allowing for automated planning.
   - CODE_FUNC describes actions in a procedural manner, focusing on the sequence of operations rather than their logical conditions.

6. **State Management**: 
   - TASK defines the initial state and the effects of actions on that state in a formal way.
   - CODE_FUNC mentions resetting the task to its initial state but does not formalize how state changes are managed.

7. **Output**: 
   - TASK does not specify output messages or feedback mechanisms.
   - CODE_FUNC includes checks for task completion and prints messages based on the progress of the simulation.

8. **Environment Interaction**: 
   - TASK focuses on the logical representation of actions and their effects in a domain.
   - CODE_FUNC emphasizes the practical execution of those actions within a simulated environment.

9. **Flexibility**: 
   - TASK is more flexible in terms of planning, as it can be adapted for various scenarios based on the defined predicates and actions.
   - CODE_FUNC is more rigid, as it follows a specific sequence of operations without the ability to adapt dynamically based on conditions.

10. **Language**: 
    - TASK uses a formal language (PDDL) that is specific to planning and robotics.
    - CODE_FUNC uses natural language to describe the function, making it more accessible but less precise in terms of formal logic.

In summary, the semantic differences between TASK and CODE_FUNC are significant, reflecting their distinct purposes, structures, and contexts.

Refined Code Generated:
-------------------
import numpy as np
from env import setup_environment, shutdown_environment
from skill_code import pick, place, pull  # Importing specific skills
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define object positions based on the retrieved data
        plate_pos = positions['plate']
        tomato1_pos = positions['item1']
        tomato2_pos = positions['item2']
        top_drawer_pos = positions['top_anchor_pos']

        # Step 1: Pull to open the top drawer
        print("[Task] Opening the top drawer...")
        obs, reward, done = pull(env, task, pull_distance=0.1, pull_axis='y')
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 2: Pick the first tomato
        print("[Task] Picking tomato1...")
        obs, reward, done = pick(env, task, target_pos=tomato1_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking tomato1!")
            return

        # Step 3: Place the first tomato on the plate
        print("[Task] Placing tomato1 on the plate...")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after placing tomato1!")
            return

        # Step 4: Pick the second tomato
        print("[Task] Picking tomato2...")
        obs, reward, done = pick(env, task, target_pos=tomato2_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking tomato2!")
            return

        # Step 5: Place the second tomato on the plate
        print("[Task] Placing tomato2 on the plate...")
        obs, reward, done = place(env, task, target_pos=plate_pos, approach_distance=0.15)
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")
-------------------

=== Instruction 5 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task involving the manipulation of objects in an environment. It begins by setting up the environment and resetting the task to its initial state. It optionally initializes video recording for the simulation. The function retrieves the positions of specific objects, including two tomatoes and a plate.

The task consists of a series of steps: first, it pulls open a drawer, then picks up the first tomato and places it on the plate, followed by picking up the second tomato and placing it on the plate as well. After each action, it checks if the task is completed and prints appropriate messages. Finally, it ensures that the environment is properly shut down after the task execution. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - **TASK**: Describes a specific instruction for a robot to perform a sequence of actions involving drawers and tomatoes.
   - **CODE_FUNC**: Describes a function that simulates the execution of a task involving object manipulation in a programming context.

2. **Structure**: 
   - **TASK**: Presented in a natural language format followed by a formal PDDL representation.
   - **CODE_FUNC**: Presented as a description of a programming function, detailing its operational flow and logic.

3. **Action Sequence**: 
   - **TASK**: Specifies the actions in a direct manner (slide open drawer, toss tomatoes).
   - **CODE_FUNC**: Outlines a more structured sequence of actions (pull drawer, pick up tomatoes, place on plate) with checks and messages.

4. **Environment Setup**: 
   - **TASK**: Does not explicitly mention the setup of the environment or initial states.
   - **CODE_FUNC**: Includes details about initializing the environment and resetting the task state.

5. **Feedback Mechanism**: 
   - **TASK**: Does not include any feedback or confirmation of actions.
   - **CODE_FUNC**: Mentions checking if the task is completed and printing messages after actions.

6. **Execution Context**: 
   - **TASK**: Implies a robotic context where actions are performed based on instructions.
   - **CODE_FUNC**: Implies a programming context where the function is executed within a script.

7. **Finalization**: 
   - **TASK**: Does not mention any finalization or cleanup steps.
   - **CODE_FUNC**: Includes a step to ensure proper shutdown of the environment after task execution.

8. **Level of Detail**: 
   - **TASK**: Provides a high-level overview of the actions without delving into specifics.
   - **CODE_FUNC**: Provides a detailed breakdown of the steps involved in the simulation task.

9. **Object Interaction**: 
   - **TASK**: Focuses on the interaction with tomatoes and a plate.
   - **CODE_FUNC**: Involves interaction with a drawer, tomatoes, and a plate, but also includes the gripper and positions.

10. **Initialization of Video Recording**: 
    - **TASK**: Does not mention video recording.
    - **CODE_FUNC**: Mentions optional initialization of video recording for the simulation.

In summary, the semantic differences between TASK and CODE_FUNC are significant, reflecting their distinct purposes, structures, and contexts.

Refined Code Generated:
-------------------
import numpy as np
from pyrep.objects.shape import Shape
from pyrep.objects.proximity_sensor import ProximitySensor

from env import setup_environment, shutdown_environment

from skill_code import *  # Importing predefined skills
from video import init_video_writers, recording_step, recording_get_observation
from object_positions import get_object_positions

def run_skeleton_task():
    '''Generic skeleton for running any task in your simulation.'''
    print("===== Starting Skeleton Task =====")
    
    # === Environment Setup ===
    env, task = setup_environment()
    try:
        # Reset the task to its initial state
        _, obs = task.reset()

        # (Optional) Initialize video writers for capturing your simulation
        init_video_writers(obs)

        # Wrap the task steps for recording (if needed)
        original_step = task.step
        task.step = recording_step(original_step)
        original_get_obs = task.get_observation
        task.get_observation = recording_get_observation(original_get_obs)

        # === Retrieve Object Positions ===
        positions = get_object_positions()

        # Define positions for the items and plate
        item1_pos = positions['item1']
        item2_pos = positions['item2']
        plate_pos = positions['plate']

        # === Execute the Plan ===
        # Step 1: Pull open the bottom drawer
        print("[Task] Pulling open the bottom drawer.")
        obs, reward, done = pull(env, task, pull_distance=0.5, pull_axis='z')
        if done:
            print("[Task] Task ended after pulling the drawer!")
            return

        # Step 2: Pick the first tomato
        print("[Task] Picking tomato1 from the table.")
        obs, reward, done = pick(env, task, target_pos=item1_pos)
        if done:
            print("[Task] Task ended after picking tomato1!")
            return

        # Step 3: Place the first tomato onto the plate
        print("[Task] Placing tomato1 onto the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos)
        if done:
            print("[Task] Task ended after placing tomato1!")
            return

        # Step 4: Pick the second tomato
        print("[Task] Picking tomato2 from the table.")
        obs, reward, done = pick(env, task, target_pos=item2_pos)
        if done:
            print("[Task] Task ended after picking tomato2!")
            return

        # Step 5: Place the second tomato onto the plate
        print("[Task] Placing tomato2 onto the plate.")
        obs, reward, done = place(env, task, target_pos=plate_pos)
        print("[Task] Task completed successfully! Reward:", reward)

    finally:
        # Always ensure the environment is properly shutdown
        shutdown_environment(env)

    print("===== End of Skeleton Task =====")

if __name__ == "__main__":
    run_skeleton_task()
-------------------

