From 6ca0ae07669d20a5a34ef697610df90754024035 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 20 Nov 2019 17:51:58 +0100 Subject: refactor: Move build logic to buildSrc --- README.md | 81 +++++---------------------------------------------------------- 1 file changed, 6 insertions(+), 75 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 54fa77cb..b4da4287 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ OpenDC
- odcsim + OpenDC

@@ -13,6 +13,10 @@ MIT License

+

+ Collaborative Datacenter Simulation and Exploration for Everybody +

+ ## Introduction **odcsim** is a framework for discrete event simulation in Kotlin and Java, used @@ -33,79 +37,6 @@ The documentation is located in the [docs/](docs/) directory and is divided as f * [API Reference](https://atlarge-research.github.io/opendc-simulator) * [Contributing Guide](CONTRIBUTING.md) -## Getting Started - -### Installation -Please add the required packages as dependency in your project. -Releases are available in the [Maven Central Repository](https://search.maven.org/). - -The package `odcsim-core` is required to construct a simulation model. -A `odcsim-engine-*` package is needed for running the simulation -model. - -**Gradle** -```groovy -compile 'com.atlarge.odcsim:odcsim-core:2.0.0' -compile 'com.atlarge.odcsim:odcsim-engine-omega:2.0.0' -``` - -**Maven** -```xml - - com.atlarge.odcsim - odcsim-core - 2.0.0 - - - - com.atlarge.odcsim - odcsim-engine-omega - 2.0.0 - -``` - -### 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 = - 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() -``` - ## Contributing ### Contributing Guide Read our [contributing guide](CONTRIBUTING.md) to learn about our @@ -113,4 +44,4 @@ development process, how to propose bug fixes and improvements, and how to build and test your changes to the project. ### License -**odcsim** is [MIT licensed](https://github.com/atlarge-research/opendc-simulator/blob/master/LICENSE.txt). +The OpenDC simulator is [MIT licensed](https://github.com/atlarge-research/opendc-simulator/blob/master/LICENSE.txt). -- cgit v1.2.3