FAQ -> Troubleshooting

This document lists questions that were frequently asked by our customers along with solutions.

If you have searched for the solution of your problem and found that it is still neither mentioned in AnyLogic Help, and in this F.A.Q., feel free to contact our technical support group using the Get Support toolbar button.

AnyLogic Support Team will gladly help you to solve all the issues you might come up with, either technical (e.g. my model does not compile successfully, throwing out an error) or modeling ones (e.g. what modeling approach is best in solving my problem?)


Process Modeling Library

Pedestrian Library




Charts and datasets

System Dynamics


Error: No more handles

The error occurs frequently on some hardware configurations, e.g. when you click inside a complex control in the Properties view.

There is no easy way to solve the problem. We can suggest you to close the models you do not need currently and relaunch AnyLogic.

To temporarily solve the problem, close the error message, then click the Properties view tab, and continue your work:

This technique saves you from this error just for a limited time, then you have to repeat the same actions.

Compilation error: Invalid name for agent type: word reserved by AnyLogic Engine

You created the agent type with the name that is already in use by AnyLogic (e.g., Map).

Double-click the error description in the Problems view and AnyLogic will navigate to the Name property of the corresponding agent type. Rename the agent type and compile the model again. The error should go away.

I got "Out Of Memory" error message. How can I fix it?

The error like that may happen when the model starts, or during the model execution. It is frequently followed by a comment “Java heap space”. The error like that does not mean your model has reached the limits of your computer, and in most cases it can be efficiently handled.

The straightforward way of dealing with this problem is to increase Java heap space. By default the memory allocated to your model is limited to 64 Megabytes, which is well under the capacity of modern computer physical memory. Therefore you can simply allow the model to consume more. To do it go to the Advanced properties page of your experiment and enter the appropriate amount in “Maximum available memory” field.

An alternative way is to determine what causes the excessive memory consumption, and try to change the model so that it consumes less. The potential sources of the “Out of memory” problem may be:

You should also be aware that there often exists correlation between the memory consumed by the model and the simulation performance: in general, the bigger is the structure, the more time it takes to process (traverse) it. Therefore, by optimizing the model for memory, you normally achieve the higher simulation speed as well.

I got "IndexOutOfBoundsException" error

Probably you are referring to a non-existing item of a population/collection. Typically this error occurs when you call functions like get(i), remove(i), etc. passing the argument value i exceeding the population size.

For example, it could be code like collection.get(0) accessing element of empty collection collection.

Or the function like remove_people(people(1)) removing element of the population people.

A fatal error occurred while performing the refactoring

While performing a refactoring using Ctrl Enter, the dialog box was shown, saying that a fatal error occurred:

This is not the AnyLogic bug. As you can see from the detailed information given in the dialog, "This refactoring cannot be performed correctly due to syntax errors in compilation unit." This means that you has tried to perform a refactoring while your model element (in most cases, agent type) contained some critical errors. These errors made this class non-compilable, so that AnyLogic was unable to perform the required refactoring and recompile its code.

So we recommend you to Build model , fix all critical errors in it and finally repeat the refactoring again.

I got the message saying that my support services are expired

When you purchased the license for AnyLogic, you got a free year of support services. During this year, you were able to get support, install and use new builds of AnyLogic. So if you purchased AnyLogic more than one year ago and you never prolonged the services, this message indicates that the services have expired.

If you want to use the current and further versions of AnyLogic, you should prolong the support services. To prolong it please contact AnyLogic support team at support@anylogic.com.

I have successfully exported my model as a standalone Java application, but when I try to launch the generated .bat file, nothing happens

I can see just the following error message: 'java' is not recognized as an internal or external command, operable program or batch file.

Simulation Applications (simulation models created by using Export As Java Application function of AnyLogic) are Java applications and need Java to be installed on the computer. You can download Java from its official web site: https://www.java.com/en/download.

I have stochastics in my model, but all experiment runs produce the same results

