=== 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 various objects needed for the task, including a plate, two items (tomatoes), a switch, and a bin.

The task consists of a series of steps: first, it closes a gripper, then presses a switch to turn on a light, picks up the first item (a tomato), and places it on the plate. Next, it picks up the second tomato and places it on the plate as well. After each action, the function 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 object manipulation actions in a controlled environment.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - TASK describes a specific instruction for a robot to perform (putting tomatoes on a plate).
   - CODE_FUNC outlines a function that simulates a series of actions to achieve a similar goal but includes additional setup and teardown processes.

2. **Structure**: 
   - TASK is defined in PDDL format, focusing on the planning domain and problem.
   - CODE_FUNC is a narrative description of a function, detailing the procedural steps taken during the simulation.

3. **Detail Level**: 
   - TASK includes specific predicates, actions, and preconditions relevant to the robot's capabilities and environment.
   - CODE_FUNC provides a high-level overview of the simulation process without delving into the specifics of the actions or their conditions.

4. **Execution Context**: 
   - TASK is designed for a planning system that interprets PDDL to generate a sequence of actions.
   - CODE_FUNC is intended for execution in a programming environment, simulating the actions programmatically.

5. **Action Sequence**: 
   - TASK does not explicitly list the sequence of actions but implies them through the defined actions in the domain.
   - CODE_FUNC explicitly describes the sequence of actions taken (closing the gripper, pressing the switch, picking up tomatoes, placing them on the plate).

6. **Environment Interaction**: 
   - TASK includes conditions like "dark" that affect the ability to perform actions.
   - CODE_FUNC mentions the interaction with the environment but does not specify conditions affecting the actions in detail.

7. **Output**: 
   - TASK does not specify any output or feedback mechanism.
   - CODE_FUNC mentions printing messages to indicate task completion and status updates.

8. **Initialization and Cleanup**: 
   - TASK does not include any initialization or cleanup steps.
   - CODE_FUNC includes steps for initializing the environment and shutting it down after task execution.

9. **Object Retrieval**: 
   - TASK assumes the objects are already in place as per the initial state.
   - CODE_FUNC describes retrieving the positions of objects before performing actions.

10. **Simulation Aspect**: 
    - TASK is focused on the planning aspect of robot actions.
    - CODE_FUNC emphasizes the simulation aspect, including video recording and task execution monitoring.

In summary, while both TASK and CODE_FUNC aim to achieve the same end goal of manipulating tomatoes, they differ significantly in structure, detail, execution context, and the level of abstraction.

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 close_gripper, press, pick, 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()

        # Define object positions
        plate_pos = positions['plate']
        item1_pos = positions['item1']
        tomato2_pos = positions['tomato2']
        switch_pos = positions['switch']

        # === Task Plan Execution ===
        # Step 1: Close the gripper
        print("[Task] Closing gripper...")
        obs, reward, done = close_gripper(env, task)
        if done:
            print("[Task] Task ended after closing gripper!")
            return

        # Step 2: Press the switch to turn on the light
        print("[Task] Pressing the switch...")
        obs, reward, done = press(env, task, switch_pos)
        if done:
            print("[Task] Task ended after pressing the switch!")
            return

        # Step 3: Pick item1 (first tomato)
        print("[Task] Picking item1...")
        obs, reward, done = pick(env, task, item1_pos)
        if done:
            print("[Task] Task ended after picking item1!")
            return

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

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

        # Step 6: Place tomato2 on the plate
        print("[Task] Placing tomato2 on the plate...")
        obs, reward, done = place(env, task, plate_pos)
        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 specific objects, including two items and a plate. 

