GraphQLMonitor

class GraphQLMonitor<T, P : Position<out P>>(val environment: Environment<T, P>, val host: String = DefaultGraphQLSettings.DEFAULT_HOST, val port: Int = DefaultGraphQLSettings.DEFAULT_PORT, val teardownOnSimulationTermination: Boolean = true, serverDispatcher: <Error class: unknown class> = Dispatchers.Default) : OutputMonitor<Any, Nothing>

An OutputMonitor observing the environment through a GraphQL server listening on host:port. The server is started in a new coroutine on the serverDispatcher dispatcher. By default, the server is stopped after the simulation terminates. This behavior can be changed by setting teardownOnSimulationTermination to false.

Constructors

Link copied to clipboard
constructor(environment: Environment<T, P>, host: String = DefaultGraphQLSettings.DEFAULT_HOST, port: Int = DefaultGraphQLSettings.DEFAULT_PORT, teardownOnSimulationTermination: Boolean = true, serverDispatcher: <Error class: unknown class> = Dispatchers.Default)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val port: Int

Functions

Link copied to clipboard
open override fun finished(environment: Environment<Any, Nothing>, time: Time, step: Long)

This method will be called by the simulation once the whole simulation has finished, either because it reached its latest point or because the user stopped it. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.

Link copied to clipboard
open override fun initialized(environment: Environment<Any, Nothing>)

This method will be called by the simulation as soon as the initialization phase is completed. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.

Link copied to clipboard
open fun stepDone(environment: Environment<Any, Nothing>, reaction: Actionable<Any>, time: Time, step: Long)

This method will be called by the simulation every time a simulation step is done. Thread safety note: no specific policy is defined for the control flow which will execute this method. A new thread could have been spawned or the same flow of the simulation may execute this method. This depends on the specific it.unibo.alchemist.core.Simulation implementation.