AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Anylogic tutorial text dest4/1/2024 ![]() That way it will save it in a folder called "Models" in your user's directory. For the sake of simplicity just put "Supply Chain" in the box that asks for a model name and leave everything else. Preparing the Simulation Model in AnyLogic 6įirst save the model in a new location. In total we have 6 decision variables, one target variable and one constraint on the output. Each echelon in the chain uses an (s,S) ordering policy. The optimization goal is to minimize the sum of all costs in the supply chain while satisfying a certain service level for the end user. There is also an Optimization Experiment in this model which uses the proprietary optimization package OptQuest. After you opened the model you can try to run the Simulation. You can open it either on the Welcome page after starting AnyLogic 6 or by choosing "Sample Models" from the Help menu. The model which we are going to optimize with HeuristicLab comes preinstalled with AnyLogic 6 and is called Supply Chain. If you go through this tutorial you will hopefully get an idea on how to solve your specific problem and implement the connector in your model. This howto is written as a tutorial by taking one of the sample models that ships with AnyLogic and add connectors to optimize its parameters with HeuristicLab algorithms. We assume the reader is familiar with xj technologies AnyLogic 6 and has basic understanding of the Java programming language. If you prefer a slide version of this tutorial with images, please download the PDF tutorial of optimizing external applications and follow the instructions in Demonstration Part I therein. optimize parameters of AnyLogic 6 simulation models ![]() I know you end up with a lot of CSV files, but at least the simulation doesn’t crash, and you can recover the output of your simulation as it goes.How to. I finally decided to follow my previous approach: create many CSV files – one per iteration and replicate – and read them using an R or Python function. My simulation just crashed, and I was not able to keep the data. When running several replicates of my simulation, saving the information in a database didn’t work as expected. For more details, download the Anylogic File here. Remember to import some functions in the imports section: // imports section import java.io.BufferedWriter import java.io.File import java.io.FileWriter import java.io.BufferedReader import java.io.FileReader import java.io.IOException import java.text.* įrom there, we can create additional functions to select the tables to be exported. After 5 years, the simulation will finish. Each agent saves its data at a given rate. Import functions in the advanced Java section of the experiment.Write code in the experiment Java Actions section so that to save data every time you run an experiment.Define a variable to specify where to save the data (i.e., path).Define a parameter variation experiment.Create a function to save the data of your simulation runs (e.g., agent’s status, age, etc.).Create the databases you need for your experiment, and be sure you add the columns iteration and replicate.The general setup using Anylogic PLE 8.6 would be: Here I follow a different approach by exporting an Anylogic database table to a CSV file within Java. However, we will still have the limit-of-rows limitation (check the Anylogic file linked below for a function to create Excel files from a database). We can create a function to save all the simulation tables into an Excel file as our experiment finishes. The issue with Excel files is, on the one hand, they are Excel files, and on the other, they are not suitable for big data (more than 1 million rows). Every time an experiment finishes, we can export the data (from a database) to an Excel file manually. ![]() The best way to do this in Anylogic would be using a database and then export, read, or connect to the database to process simulation results (although, see the section update below). When running a parameter variation experiment, that is, simulating over several iterations and replicates using parallelization, we usually need to collect a huge amount of data and have them in a format that then we can process using Python or R.
0 Comments
Read More
Leave a Reply. |