Skip to content

world.lunch() will cause the socket to be opened repeatedly #35

@BladeY1

Description

@BladeY1

genworlds/worlds/abstracts/world.py:

       for obj in self.objects:
           sleep(0.1)
           self.add_object(obj)
       for agent in self.agents:
           sleep(0.1)
           self.add_agent(agent)

Since add_agent and add_objects will add new objects, the loop will not terminate

revise opinion:

        for obj in self.objects:
            sleep(0.1)
            #self.add_object(obj)
            obj.host_world_id = self.id  # Set the overworld ID of the object
            obj.launch_websocket_thread()  # Start the object's WebSocket thread

        for agent in self.agents:
            sleep(0.1)
            #self.add_agent(agent)
            agent.host_world_id = self.id  
            agent.launch()  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions