def save_internal_states(simulator):
    object_dump = {}
    for (name, obj) in simulator.scene.objects_by_name.items():
        object_dump[name] = obj.dump_state()
    robot_dump = []
    for robot in simulator.robots:
        robot_dump.append(robot.dump_state())
    return {'objects': object_dump, 'robots': robot_dump}
def save_internal_states(simulator):
    object_dump = {}
    for (name, obj) in simulator.scene.objects_by_name.items():
        object_dump[name] = obj.dump_state()
    robot_dump = []
    for robot in simulator.robots:
        robot_dump.append(robot.dump_state())
    return {'objects': object_dump, 'robots': robot_dump}