Ensure that the Random seed (unique experiments) option is selected in the Randomness section of the simulation experiment Properties view.

Stochastic models require a random seed value for the pseudorandom number generator. In this case model runs cannot be reproduced since the model random number generator is initialized with different values for each model run. By default simulation experiments have fixed seed values, so the model random number generator is initialized with the same value for each model run, thus the model runs are reproducible. Please refer to the Random number generator help topic for details.

I run the model with the Fixed seed of random number generator, but the results are not reproducible

Please refer here to find the solution.

Javadoc is not generated for my library

When I export my library, only a .jar file is generated. I cannot see any Javadoc files, while I do select the Generate Javadoc check box in the Export wizard.

The reason is probably one of the following:

  1. Javadoc is not installed correctly on your computer
  2. javadoc.exe application is not specified in "Path" - environment variable. To make this application work you should go to the Control Panel|System|Advanced pane and press the Environment Variables button. Then please choose Path variable, press Edit... and add path to the javadoc.exe application.
After you fix these problems, please export the library once again and you will see doc folder with Java Doc files in HTML format inside.

But please note, that this Java Doc will not be displayed when you use custom library objects with code-completion feature. This mechanism is not implemented in AnyLogic.

AnyLogic toolbar disappeared

Probably it occurred due to your unintentional modification of AnyLogic UI layout.

In this or similar case when you occasionally arranged views in an inconvenient way, you can easily reset the current layout of AnyLogic views, editors, and toolbars to the default one by using the command Reset perspective from the Tools menu.

This command applies default layout settings (when the Projects view is docked to the left side of the application window, the Palette view - to the right one, the Properties - to the bottom, etc.). This command returns AnyLogic toolbar back to its original location under the menu as well.

Process Modeling Library

Model runtime error "The network must be defined for pallet rack"

The pallet rack is not connected to the network, so agents can not be put inside the pallet rack cells.

You should select the pallet rack shape in the graphical editor, and move it so that its center aisle lies on the path. Make sure the pallet rack is connected to the network by clicking it twice to select it. Your first click will select the entire network, and the second will select the pallet rack. The pallet rack should display a green highlight that shows it is connected to the network.

I got the error "java.lang.RuntimeException: root...: An agent was not able to leave this port"

This error indicates the logical error in your flowchart or the bottleneck in the modeled system. The reason of the problem is that agents are not able to leave the output port indicated with a red circle on the animated flowchart and enter the input port of the successive object.

Some flowchart blocks can push agents out and will not wait for the receiving blocks. If the agent is unable to leave the block in zero model time, a runtime error is generated. Therefore, AnyLogic does not allow implicit (hidden) buffering or blocking, and you will always be notified about an overflow situation and will be able to locate the bottleneck.

To solve this problem, you need to add a buffering object (e.g. Queue) after the emphasized port, or switch the block that generates the error to the PULL agent flow protocol. To switch from PUSH to PULL protocol, open the first Advanced property section of the flowchart block, and deselect the Forced pushing option.

I got the error "agent does not possess the resource it wants to attach or they are at different location"

It seems that you are trying to attach some resources to an agent using ResourceAttach object, but the agent and the resource unit are on different locations. So at first you should move them to the same place.

I tried to dynamically connect ports of flowchart blocks, but the code seems to do nothing

If you rewire the connections dynamically (by calling connect()/disconnect() or map()/unmap() functions of ports of flowchart objects), the end ports will not notice that and will continue behaving according to the out-of-date connections that were established at startup.

To bring the end port connections up to date you need to call function refreshConnections() of the end ports that are dynamically reconnected. For example, if the out port of myService is connected programmatically, you should call:


Demo model: Connecting Library Objects Dynamically

This demo model illustrates how to connect the Process Modeling Library objects dynamically. It has two separate parts of a flowchart that are connected by clicking on the button placed between them. Please have a look at the button's Action to understand the approach.

Unbatch does not extract agents from incoming batches

