diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-02-18 16:41:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-18 16:41:48 +0100 |
| commit | 0cba027933e19254573f2488086db3e4660f93d2 (patch) | |
| tree | 510659fc8c85fc4a7196d1a769ed2dbcfd4ed787 /opendc-compute/opendc-compute-simulator/src | |
| parent | d7c173f0f7b4cb2584a498155519c287abedeae9 (diff) | |
| parent | c82b1725cc606769084155d6c4fba982cd320c41 (diff) | |
merge: Address technical debt in codebase
This pull request removes some of the existing technical debt in the OpenDC codebase.
Close #51
## Implementation Notes :hammer_and_pick:
* Add Pacer to pace scheduling cycles.
* Rename utils module to common module
* Optimize TimerScheduler
* Remove opendc-platform module
* Disallow duplicate UIDs for SimHost
## Breaking API Changes :warning:
* TimerScheduler does not implement `AutoCloseable` anymore.
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src')
| -rw-r--r-- | opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 95921e8b..43f33f27 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -249,6 +249,12 @@ public class SimHost( machine.cancel() } + override fun hashCode(): Int = uid.hashCode() + + override fun equals(other: Any?): Boolean { + return other is SimHost && uid == other.uid + } + override fun toString(): String = "SimHost[uid=$uid,name=$name,model=$model]" public suspend fun fail() { |
