diff options
| -rw-r--r-- | README.md | 33 | ||||
| -rw-r--r-- | odcsim/README.md | 52 |
2 files changed, 15 insertions, 70 deletions
@@ -3,9 +3,12 @@ <img src="misc/artwork/logo.png" width="100" alt="OpenDC"> </a> <br> - OpenDC + OpenDC Simulator </h1> <p align="center"> +Collaborative Datacenter Simulation and Exploration for Everybody +</p> +<p align="center"> <a href="https://travis-ci.org/atlarge-research/opendc-simulator"> <img src="https://travis-ci.org/atlarge-research/opendc-simulator.svg?branch=master" alt="Build Status"> </a> @@ -13,29 +16,13 @@ <img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT License"> </a> </p> -<p align="center"> - Collaborative Datacenter Simulation and Exploration for Everybody -</p> - ## Introduction -**odcsim** is a framework for discrete event simulation in Kotlin and Java, used -by the [OpenDC](https://opendc.org) project. -Simulations are defined in terms of a hierarchical grouping of actors -and the interactions between these actors -([Actor model](https://en.wikipedia.org/wiki/Actor_model)), using -an API very similar to [Akka Typed](https://doc.akka.io/docs/akka/current/typed/index.html). - -## Documentation -Check out the [Getting Started](#getting-started) section for a quick -overview. -The documentation is located in the [docs/](docs/) directory and is divided as follows: -* [Main Concepts](docs/concepts.md) -* [Building a Model](docs/build.md) -* [Running a Model](docs/run.md) -* [Pre-built Models](docs/models.md) -* [API Reference](https://atlarge-research.github.io/opendc-simulator) -* [Contributing Guide](CONTRIBUTING.md) +This repository hosts the source code and development of the simulation component of the [OpenDC](https://opendc.org) project. This component is responsible for modelling and simulation of datacenters and their components. We have structured the repository into two individual subprojects: +- **[odcsim](/odcsim)** + A framework for discrete event simulation using the [Kotlin](https://kotlinlang.org/) language. +- **[opendc](/opendc)** + A collection of models for simulating clouds, datacenters and their components using the **odcsim** framework. ## Contributing ### Contributing Guide @@ -44,4 +31,4 @@ development process, how to propose bug fixes and improvements, and how to build and test your changes to the project. ### License -The OpenDC simulator is [MIT licensed](https://github.com/atlarge-research/opendc-simulator/blob/master/LICENSE.txt). +The OpenDC simulator is available under the [MIT license](https://github.com/atlarge-research/opendc-simulator/blob/master/LICENSE.txt). diff --git a/odcsim/README.md b/odcsim/README.md index 5863b055..e5dcc319 100644 --- a/odcsim/README.md +++ b/odcsim/README.md @@ -7,12 +7,12 @@ </h1> ## Introduction -**odcsim** is a framework for discrete event simulation in Kotlin and Java, used +**odcsim** is a framework for discrete event simulation in Kotlin, used by the [OpenDC](https://opendc.org) project. Simulations are defined in terms of a hierarchical grouping of actors and the interactions between these actors ([Actor model](https://en.wikipedia.org/wiki/Actor_model)), using -an API very similar to [Akka Typed](https://doc.akka.io/docs/akka/current/typed/index.html). +an API similar to [Akka](https://doc.akka.io/docs/akka/current/index.html). ## Documentation Check out the [Getting Started](#getting-started) section for a quick @@ -37,12 +37,12 @@ model. #### Gradle Groovy ```groovy -implementation 'com.atlarge.odcsim:odcsim-core:2.0.0' +implementation 'com.atlarge.odcsim:odcsim-api:2.0.0' runtime 'com.atlarge.odcsim:odcsim-engine-omega:2.0.0' ``` Kotlin ```groovy -implementation("com.atlarge.odcsim:odcsim-core:2.0.0") +implementation("com.atlarge.odcsim:odcsim-api:2.0.0") runtime("com.atlarge.odcsim:odcsim-engine-omega:2.0.0") ``` @@ -50,7 +50,7 @@ runtime("com.atlarge.odcsim:odcsim-engine-omega:2.0.0") ```xml <dependency> <groupId>com.atlarge.odcsim</groupId> - <artifactId>odcsim-core</artifactId> + <artifactId>odcsim-api</artifactId> <version>2.0.0</version> </dependency> @@ -61,45 +61,3 @@ runtime("com.atlarge.odcsim:odcsim-engine-omega:2.0.0") </dependency> ``` -### Construction of Simulation Model -Let's construct a simple simulation model of a single car actor. -The car will alternately drive and park for a while. When it starts -driving (or parking), it will print the current simulation time. - - -```kotlin -import com.atlarge.odcsim.Behavior -import com.atlarge.odcsim.coroutines.suspending -import com.atlarge.odcsim.coroutines.dsl.timeout - -fun car(): Behavior<Nothing> = - suspending { ctx -> - while (true) { - println("Start parking at ${ctx.time}") - val parkingDuration = 5.0 - timeout(parkingDuration) - - println("Start driving at ${ctx.time}") - val tripDuration = 2.0 - timeout(tripDuration) - } - - stopped() - } -``` - -### Running Simulation -Running the constructed simulation model requires an implementation -of the `ActorSystem` interface provided by one of the `odcsim-engine-*` -packages. The [ServiceLoader](https://docs.oracle.com/javase/9/docs/api/java/util/ServiceLoader.html) -class found in the JDK can be used to locate the `ActorSystem` implementation on the classpath. -```kotlin -import com.atlarge.odcsim.ActorSystemFactory -import java.util.ServiceLoader - -val factory = ServiceLoader.load(ActorSystemFactory::class.java).first() -val system = factory(car(), name = "car") -system.run(until = 10.0) -system.terminate() -``` - |
