summaryrefslogtreecommitdiff
path: root/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2017-09-21 23:25:44 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2017-09-21 23:25:44 +0200
commita031db367c71ec1604b34f3765198c2196bfe551 (patch)
tree793c4af1a9b0c4f8bbc0d901b2a8ae90ac22d4ee /opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt
parent735d5543ed72f0c6cf632b35b3f23323cebcf81b (diff)
Create simple datacenter experiment
Diffstat (limited to 'opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt')
-rw-r--r--opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt5
1 files changed, 2 insertions, 3 deletions
diff --git a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt
index ce80ddc3..0e94f81a 100644
--- a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt
+++ b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/scheduler/SrtfScheduler.kt
@@ -57,8 +57,7 @@ class SrtfScheduler : Scheduler {
val iterator = tasks.sortedBy { it.remaining }.iterator()
machines
- .filter { it.state.status == Machine.Status.IDLE }
- .forEach {
+ .forEach { machine ->
while (iterator.hasNext()) {
val task = iterator.next()
@@ -71,7 +70,7 @@ class SrtfScheduler : Scheduler {
continue
}
- it.send(task)
+ machine.send(task)
break
}
}