diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2020-02-14 19:11:35 +0100 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2020-02-14 19:11:35 +0100 |
| commit | 04e4bddccc4e06a126f3c6ee2878502323c7116e (patch) | |
| tree | 716253f4c03cf8dc6754430a5f63d0a57061d795 /odcsim/odcsim-api | |
| parent | cd293b79ef2066ffcb605b9c625d6ab0a9af1d16 (diff) | |
| parent | b13ba01e967e1a281d58b37cb57986b47ec99dd8 (diff) | |
Merge branch 'feat/cpu-sharing' into 'feat/2.x'
Add basis for VM modeling and fractional space-sharing
See merge request opendc/opendc-simulator!23
Diffstat (limited to 'odcsim/odcsim-api')
| -rw-r--r-- | odcsim/odcsim-api/build.gradle.kts | 1 | ||||
| -rw-r--r-- | odcsim/odcsim-api/src/main/kotlin/com/atlarge/odcsim/ProcessContext.kt | 9 |
2 files changed, 9 insertions, 1 deletions
diff --git a/odcsim/odcsim-api/build.gradle.kts b/odcsim/odcsim-api/build.gradle.kts index 51a80d2c..c8c6c90c 100644 --- a/odcsim/odcsim-api/build.gradle.kts +++ b/odcsim/odcsim-api/build.gradle.kts @@ -31,6 +31,7 @@ plugins { dependencies { implementation(kotlin("stdlib")) + api("org.slf4j:slf4j-api:${Library.SLF4J}") api("org.jetbrains.kotlinx:kotlinx-coroutines-core:${Library.KOTLINX_COROUTINES}") testImplementation("org.junit.jupiter:junit-jupiter-api:${Library.JUNIT_JUPITER}") diff --git a/odcsim/odcsim-api/src/main/kotlin/com/atlarge/odcsim/ProcessContext.kt b/odcsim/odcsim-api/src/main/kotlin/com/atlarge/odcsim/ProcessContext.kt index 2a72e331..30ef4114 100644 --- a/odcsim/odcsim-api/src/main/kotlin/com/atlarge/odcsim/ProcessContext.kt +++ b/odcsim/odcsim-api/src/main/kotlin/com/atlarge/odcsim/ProcessContext.kt @@ -27,11 +27,13 @@ package com.atlarge.odcsim import java.time.Clock import kotlin.coroutines.CoroutineContext import kotlin.coroutines.coroutineContext +import kotlinx.coroutines.CoroutineScope +import org.slf4j.Logger /** * Represents the execution context of a logical process in simulation. */ -public interface ProcessContext : CoroutineContext.Element { +public interface ProcessContext : CoroutineContext.Element, CoroutineScope { /** * Key for [ProcessContext] instance in the coroutine context. */ @@ -48,6 +50,11 @@ public interface ProcessContext : CoroutineContext.Element { public val clock: Clock /** + * A logger instance tied to the logical process. + */ + public val log: Logger + + /** * Spawn an anonymous logical process in the simulation universe with the specified [behavior]. */ public fun spawn(behavior: Behavior): ProcessRef |
