logic and actions to my transporters fleet in the flow chart in anylogic - anylogic

Iam trying to build a model represented as shown but the main problem is how to put my hands on transporters and can do sequence logic on them while been loaded and unloaded along the path among my flowchart sequence.assign queue and delay blocks to my transporter type.
error while doing that.
First, i wanted to make a queue and delay before reaching loading point but when i ran the model i had an error as i tried to cast the delay and the queue to my transporter agent (forklift) and not the material item type(agent) , and when i tried to cast it to my agent (material item type) it didn't respond or see the delay or the queue and the transporter didn't stop.
After loading i want to make a second stop (delay) and queue of transporters out side it but , the model only see the delay and (loaded transporters) ran through the queue and stop in the delay block and i want to investigate the queue but the transports didn't stop in it.

Not quite clear what you need but it sounds like you want to explore preparation flow charts as part of Seize and Release actions, see https://anylogic.help/library-reference-guides/process-modeling-library/resourcetaskstart.html.
With these, you can make your resources (forklifts) follow some flow chart logic before they are actually being seized by your agents. This also works with transporters afaik

Related

How to combine transporter related blocks with Delay, Queues and other blocks from Process Modelling Library?

A source is producing "productA". "productA" is moved by a transporter called "agv" from node1 to node2. On the way between the two nodes I want to put several tasks like for example delay or queue. These tasks can be implemented by Process Modelling Library blocks. When using them you have to set an agent type. Which type do I use now? "productA" or "agv"? When using "agv" an error accurs because that type is not equal to the source agent. When using "productA" tasks from the process Modelling blocks are only executed for this agent, not for "agv". How to deal with that? Is there a way to create a new agent which contains "productA" and "agv" and overwrites the source agent? How will that not contradict with the transporter fleet block?
You need to use ProductA as this is the main agent flowing through the blocks. It just "uses" an AGV to be moved around, similar to a resource.
If you want to stop and do things with the product and the AGV, you use the SeizeTransporter block first, this makes your product seize an AGV.
Then, you can make them do anything by dropping blocks: queues, delays, Move By Transporter. Just make sure to finish up with a Release Transporter block when all is done.

Truck (Agent) Hitbox in process modeling library

im creating some paths with the process modeling library. The trucks shall stop in series when waiting for the "go" signal to go on.
At the moment the trucks are waiting "within" each other.
How to tell the trucks to recognize not the stopnode only but also the hitbox of the truck which arrived before him?
Thanks in advance
Chris
The trucks shall stop in series when waiting for the "go" signal to go on.
At the moment the trucks are waiting "within" each other. [...]
How to tell the trucks to recognize not the stopnode only but also the
hitbox of the truck which arrived before him?
AnyLogic allows for agents to queue along a path (from an animation perspective) whilst in a Queue block. So don't make them move to the stop-node (which I assume you are doing explicitly): make them (from a process point-of-view) go into a Queue which is animated via the path from the stop node 'backwards'. (This is the "Agent location" setting of the Queue block.) How you hold them in the queue and release them when they need to depends on the nature of your model; e.g.,
Use a Hold block following the Queue (if it makes sense to release them all at once)
Use a 'dangling' Queue block which you pull agents out of programmatically (e.g., via its removeFirst function) and then add them somewhere else in the process via an Enter block.
Use a Seize block (which has a built-in Queue you can set the location of) with the resource seized representing the 'token' you need to proceed.
NB: From the process perspective, they are in a Queue which happens to be animated as queueing along a path. This isn't exactly the same as modelling the 'spatial reality' of being in a queue: see this question.
Simple solution is to turn your truck agents into Transporters from the Material-handling library. They have build-in collision avoidance.
However, this can slow large models so you may want to convert them only when you need collision avoidance and then convert back to "simple" Truck agents again.
Else, you need to build your own additional stop-nodes and code spatial queuing manually. Possible but not straight forward

How to stop or suspend and restart “service delay" or the "delay" blocks from the agent based diagram?

