summaryrefslogtreecommitdiff
path: root/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2017-09-20 00:37:13 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2017-09-20 00:37:13 +0200
commit90e0d1d8c6ab94e020dd4cb4831a369b270a69b7 (patch)
treeab456b9fc10b52992fc8cf48fc2f63fee127dbb8 /opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology
parenta67b87be9e14d6d3c23e1e6aff5051176171e6ef (diff)
Implement standard task schedulers
This change implements default tasks scheduling algorithms like FIFO or SRTF and adds them to to the standard library.
Diffstat (limited to 'opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology')
-rw-r--r--opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt3
-rw-r--r--opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Room.kt7
2 files changed, 9 insertions, 1 deletions
diff --git a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
index b995732a..4136c03c 100644
--- a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
+++ b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
@@ -32,5 +32,8 @@ import nl.atlarge.opendc.topology.Entity
* @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl)
*/
class Datacenter : Entity<Unit> {
+ /**
+ * The initial state of the entity.
+ */
override val initialState = Unit
}
diff --git a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Room.kt b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Room.kt
index 3b338899..109a5629 100644
--- a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Room.kt
+++ b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Room.kt
@@ -31,4 +31,9 @@ import nl.atlarge.opendc.topology.Entity
*
* @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl)
*/
-interface Room : Entity<Unit>
+class Room : Entity<Unit> {
+ /**
+ * The initial state of the entity.
+ */
+ override val initialState = Unit
+}