Resource Allocation and Task Scheduling for Integrated Sensing and Communications