summaryrefslogtreecommitdiff
path: root/simulator/opendc-format/src
diff options
context:
space:
mode:
authorHongyu <39747921+HongyuHe@users.noreply.github.com>2021-03-06 19:36:46 +0100
committerGitHub <noreply@github.com>2021-03-06 19:36:46 +0100
commit2977dd8a5f1d742193eae79364a284e68269f7b5 (patch)
tree3fb378be396d728d30b2769a4610c652cfb71507 /simulator/opendc-format/src
parentd72ac4b1df32dd5e6bd3faa4fa528dbf8a03f6f1 (diff)
sim: Implement energy models from CloudSim (#79)
This commit implements the energy models that are present in CloudSim: 1. Constant 2. Linear 3. Cubic 4. Square root 5. Interpolation based on data.
Diffstat (limited to 'simulator/opendc-format/src')
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt4
-rw-r--r--simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt4
2 files changed, 4 insertions, 4 deletions
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
index b4c71c4e..6ec8ba4a 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20ClusterEnvironmentReader.kt
@@ -27,7 +27,7 @@ import org.opendc.compute.core.metal.NODE_CLUSTER
import org.opendc.compute.core.metal.service.ProvisioningService
import org.opendc.compute.core.metal.service.SimpleProvisioningService
import org.opendc.compute.simulator.SimBareMetalDriver
-import org.opendc.compute.simulator.power.LinearLoadPowerModel
+import org.opendc.compute.simulator.power.models.LinearPowerModel
import org.opendc.core.Environment
import org.opendc.core.Platform
import org.opendc.core.Zone
@@ -118,7 +118,7 @@ public class Sc20ClusterEnvironmentReader(
// For now we assume a simple linear load model with an idle draw of ~200W and a maximum
// power draw of 350W.
// Source: https://stackoverflow.com/questions/6128960
- LinearLoadPowerModel(200.0, 350.0)
+ LinearPowerModel(350.0, 200 / 350.0)
)
)
}
diff --git a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
index 94237cb9..a58a2524 100644
--- a/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
+++ b/simulator/opendc-format/src/main/kotlin/org/opendc/format/environment/sc20/Sc20EnvironmentReader.kt
@@ -29,7 +29,7 @@ import kotlinx.coroutines.CoroutineScope
import org.opendc.compute.core.metal.service.ProvisioningService
import org.opendc.compute.core.metal.service.SimpleProvisioningService
import org.opendc.compute.simulator.SimBareMetalDriver
-import org.opendc.compute.simulator.power.LinearLoadPowerModel
+import org.opendc.compute.simulator.power.models.LinearPowerModel
import org.opendc.core.Environment
import org.opendc.core.Platform
import org.opendc.core.Zone
@@ -91,7 +91,7 @@ public class Sc20EnvironmentReader(input: InputStream, mapper: ObjectMapper = ja
// For now we assume a simple linear load model with an idle draw of ~200W and a maximum
// power draw of 350W.
// Source: https://stackoverflow.com/questions/6128960
- LinearLoadPowerModel(200.0, 350.0)
+ LinearPowerModel(350.0, 200 / 350.0)
)
}
}