You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 25, 2020. It is now read-only.
For the first public release, we need a design for an Instrumentation API which is able to measure data from the system in simulation and process the data that has been measured.
Goals
Allow user to measure data from the system in simulation
Allow user to transform the measured data
Allow user to use the data (save/store)
Design
Measurement
The measurement of data happens in an Instrument, which is similar to a Process and has access to the state of all entities in the model. These measurements can happen periodically, by making the instrument hold (sleep) between the measurements. The measurements are then emitted via the methods provided by the SendChannel interface.
val entity =...
val instrument:Instrument<Int, Model> = {
while(true) {
send(entity.state.counter)
hold(10)
}
}
Installation
The Kernel interface will provide a method install(instrument: Instrument<T, M>): ReceiveChannel<T> that allows a user to install an instrument into a (running) system. The method will return a stream of measurements of type T (we use ReceiveChannel from kotlinx-coroutines to represent a stream).
Transformation and Collection
The idea is to use the channel returned by the install method to asynchronously transform the measurements into meaningful data:
val stream:ReceiveChannel<Int> = kernel.install(instrument)
val avg:Deferred<Int> = async(Confined) { stream.take(100).average() }
kernel.run(1000)
The text was updated successfully, but these errors were encountered:
This commit creates the interfaces for the new Instrumentation API
described in issue #11. This interface allows users to plug an
instrumentation device into a (live) simulation in order extract
measurements from the simulation.
This commit creates the interfaces for the new Instrumentation API
described in issue #11. This interface allows users to plug an
instrumentation device into a (live) simulation in order extract
measurements from the simulation.
These changes contain the specification of the new Instrumentation API for the simulator, in addition to the implementation for the Omega kernel. As an example, the API allows users to measure data from processes in simulation and interpolate data points between the measurements.
Closes#11, #12
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For the first public release, we need a design for an Instrumentation API which is able to measure data from the system in simulation and process the data that has been measured.
Goals
Design
The measurement of data happens in an
Instrument
, which is similar to aProcess
and has access to the state of all entities in the model. These measurements can happen periodically, by making the instrument hold (sleep) between the measurements. The measurements are then emitted via the methods provided by theSendChannel
interface.The
Kernel
interface will provide a methodinstall(instrument: Instrument<T, M>): ReceiveChannel<T>
that allows a user to install an instrument into a (running) system. The method will return a stream of measurements of typeT
(we useReceiveChannel
from kotlinx-coroutines to represent a stream).The idea is to use the channel returned by the
install
method to asynchronously transform the measurements into meaningful data:The text was updated successfully, but these errors were encountered: