mosaik.proxies – Proxies for mosaik simulators¶
This module contains the Proxy class and its subclasses.
They are used to represent a running simulator in the scenario.
LocalProxy represents a simulator running in the current
Python process; RemoteProxy represents a simulator connected to
mosaik via a TCP connection.
- class Proxy[source]¶
A proxy for a mosaik simulator from the view of a mosaik scenario.
Generally, this will be a
BaseProxysubclass wrapped in the appropriateAdaptersubclasses to bring the interface of the connected simulator in line with the most up-to-date API version.
- class BaseProxy[source]¶
A base
Proxyfor a connected simulator that simply sends all requests along unchanged. This will usually be wrapped in one or more instances ofAdapterto allow treating the simulator as up-to-date from other parts of mosaik.
- class LocalProxy(sim, mosaik_remote)[source]¶
Proxy for a local simulator. This mainly wraps each mosaik method in a coroutine.
- Parameters:
sim (Simulator)
mosaik_remote (MosaikRemote)
- sim: Simulator[source]¶
The underlying
mosaik_api_v3.Simulator.
- async init(sid, **kwargs)[source]¶
Initialize the simulator by sending the
initcall. Themetareturned by the simulator will be saved to be retrieved using themetaproperty.
- class RemoteProxy(channel, mosaik_remote, *, process=None)[source]¶
- Parameters:
channel (Channel)
mosaik_remote (MosaikRemote)
process (tuple[asyncio.subprocess.Process, ProcessTerminationManager] | None)
- async init(sid, **kwargs)[source]¶
Initialize the simulator by sending the
initcall. Themetareturned by the simulator will be saved to be retrieved using themetaproperty.