mosaik.basic_simulators — Basic simulators

class mosaik.basic_simulators.InputSimulator[source]

This simulator gives a steady input to a connected simulator. This input can either be an constant value or given by a custom function based on the current time.

When starting the simulator, a custom step size may be provided using the step_size parameter. The default is 1.

When creating a Constant entity, the constant must be passed as the parameter constant.

When creating a Function entity, a function should be passed as the function parameter. This function should take the current mosaik time and return the desired value. This type of entity only works when the simulator is started using the “python” method.

In either case, the entity will produce its output on the value attribute.

class mosaik.basic_simulators.OutputSimulator[source]

This simulator takes the input it is given and writes it into a python dictionary where the keys are the timestamps of the input and the values are the inputs values.

The dictionary can be retrieved using the get_dict method.

get_dict(eid)[source]

Returns the dict of the simulator entity specified by the eid.

Parameters:

eid (str) – The entity id of the selected entity.

Returns:

The dict of the entity.

Return type:

Dict[int, Any]