Mirko asked me to produce a demo with mobile dots.

Overview

Alchemist Primer

This is a template project to spawn projects using the Alchemist Simulator. It provides a pre-configured gradle build.

This project is a quick start for the Alchemist simulator, it shows how to use the simulator via Gradle to run a simple simulation. More information can be found on the official Alchemist website.

Prerequisites

A Gradle-compatible Java version.

How to launch

To run the example you can rely on the pre-configured Gradle build script. It will automatically download all the required libraries, set up the environment, and execute the simulator via command line for you. As first step, use git to locally clone this repository.

Simulations can be included in the src/main/yaml folder, and executed via the runAll Gradle task.

For each YAML file in src/main/yaml a task runFileName will be created.

In order to launch, open a terminal and move to the project root folder, then on UNIX:

./gradlew runAll

On Windows:

gradlew.bat runAll

Press P to start the simulation. For further information about the gui, see the Alchemist documentation.

Note that the first launch will take some time, since Gradle will download all the required files. They will get cached in the user's home folder (as per Gradle normal behavior).

The build script

Let's explain how things work by looking at the build.gradle.kts script and the gradle/libs.versions.toml file. The latter is a Gradle dependency catalog file including the specification of the required libraries, including their name, their version, and how they get bundled; while the former is the actual script that launches the simulator.

The build script imports the bundled alchemist dependencies as:

dependencies {
    implementation(libs.bundles.alchemist)
}

You will either need to import the full version of alchemist (but it's not recommended, as it pulls in a lot of dependencies you probably don't want), or manually declare which modules you want to include into your Alchemist simulations.

At the very least, you want to pull in an incarnation. This can be done directly in the build file, or (recommended way) through the TOML catalog.

For instance, let's say that you want to pull in the module for simulating on real-world maps, and that you also need a library named bar at version 1.2.3, from group io.github.foo, available on Maven Central. You could import both of them by changing the catalog as follows:

[versions]
alchemist = "<the version of alchemist is here>"

[libraries]
alchemist = { module = "it.unibo.alchemist:alchemist", version.ref = "alchemist" }
alchemist-incarnation-protelis = { module = "it.unibo.alchemist:alchemist-incarnation-protelis", version.ref = "alchemist" }
alchemist-swingui = { module = "it.unibo.alchemist:alchemist-swingui", version.ref = "alchemist" }
# The following two lines are additions, the first defines the maps module of alchemist...
alchemist-maps = { module = "it.unibo.alchemist:alchemist-maps", version.ref = "alchemist" }
# ...the second the custom library with a more compact syntax as there is no need to reuse the version defined above.
foobar = "io.github.foo:bar:1.2.3"

[bundles]
alchemist = [
    "alchemist",
    "alchemist-incarnation-protelis",
    "alchemist-swingui",
    # Adding the newly defined libraries to the alchemist bundle makes them available automatically
    "alchemist-maps",
    "foobar"
]

The build script defines some tasks meant to run Alchemist from the command line through Gradle with ease. There will be one task for each simulation file in src/main/yaml, dynamically detected and prepared by Gradle. You can see a summary of the tasks for running Alchemist by issuing ./gradlew tasks --all (or gradlew.bat tasks --all under Windows) and looking for the Run Alchemist task group.

Internally, the task relies on the Alchemist command-line interface. Alchemist simulations are YAML files, more information about them can be found here.

Comments
Owner
Danilo Pianini
Post doc at University of Bologna // Avoid premature optimization. First make it right, then make it fast—if it is not already fast enough.
Danilo Pianini
KDoctor - A command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development

KDoctor is a command-line tool that helps to set up the environment for Kotlin Multiplatform Mobile app development.

Kotlin 331 Dec 29, 2022
📱 objection - runtime mobile exploration

objection is a runtime mobile exploration toolkit, powered by Frida, built to help you assess the security posture of your mobile applications, without needing a jailbreak.

SensePost 5.6k Jan 5, 2023
A Weather Mobile or Android Native App, in Kotlin built to see the current weather of suggested countries of Europe and in my current position. In this case, Maputo/Mozambique #WitChallenge #Asked #Option1