The task consists of a series of steps: first, it picks up an item from the table, then places it onto a plate. Next, it picks up another item from the table and places it onto the same plate. 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 defines a specific problem in a planning domain, while CODE_FUNC describes a function for simulating a task.
2. **Structure**: TASK is structured in PDDL (Planning Domain Definition Language) format, whereas CODE_FUNC is written in a programming language (likely Python).
3. **Components**: TASK includes definitions of actions, predicates, and types, while CODE_FUNC focuses on the procedural steps to execute a simulation.
4. **Execution**: TASK outlines preconditions and effects for actions, while CODE_FUNC describes a sequence of operations without formal preconditions or effects.
5. **Environment Setup**: TASK specifies the initial state and actions in a domain context, while CODE_FUNC describes setting up a simulation environment and resetting states.
6. **Output**: TASK does not specify output messages, while CODE_FUNC includes print statements to indicate task completion.
7. **Action Details**: TASK includes detailed action definitions (e.g., pick, place) with conditions, while CODE_FUNC summarizes actions without detailing their conditions or effects.
8. **Focus**: TASK focuses on the logical representation of a problem, while CODE_FUNC emphasizes the procedural execution of a task in a simulation context.

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 pick, 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
        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
        item1_pos = positions['item1']
        tomato2_pos = positions['tomato2']
        plate_pos = positions['plate']

        # === Execute the Plan ===
        # Step 1: Pick item2 from the table
        print("[Task] Picking item2 from the table.")
        obs, reward, done = pick(env, task, target_pos=item1_pos, approach_distance=0.15)
        if done:
            print("[Task] Task ended after picking item2!")
            return

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

        # Step 3: Pick tomato2 from the table
        print("[Task] Picking tomato2 from the table.")
        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 4: Place tomato2 onto the plate
        print("[Task] Placing tomato2 onto 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 3 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task in a controlled 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 needed for the task.

The task consists of a series of steps: first, it closes a gripper, then presses a switch to turn on a light, picks up a tomato, places it on a plate, picks up a second tomato, and finally places that tomato on the plate as well. After each step, it checks if the task is completed and prints appropriate messages. If the task ends at any step, it exits early. Finally, it ensures that the environment is properly shut down after the task is completed or if an error occurs. The function is executed when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - TASK is a formal representation of a robot's actions in a PDDL (Planning Domain Definition Language) format, defining the environment, actions, and conditions for a robot to perform a specific task.
   - CODE_FUNC describes a procedural function that simulates the execution of a task in a controlled environment, detailing the steps taken to complete the task.

2. **Structure**: 
   - TASK is structured in a declarative format, using predicates, actions, and conditions to define the robot's capabilities and the environment.
   - CODE_FUNC is structured in an imperative format, outlining a sequence of operations to be executed in a programming context.

3. **Execution**: 
   - TASK does not specify how the actions are executed; it only defines what actions can be taken under what conditions.
   - CODE_FUNC explicitly describes the execution of actions in a step-by-step manner, including checks for task completion and error handling.

4. **Environment Setup**: 
   - TASK includes a domain definition and an initial state setup for the robot's environment.
   - CODE_FUNC mentions setting up the environment and resetting the task but does not define the environment in a formal way like TASK does.

5. **Action Details**: 
   - TASK defines actions (pick, place, close_gripper, press) with preconditions and effects in a formal manner.
   - CODE_FUNC describes actions in a more narrative way, focusing on the sequence of operations without formal preconditions and effects.

6. **Error Handling**: 
   - TASK does not include any error handling or early exit conditions.
   - CODE_FUNC includes checks for task completion and early exit if the task ends at any step, as well as ensuring proper shutdown of the environment.

7. **Output**: 
   - TASK does not specify any output or feedback mechanism.
   - CODE_FUNC includes print statements to provide feedback on the task's progress and completion.

8. **Focus**: 
   - TASK focuses on the logical representation of actions and their relationships in a planning context.
   - CODE_FUNC focuses on the practical implementation of a simulation task, detailing how to carry out the actions programmatically.

9. **Language**: 
   - TASK uses PDDL, which is a specialized language for describing planning problems.
   - CODE_FUNC is written in a general-purpose programming language (not specified), which is used for implementing the simulation.

10. **Object Interaction**: 
    - TASK defines interactions with objects in terms of predicates and effects.
    - CODE_FUNC describes interactions with objects in a procedural manner, detailing the sequence of actions taken with those objects.

In summary, the semantic differences between TASK and CODE_FUNC are significant, as they serve different purposes and are structured in different ways.

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 close_gripper, press, pick, 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()

        # Define object positions
        item1_pos = positions['item1']
        tomato2_pos = positions['tomato2']
        plate_pos = positions['plate']
        switch_pos = positions['switch']

        # === Task Plan Execution ===
        # Step 1: Close the gripper
        print("[Task] Closing gripper...")
        obs, reward, done = close_gripper(env, task)
        if done:
            print("[Task] Task ended after closing gripper!")
            return

        # Step 2: Press the switch to turn on the light
        print("[Task] Pressing the switch...")
        obs, reward, done = press(env, task, switch_pos)
        if done:
            print("[Task] Task ended after pressing the switch!")
            return

        # Step 3: Pick item1 (tomato)
        print("[Task] Picking item1 (tomato)...")
        obs, reward, done = pick(env, task, item1_pos)
        if done:
            print("[Task] Task ended after picking item1!")
            return

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

        # Step 5: Pick tomato2
        print("[Task] Picking tomato2...")
        obs, reward, done = pick(env, task, tomato2_pos)
        if done:
            print("[Task] Task ended after picking tomato2!")
            return

        # Step 6: Place tomato2 on the plate
        print("[Task] Placing tomato2 on the plate...")
        obs, reward, done = place(env, task, plate_pos)
        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 4 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function that simulates a task in a robotic 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, namely a tomato and a plate. 

The task consists of two main steps: first, it attempts to pick up the tomato from a table, and if successful, it then places the tomato onto the plate. After each action, it checks if the task is completed and prints appropriate messages based on the outcome. Finally, it ensures that the environment is properly shut down before concluding the task.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: TASK describes a specific instruction for a robot to follow, while CODE_FUNC outlines a function that simulates the execution of such a task in a robotic environment.
2. **Structure**: TASK is presented in a PDDL format defining actions, predicates, and the problem domain, whereas CODE_FUNC is a narrative description of a function's behavior and logic.
3. **Detail Level**: TASK includes detailed preconditions and effects for actions (e.g., pick and place), while CODE_FUNC provides a high-level overview without specifying the underlying logic or conditions for actions.
4. **Execution Context**: TASK is a formal representation meant for planning and execution in a robotic system, while CODE_FUNC describes a simulation of the task rather than the task itself.
5. **Outcome Handling**: TASK does not mention how outcomes are handled or reported, while CODE_FUNC explicitly states that it checks for task completion and prints messages based on the outcome.
6. **Environment Setup**: TASK includes the initial state of the environment in a structured format, while CODE_FUNC describes the setup and reset of the environment in a more general sense.
7. **Object Interaction**: TASK specifies the interaction with objects (e.g., transferring tomatoes), while CODE_FUNC describes the process of picking and placing without detailing the interaction rules.
8. **Focus**: TASK focuses on the logical representation of actions and their conditions, while CODE_FUNC focuses on the procedural aspect of simulating those actions in a programmatic context.

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 pick, 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
        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
        tomato1_pos = positions['item1']
        tomato2_pos = positions['tomato2']
        plate_pos = positions['plate']

        # === Execute the Plan ===
        # Step 1: Pick the item1 (first tomato) from the table
        print("[Task] Picking item1 from the table.")
        obs, reward, done = pick(
            env,
            task,
            target_pos=tomato1_pos,
            approach_distance=0.15,
            max_steps=100,
            threshold=0.01,
            approach_axis='z',
            timeout=10.0
        )
        if done:
            print("[Task] Task ended after picking item1!")
            return

        # Step 2: Place the item1 onto the plate
        print("[Task] Placing item1 onto the plate.")
        obs, reward, done = place(
            env,
            task,
            target_pos=plate_pos,
            approach_distance=0.15,
            max_steps=100,
            threshold=0.01,
            approach_axis='z',
            timeout=10.0
        )
        if done:
            print("[Task] Task completed successfully! Reward:", reward)
        else:
            print("[Task] Task not completed yet (done=False).")

        # Step 3: Pick the tomato2 from the table
        print("[Task] Picking tomato2 from the table.")
        obs, reward, done = pick(
            env,
            task,
            target_pos=tomato2_pos,
            approach_distance=0.15,
            max_steps=100,
            threshold=0.01,
            approach_axis='z',
            timeout=10.0
        )
        if done:
            print("[Task] Task ended after picking tomato2!")
            return

        # Step 4: Place the tomato2 onto the plate
        print("[Task] Placing tomato2 onto the plate.")
        obs, reward, done = place(
            env,
            task,
            target_pos=plate_pos,
            approach_distance=0.15,
            max_steps=100,
            threshold=0.01,
            approach_axis='z',
            timeout=10.0
        )
        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 5 ===
Is Correct: False
Syntax Pass: False
Code Function: The code defines a function to run a simulation task in a robotic 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 needed for the task.

The task consists of a series of steps: first, it closes a gripper, then presses a switch to turn on a light, picks up an item from a table, places that item onto a plate, picks up another item, and finally places that second item onto the plate. After each action, it checks if the task is complete and prints appropriate messages. If the task is completed successfully, it displays the reward received.

Regardless of the outcome, the function ensures that the environment is properly shut down at the end. The main execution of the function is triggered when the script is run directly.
Similarity: {'ok': False, 'reason': 'LLM JSON parsing failed.'}
Differences: 1. **Purpose**: 
   - TASK defines a specific action sequence for a robot to perform (tossing tomatoes), while CODE_FUNC describes a function that simulates a broader set of actions in a robotic environment.

2. **Structure**: 
   - TASK is structured in PDDL (Planning Domain Definition Language) format, focusing on actions, preconditions, and effects. CODE_FUNC is a narrative description of a function's behavior in a programming context.

3. **Detail Level**: 
   - TASK provides detailed conditions and effects for specific actions (e.g., picking and placing objects), whereas CODE_FUNC gives a high-level overview of a function without detailing the underlying logic or conditions.

4. **Context**: 
   - TASK is situated within a planning domain for robotic actions, while CODE_FUNC is described in the context of a simulation function that may include various tasks beyond just the tomato tossing.

5. **Action Sequence**: 
   - TASK explicitly mentions tossing tomatoes, while CODE_FUNC outlines a sequence of actions that includes closing a gripper, pressing a switch, and picking up items, which may not directly relate to the specific task of tossing tomatoes.

6. **Outcome Handling**: 
   - TASK does not mention any outcome handling or feedback mechanisms, while CODE_FUNC includes checks for task completion and reward display.

7. **Environment Management**: 
   - TASK does not address environment setup or teardown, while CODE_FUNC explicitly mentions ensuring proper shutdown of the environment after task execution.

8. **Initialization**: 
   - TASK initializes the state of objects and conditions in a PDDL format, while CODE_FUNC describes initializing the environment and optionally starting video recording.

9. **Execution Trigger**: 
   - TASK does not specify how or when the actions are executed, while CODE_FUNC mentions that the function is triggered when the script is run directly.

10. **Focus on Light**: 
    - TASK does not involve any actions related to light or darkness beyond the preconditions for picking and placing, while CODE_FUNC includes pressing a switch to turn on a light as part of the action sequence.

In summary, the semantic differences between TASK and CODE_FUNC are significant, as they serve different purposes and contexts within robotic action planning and simulation.

Refined Code Generated:
-------------------
import numpy as np
from env import setup_environment, shutdown_environment
from skill_code import close_gripper, press, pick, 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()

        # Define object positions
        item1_pos = positions['item1']
        tomato2_pos = positions['tomato2']
        plate_pos = positions['plate']

        # === Execute the Plan ===
        # Step 1: Close the gripper
        print("[Task] Closing gripper...")
        obs, reward, done = close_gripper(env, task)
        if done:
            print("[Task] Task ended after closing gripper!")
            return

        # Step 2: Press the switch to turn on the light
        print("[Task] Pressing the switch...")
        obs, reward, done = press(env, task, positions['switch'])
        if done:
            print("[Task] Task ended after pressing the switch!")
            return

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

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

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

        # Step 6: Place tomato2 onto the plate
        print("[Task] Placing tomato2 onto the plate...")
        obs, reward, done = place(env, task, plate_pos)
        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()
-------------------

