THINK FIRST·CODE LATER

← All labs

Deadline- and cost-aware placement across device, edge and cloud

Problem

Input: the number of resources, then per resource name speedGHz transferMsPerMB rttMs pricePerGcycle; then tasks name release deadline gigacycles MB (times in ms) until the end of input.

Process tasks in EDF order (deadline, then release time, then input order). Each resource executes one task at a time. For task t on resource k: arrival = release + MB × transferMsPerMB + rtt; start = max(arrival, time when k becomes free); finish = start + gigacycles / speed × 1000.

Choose the cheapest resource (price × gigacycles) whose finish ≤ deadline (ties → first resource); if none, choose the resource with the earliest finish (first on ties) and mark the task MISSED. The chosen resource becomes free at the task's finish time.

Print T2 -> edge, finish 65 ms, deadline 70 met, cost 0.40 per task (times as integers when whole, else 1 decimal; cost 2 decimals) and Deadlines met: m/n, total cost X.

Write it here or in your IDE, then paste it. Compile and test it yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.