Witweather_android This is a challenge assigned by Wit, which aimed to build an Android App to visualize the temperature in my current location, in th

Kelton M. Cumbe 1 Nov 22, 2021
Three material Dots Indicators for view pagers in Android !

Material View Pager Dots Indicator This library makes it possible to represent View Pager Dots Indicator with 3 different awesome styles ! It supports

Tommy Buonomo 2.8k Jan 5, 2023
Android AlertDialog with moving dots progress indicator

Spots progress dialog Android AlertDialog with moving spots progress indicator packed as android library. =========== Usage The library available in m

Maksym Dybarskyi 1.1k Dec 26, 2022
Customizable bouncing dots for smooth loading effect. Mostly used in chat bubbles to indicate the other person is typing.

LoadingDots for Android Customizable bouncing dots view for smooth loading effect. Mostly used in chat bubbles to indicate the other person is typing.

Eyal Biran 162 Dec 2, 2022
Android AlertDialog with moving dots progress indicator

Spots progress dialog Android AlertDialog with moving spots progress indicator packed as android library. =========== Usage The library available in m

Maksym Dybarskyi 1.1k Jan 8, 2023
Dots indicator that shows the current position on a View Pager. It does all the work for you with a few customisations.

Dots What is Dots? Dots is a library that helps in implementing a simple yet effective dots indicator for the View Pagers used in your android code. I

Deepan 23 Feb 16, 2022
Android AlertDialog with moving dots progress indicator

Spots progress dialog Android AlertDialog with moving spots progress indicator packed as android library. =========== Usage The library available in m

Maksym Dybarskyi 1.1k Jan 8, 2023
An Android custom view to display digits rendered as dots in a grid, with a style like a 1970s LED clock.

#DotMatrixView This is an Android library project providing a custom view that can display things on a grid of dots. When the displayed value changes,

Mark Roberts 48 Apr 21, 2022
🛡️ Android security (camera/microphone dots indicators) app using Hilt, Animations, Coroutines, Material, StateFlow, Jetpack based on MVVM architecture.

??️ Android security app using Hilt, Animations, Coroutines, Material, StateFlow, Jetpack (Room, ViewModel, Paging, Security, Biometrics, Start-up) based on MVVM architecture.

null 639 Jan 6, 2023
Multiplayer Dots and Boxes game for Android

Multiplayer Dots and Boxes game for Android. One player is the server, and the rest connect to them. Has player customization and in-game chat! Still in development, but fully compatible with version 2.0 of my NetDot protocol.

Matthew 0 May 8, 2022
Android-splash-screen-demo - Sample application to demo the various features provided in android-splash-screen

Android Splash screen API demo This is a sample application used to demonstrate the various features provided in android-splash-screen. More details c

Sridhar 1 Jan 3, 2022
Michal Kubele 0 Jan 6, 2022
OpenWeatherMap-API-Demo - Demo Android Application for OpenWeatherMap API

WeatherForecast Demo Android Application for OpenWeatherMap API Table of Content

Rashid Hussain 0 Jul 10, 2022
A Demo App which demonstrate the capabilities for BeVigil OSINT demo API

BeVigil-OSINT-Demo A Demo App which demonstrate the capabilities for BeVigil OSINT demo API Functionalities Firebase Authentication

Daniel Dominic 0 May 17, 2022
Kotlin Multiplatform Mobile demo for Android and iOS - app for viewing Cat pictures

CatViewerDemo Android demo iOS demo Kotlin Multiplatform Mobile demo for Android and iOS. App for viewing Cat pictures from Cats API. This sample show

Martin Rajniak 111 Dec 18, 2022
Kotlin Multiplatform Mobile + Mobile Declarative UI Framework (Jetpack Compose and SwiftUI)

Kotlin Multiplatform Mobile + Mobile Declarative UI Framework (Jetpack Compose and SwiftUI)

Kotchaphan Muangsan 3 Nov 15, 2022