By following your advice I’m constructing small models to learn how to use AnyLogic and build my simulation.
I need discrete events diagram interacting with agent based, where the agent based will represent a “service process” based in a previous recommendation it was straight forward to trigger the agent based activity, but I cannot stop or suspend or delay the “delay” block, I tryed to use the “until stopDelay is called” function but I could not make it work, I decided to test with and cyclic event inside the discrete event agent and but was not possible. I am considering that maybe my approach is not correct, and I need to use a different strategy to stop the discrete events process while the agent-based process is running, however since agent based is attempting to simulate some human behaviour, I’m interested in the time variations this could cause to the discrete events process. So my question is how to stop or suspend the “service delay or the delay blocks and restart them from the agent based diagram?
If you just need to store an entity somewhere until Agent process is done then I would recommend using using a 'wait' block instead of a 'delay'. The whole point of a delay is to have a timed exit so suspending it doesn't align with the intended use-case. You can read more about 'wait' block here.
I found the the Job Shop model example, some blocks using stopDelayForAll(), with a "if" code block, so I noticed that it was using a parameter, so I made some changes and the code I'm using and worked is this:
if ( Inqueue >= queCap )
delay.stopDelayForAll();
"Inqueue" is a variable capturing data from the delay block and queCap is a parameter telling the queue block capacity.

How to have a condition simulating an error after a rackPick in Anylogic?

I have a problem with anylogic because I am not able to simulate an error happening to the moving resource (I have only one moving resource) of the rackPick block.
I tried to increase the delay (but I think this is not possible to do at runtime, because once the item has been picked from the rack store, I can find no way to restore the old delay)
I tried to reduce the speed of the moving resource (accessing to the correspondent resource pool), but I have the same problem described in point 1.
How can I do that?
I just need the moving resource to pause its job and resume programmatically.
Thanks a lot in advance.
Tricky one, here is one possible way:
make your RackRick/Store use a ResourcePool with custom agents
make the ResourcePool use a Downtime block
Setup the downtime block to resemble your failures. Easiest if you have stochastic failure rates.
Alternatively, you can experiment with priorities: have a very high-prior task that can preempt your RackPick/Store task. Set the RackPick "Task preemption policy" to "Wait for original resource".
(Will need some trial'n'error on your end :) )

How to store agents in a block untill a tronsporter can move them?

I'm a new AnyLogic user so hopefully this is a simple problem. I would like to use a block as to represent a storage area for items to be used in an assembly, I am using the delay block with delay time of 0, but maybe the queue block would be more appropriate? I have set up a model in which every X number of seconds a "truck" arrives and if the delay block contains less than a specified capacity of elements, the inject function is called to refill the block. This sort of works, but is seems that the agents are flowing through the delay block's out port and thus do not count toward its capacity (that makes sense to me...) resulting in my source blocks continuing to create agents when the system isn't ready for them. My delay block is followed by a "move by transporter" block which seems to be getting all of the delay blocks outputs immediately. There are only two transporters in my model and I am not sure why more than two agents can be accepted by the transporter block at a time. I set my transporter fleet to have a capacity of 2 but that did not solve the problem.
Any advice would be helpful! Perhaps a different approach is needed. My goal is to have an essentially unlimited pool of parts at the inlet of the factory, but only create agents when the downstream processes are able to pull them in. Thanks in advance!
Welcome to SOF :)
Best use a "Wait" block here:
Let your trucks dump stuff into "Wait" whenever they arrive. Your downstream block can now pull them when they are ready using myWaitBlock.free(someAgent for as many agents as they want to pull from it.
Similarly, you can use a Delay with infinite capacity and set its type to "Until stopDelay() is called". Then similarly as the "Wait" block, you call myDelayBlock.stopDelay(someAgent) when you want.
Another option: Use a hold-block in front of a normal (infinite) queue and unblock it when ready: myHoldBlock.unBlock(numToLetThrough) --> probably the easiest
PS: Please also check how to ask good questions here on SOF, yours is very long, much easier to understand with some screenshots :) --> https://stackoverflow.com/help/how-to-ask