def test_set_agent_properties(test_world, test_nodenet): world = runtime.worlds[test_world] nodenet = runtime.get_nodenet(test_nodenet) nodenet.world = world runtime.load_nodenet(test_nodenet) runtime.set_worldagent_properties(test_world, test_nodenet, position=(5, 5)) assert world.agents[test_nodenet].position == (5, 5) assert world.data['agents'][test_nodenet]['position'] == (5, 5)
def test_set_agent_properties(test_world, test_nodenet): world = runtime.worlds[test_world] runtime.set_nodenet_properties(test_nodenet, worldadapter='Braitenberg', world_uid=test_world) runtime.set_worldagent_properties(test_world, test_nodenet, position=(5, 5)) assert world.agents[test_nodenet].position == (5, 5) assert world.data['agents'][test_nodenet]['position'] == (5, 5)
def set_worldagent_properties(world_uid, uid, position=None, orientation=None, name=None, parameters=None): if runtime.set_worldagent_properties(world_uid, uid, position, orientation, name, parameters): return dict(status="success") else: return dict(status="error", msg="unknown world or world object")
def set_worldagent_properties(world_uid, uid, position=None, orientation=None, name=None, parameters=None): """ Set the properties of an agent in the given world """ if runtime.set_worldagent_properties(world_uid, uid, position, float(orientation), name, parameters): return dict(status="success") else: return dict(status="error", msg="unknown environment or world object")