Implement a function that computes the resource dilation factor for a set of tasks scheduled under limited resource capacity.
In resource-constrained scheduling (relevant to multi-agent RL, job scheduling MDPs, and planning under constraints), the dilation factor measures how much longer the actual schedule takes compared to an ideal theoretical lower bound.
You are given:
tasks: A list of dictionaries, each with keys:
"duration": positive number, the time to complete the task"resources": positive integer, the number of resource units the task requires while running"dependencies": list of task indices that must complete before this task can startcapacity: total number of available resource units at any timeYour function should:
Return a dictionary with keys:
"dilation_factor": the dilation factor, rounded to 4 decimal places"actual_makespan": the scheduled makespan, rounded to 4 decimal places"lower_bound": the theoretical lower bound, rounded to 4 decimal places"start_times": list of start times for each task, rounded to 4 decimal places