This repo contains the (legacy) AnyLogic cloudclient implementation of the HOLON project. This repo and other repos are licensed under the MIT license. Other repos are:
(works better at the Github Pages)
The experiments module allows you to define your experiment in a config file and run one or multiple experiments sequentially. No more adjusting classes! Based on the existing scripts.
Uses editable wheel build.
git clone https://github.com/ZEnMo/HOLON-cloudclient.git
cd HOLON-cloudclient
# CREATE AND ACTIVATE YOUR ENV OF CHOICE
pip install -e .
cloudclient_init --target-folder .
Direct
pip install git+https://github.com/ZEnMo/HOLON-cloudclient@main#egg=cloudclient
cloudclient_init --target-folder folder/for/clouclient/config --get-api-key # asumes "AL_API_KEY" in env vars
Via requirements.txt
git+https://github.com/ZEnMo/HOLON-cloudclient@main#egg=cloudclient
The cloudclient_init
command that you issued during installation links the cloudclient
package to your project configuration folder .cloudclient
. This folder contains the information that is used by the package to run experiments on the AnyLogic private cloud.
Go to the config
folder and open config.yml
. Specify your secret API key to connect to the AnyLogic Cloud there.
anylogic_cloud:
api_key: 7a3563c1-ea1c-41d6-8009-b7abfd93f7ba
url: https://engine.holontool.nl
Go to the config
folder and open experiments.yml
. Specify
your experiments there.
<experiment_name>:
model_name: name of the anylogic model to connect to
config_file: the excel database file or ::cloudclient.datamodel:: from which to read the config sheets
timestep_hours: Float, timestep in hours
force_uncached: True | False, force the anylogic model to run in uncached mode
show_progress: True | False, ?
parallelize: True | False, allow the model to run in paralellized mode
log_exceptions: True | False, log exceptions or not
use_datamodel: True | False, whether to treat the input as a ::cloudclient.datamodel::
inputs: list (optional), list the anylogic input key and the file in
which to find the inputs for each input
See format below
- anylogic_key: <key>
file: <sheetname> or <datamodel.Payload attribute> to submit to the key
write: True | False
outcome: list, name all the outcoems that should be taken from the model.
They become accesible and will be saved under their human_key
Specify if they should be written to a file, or printed out.
Also allows for actions on the data. Currently only normalise is
avaibale.
The base code for the module is in the experiments
folder. But you can easily call the module
from the script run_experiments
in the scripts
folder. Here you can run one experiment by
specifying its name or all experiments by using the keyword ALL
.
There is also support for pipenv now for the ones that are interested. There is a shortcut to
run the experiments: pipenv run experiments {experiment_name}
.
Happy experimenting!
Data classes are used to structure and validate data before it is sent to the AnyLogic API. Find the class diagrams below:
- Conversion assets
- Consumption assets
- Storage assets
- Production assets
- Grid connections
- Gridnode assets
- Actors
- Contracts
Check out the example JSON file over at: doc/assets/example.json.