Incorrect item width after batch/unbatch - anylogic

i am trying to transport a batch of 2 boxes form a conveyor to anotherone with the help of an AGV.
Without the batch block its workling flawless, but the agv can only tranport a single box by time, thats why the batch block come into play.
The AGV picks up the batch of two boxes and when it wants to unload them on the next conveyor AnyLogic displays the following error message.
Error Message
Console
And the two boxes are not wider then the conveyor.
Boxes on conveyor
spreadsheet

The problem was located in the batch blog.
Because I set the dimentisons in the agent, I did not think about changing them but when not clicking at the checkbox change dimensions and actually set them to the parameters to the real ones the dimensions will be set to 1 meter, in height, width and lengh independent from the dimensions of the agent.
I discovered this as I let output the with of the agent on the console, when it was moved to the AGV.
Configuration Batch Blog

Related

Resource layout creation in Anylogic

I am using creating my equipments as resourcepools which are created within a rectangular node as a zoning region. During the model run I will increase or decrease the equipment quantity using a slider. I have set the settings to destroy the units when capacity is reduced (as guided in this thread Removing agent when resourcepool capacity reduced). However, after reducing the capacity, the first few rows of resources are destroyed and when the capacity is increased again, new equipments are built from the last row within the node, leaving the first few rows permanently empty. How can I rearrange the layout to always fill up the empty regions first?
You need to take control of positioning the agents yourself. Use the "on unit creation" code box to 'unit.setXY(...)' and position them where needed. Note that AnyLogic does also not care about positioning agents on top of each other. So if you want to have a concept of "this space is taken" you need to model that explicitly as well, best via a custom agent type itself.

Time plot does not update

I have two agents:RE and SUB.
Agent RE is the content and Agent SUB is the container.
The container SUB moves to a gis point and picks up RE and I want to know the number of RE that picked up by the container.
I tried to use time plot to obtain the number and visualize it, with code agent.contents().size().
But the time plot did not update after I run the model.Do you have any solution to this?
enter image description here
enter image description here
/wYAkZ.png
Appreciate for any help!
enter image description here
enter image description here
Based on your screenshot you are trying to plot the size of the container element inside the pickup object (which will always be empty) and not the size of the container agent that is used in the pickup object.
See the simple example model below
As you can see when an object exists the pickup block I add the size of the contents it is carrying to the dataset.
Since I am adding the data manually to the data set I have disabled all auto-updating on the data set
as well as the chart
For the simple example I have set the container agent (the top source) to sent agents about every minute, and for the agents that will be loaded into the container to arrive about every second.
Here are the results

Change agent size presentation throughout the model

I'm building different size modules and I want to reflect that in my simulation run presentation aspect. I have the parameters set (height, width, length) on the agent but it wouldn't change when I run the simulation. The first image shows how it is now but I want it to look like the second image I read the anylogic help but its not very helpful. Where is a good source to do this?

Simulink scope limit

I am running a simulink model in external simulation mode and am having the following problem: When I stop the simulation and get the data from the scope, it never saves more than the last 5,000 data points. I have tried unchecking "Limit data points to last:" checkbox, but that doesn't help. I also tried increasing that number to 10,000 but there was no difference in the number of points I was able to save.
I found that if I create a new model and set it to normal simulation mode, then I can save as many data points as I want. Can anyone explain why I might have this issue in external simulation but not normal simulation?
In external mode, data logging is effected by the Duration setting on the External Signal and Triggering panel of the External Mode Control Panel. Go to that panel and press the Help button for a description of Duration and how to change it

Matlab: opening propertyeditor or plotbrowser forces correct textbox annotation; annotation fails without it

I have a generally happily running program that takes files, plots them, spits out a pdf (letter size). I use annotations to put in a title above a set of three subplots, and to use as a footer with file info and date. I would like the title to be at the top of the page, filling up from margin to margin, centered.
I have two ways of running the program: in 'batch' mode and 'interactive' mode. When in 'interactive' mode, I create the figure with a simple figure() command. When in 'batch' mode, I create the figure with figure('visible','off'). Here is my command for making the annotation:
annotation(obj.hFigure(f),'textbox',[0 0.9 1 0.1],...
'String',title,...
'HorizontalAlignment','center',...
'FontSize',18,...
'LineStyle','none',...
'FitBoxToText','off');
Here, "obj.hFigure(f)" is simply a handle to the figure I am currently processing. As you can see, I place the figure near the top of the figure, and make sure that the text runs off the bottom of the box (in case it is larger).
My problem is with margins on the above annotation. In batch mode (no figures showing), I get 10% or so margins on either side of the text, which ruins the layout. In interactive mode (figures show up), I don't get the margins: the text correctly flows from one edge to the other.
I have narrowed down the problem to the following: I can get the correct response to the ps printing in batch mode if I make the figures visible (figure('visible','on')) AND open up
propertyeditor(gcf);
plotbrowser(gcf);
after each figure is plotted. This makes the program take about twice as long (which isn't a huge deal). But what I don't understand is: what do those two commands do that drawnow or refresh don't accomplish?!
I am unsure about your specific case, but when encountering this kind of problem in the past I have had great success by explicitly setting the figure size with:
set(gcf, 'Position', [100 100 300 300])
and then, before printing/saving setting the PaperPositionMode to auto, which seems to force the printed figure to be the same size as the one shown on screen:
set(gcf, 'PaperPositionMode','auto')