Arrange containers based on weight in different levels of PalletRack in Anylogic - simulation

I have an agent Container and it has a parameter: weight. The parameter weight draws its values from a custom distribution(mentioned below 1). Now, I want to arrange the containers based on its weight in the pallet racks. The heavier ones should go to the bottom levels of pallet rack and lighter ones should be at the top. The properties of my palletRack is also mentioned below 2. What should I write in Pallet Rack/Rack System field of rackStore block in order to achieve this? Or if there is some other way to do this please let me know.
As of now, I am arranging the containers on the basis of other two parameters: carrier & type. I want to add this additional criteria of weight. I have mentioned my current rackStore properties here. rackStore-properties
This is the current code in Pallet Rack/Rack System field :
(agent.carrier==Truck && agent.type==C20 ? palletRack4 : (agent.carrier==Truck && agent.type==C40 ? palletRack6 :(agent.carrier==Train && agent.type==C20 ? palletRack5 :palletRack7)))
Thank you in advance for your help!
weightDistribution
palletRack-properties

I am placing the container in a particular cell of the palletRack(i.e. with a given value for row, position & level).The row and position is defined as parameters of the agent Container. The level depends on the weight parameter of Container which is defined using a function. The values of row, position & level mentioned in rackStore properties can be found here: rackStore properties.
Here, agent.row= uniform_discr(0,1) as we have only two rows for a 2 rack 1 aisle palletRack. agent.position= uniform_discr(0,9) as the palletRack has 10 cells.
The function getLevel can be found here: function body
This approach assigns containers in a particular weight range to a particular level in the palletRack, but I would like it to be more generic such that, if the incoming container can be stored on any level, provided the containers below it are heavier.

Related

When having nodes of different sizes, edges with arrows enabled are not guaranteed to connect with nodes. How to fix that?

nx.draw_networkx_edges allows for only single value of node_size . The issue with that is that my nodes have different sizes. It means that if I'll set the edge's node_size to the "target" node's size, it will be mismatched with the "source" node's size. If the "target" is larger than the source, the edge will not be connected with the source node because it'll assume that it's bigger than it is. Is there any way to have an arrow connected with the border of both nodes if these nodes are of different sizes?
See:
Yes - use an array as your node_size argument for nx.draw_networkx_edges rather than a scalar. Contrary to your question, the function does accept multiple values:
node_size : scalar or array (default=300)
Size of nodes. Though the nodes
are not drawn with this function, the node size is used in determining
edge positioning.
The order of the nodes in the node_size array are given by the optional parameter nodelist. If this is not specified, the default is G.nodes().

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

AnyLogic: Populate Time Color Plot with one row per agent

In AnyLogic 8, how do I create a Time Color Plot which has one row for each agent in a pool of agents?
As explained in an answer to this question, I can create a separate dataset for each row, and then have the Time Color Plot display one row for each dataset. But this requires hardcoding the number of datasets (and thus the number of agents), whereas I want to create a model with a variable number of agents and thus a variable number of rows in the Time Color Plot.
This AnyLogic cloud model includes a Time Color Plot where each forklift in a pool of agents has its own row in a Time Color Plot. Unfortunately, because it is a cloud model, I cannot download the model to investigate how it is built.
How do I create a Time Color Plot where each row corresponds to an agent in a pool of agents (like in that linked cloud model)?
You can simply add the datasets programmatically using
chart.addDataSet();
Here is the code for the model you referenced where the chart starts off empty (except for the color setup) and you simply add the bars during run time.
You can also remove them as needed.

color based off multiple values in grafana stat panel

I'm using a single stat panel where the values can either be 0,1,2,3,6,7. Is there a way that I can define the color for each value separately? I see the thresholds but it seems it can only do it off of three values? Can I do this based of more than 3 values and with different colors each?
That is currently not possible. There is a feature request for support for multiple thresholds so hopefully a PR will come for it soon:
https://github.com/grafana/grafana/issues/3608