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
Presentation
Agents
Statecharts
System Dynamics
Database
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.
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.
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.
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.
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 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.
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.
Please refer here to find the solution.
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:
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.
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.
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.
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.
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.
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:
myService.release.out.refreshConnections();
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.
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 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.
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):
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.
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.
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:
The reason is probably one of the following:
There two places where you can define how datasets should be updated:
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.
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.
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.
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