API

alpypeopt.AnyLogicModel

class alpypeopt.AnyLogicModel(env_config: dict = {'exported_model_loc': './exported_model', 'run_exported_model': True, 'server_mode_on': False, 'show_terminals': False, 'verbose': False})[source]

The python class that contains the AnyLogic model connection and is in charge of setting and retrieving the information required to be returned to the optimization model

__init__(env_config: dict = {'exported_model_loc': './exported_model', 'run_exported_model': True, 'server_mode_on': False, 'show_terminals': False, 'verbose': False})[source]

Internal AnyLogic environment wrapper constructor

Parameters:

env_config (dict) –

Environment configuration which includes:

  • 'run_exported_model': In case you want to run an exported version of the model. Otherwise it will wait for the AnyLogic model to connect.

  • 'exported_model_loc': The location of the exported model folder.

  • 'show_terminals': This only applies if running an exported model and the user wants a terminal to be launched for every model instance (could be useful for debugging purposes).

  • 'verbose': To be activated in case DEBUG logger wants to be activated.

setup_and_run(model_configuration)[source]

[INTERNAL] Basic function for controlling the AnyLogic simulation. It requires a model configuration as an input. After that the simulation will be run until the end.

reset(*, seed=None, options=None)[source]

[INTERNAL] Reset function will restart the AnyLogic model to its initial status.

get_model_output()[source]

[INTERNAL] Retrieve model output object from AnyLogic simulation

close()[source]

[INTERNAL] Close executables if any was created