I have the Batch - Unbatch combination of objects in my flowchart, but Unbatch does not extract agents from incoming batches.

To enable Unbatch to extract original agents from incoming agents-batches, you should clear the Permanent batch check box for the preceding Batch object.

Pedestrian Library

Pedestrians walk over each other (their animation shapes overlap) when I animate them with custom shapes of big sizes. Is this behavior correct?

Pedestrian Library was developed to model pedestrian flows. So it was assumed that users will use the real sizes of pedestrians and layouts. Of course, you can draw big shapes and use them as animation shapes for pedestrians, but a diameter of, say, 20 meters certainly will not correspond to real life. If you want to make your pedestrians very large, please set the larger animation scale.


When I choose any fill color for my white shape using the Spectrum page of the Colors dialog, it remains white.

The reason is that the lightness for white color is set to maximum, and in spite of changing red, green, and blue components of your color, the lightness stays maximum, so that the color always looks as white.

You should decrease the lightness by dragging down the handle in the vertical slider located in the right part of the dialog (see figure below):


My agent receives messages from other agents but the required statechart transition is not triggered on message arrivals.

To receive messages in a statechart, you should forward incoming messages to this statechart.

To enable message forwarding, open the diagram of the agent type that receives the messages. Drag the diagram down in the graphical editor. You will see the connections element:

Click this element. In the Properties, open the Communication section, and select the check box corresponding to the required statechart in the Forward message to table.

I got the exception "Exception during discrete event execution: d != com.anylogic.engine.MessageDeliveryType" while running my agent-based model

You send the message to other agent using the function that is not supported by the environment where your agents live. Example: you use the function sendToRandomNeighbor(). This function is available only when the agent that calls this function lives in Discrete space. But in your model agents live in other space (Continuous, or GIS), and when this function is called, you see the mentioned runtime error message.

Please consult the Communication between agents help topic to find more information on communication methods and delivery modes.


Errors "Element is not reachable. Connect it to the statechart defined with Entry Point element" are shown for elements of my statechart

Each statechart element (state, transition, etc. ) should belong to some statechart, i.e. transition should connect some states or pseudo states of the statechart, state should be connected with a statechart. The situations when one end of the transition is “hanging” in the air, or state is not connected to is an error.

So, the first thing you should check is that all elements are connected to some statechart. Double-click the error in the Problems view and the element will be selected in the graphical editor.

Or, probably you have mixed up initial state pointer with statechart entry point as shown in the following figure:

As we can see, the user used initial state pointer as an entry point for the whole statechart. In this case we should delete the pointer and add statechart entry point instead of it like shown here:


My chart stays blank during the whole simulation, no data is drawn on it

The reason is probably one of the following:

My dataset takes the same samples twice when I choose Update automatically with some recurrence time

There two places where you can define how datasets should be updated:

  1. In the dataset properties
  2. In the chart properties

The most probably in your case auto update is set up in both places. Please go to the chart properties and choose Do not update automatically.

I cannot see CDF line on my histogram, while the Show CDF check box is selected

The reason is that CDF is not calculated by the particular Histogram Data object displayed by your histogram.

Please go to the properties of that data object and select the Calculate CDF check box there.

System Dynamics

Error: The method copyFrom(HyperArray) in the type HyperArray is not applicable for the arguments (int)

You have array system dynamics variable (e.g. stock) that has just a scalar value specified as its Initial value.

You should define there the value as the vector of values, one per each array element. The easiest way to define the array's initial value is to use the special wizard, please refer here for the details.


How to improve performance of a model with the logging being turned on?

If the simulation takes significantly more time with the logging being turned on, you can disable data collection for some logs that you do not need.

To turn off data collection for a log

  1. After you simulated your model at least once and got the logs collected, expand the Database branch in the Projects view.
  2. Expand the Log item's branch in the tree. You will see the list of logs in the Log branch.
  3. In the Projects tree, select the log you do not need, and select the I do not need this type of log check box in the properties.