2

I need to measure the time forklift spends in collision, however movement_log

enter image description here

for agent type that is a forklift managed by transporter, fleet is not available. I also can not use statecharts because it uses much performance.

Situation: I am simulating a warehouse with one-way aisles and the capacity of these one-way aisles is 2 vehicles. There are situations

enter image description here

where a forklift (the yellow one) needs to wait behind another one in one-way aisle, I currently have that modeled properly I just don't know how to detect this situation and log it.

Thank you

Jaco-Ben Vosloo
  • 3,770
  • 2
  • 16
  • 33
Kristian
  • 21
  • 4
  • Do you move the vehicles by using points and paths? – Yashar Ahmadov Nov 15 '21 at 09:09
  • Yes, I use nodes and paths – Kristian Nov 15 '21 at 09:29
  • Understood, please share more information or screenshots on this *...I currently have that modelled properly*. And then you need to log which information exactly? Time? X,Y coordinates? Names of the forklifts? – Yashar Ahmadov Nov 15 '21 at 09:34
  • As in picture 2, forklifts stop when they can not move further on one way aisle, because of another forklift in front of them is doing picking, I need to measure the time for how long it has been waiting – Kristian Nov 15 '21 at 09:41

2 Answers2

1

I would do it as following:

  • Create a new 2-dimensional variable called collisionLog.

  • Check the speed [getSpeed() function] and state [TransporterState getState() function] every 1 second.

  • Write these into the collisionLog.

Once the simulation is completed, remove the rows with idle status.

Then do the calculations based on the fact that when speed is zero and transporter is busy, then you have the waiting vehicle.

Yashar Ahmadov
  • 1,616
  • 2
  • 10
  • 21
  • Hello, thank you for answer but this is no feasible for me, I have a huge model with large number of forklifts, checking any attribute every second would result in huge performance loss – Kristian Nov 15 '21 at 10:15
  • I suppose AnyLogic internally must know and detect somehow that forklift is supposed stop, I think I need to get to that logic/event – Kristian Nov 15 '21 at 10:22
  • As of version 8.7.4 there is no such automatic log... – Yashar Ahmadov Nov 15 '21 at 10:34
  • How does the Anylogic internally know that the forklift needs to stop because there is something in front of him ? there must be something that is already detecting it – Kristian Nov 15 '21 at 10:37
  • This is a good question which I think only AnyLogic support can answer. – Yashar Ahmadov Nov 15 '21 at 11:50
1

There is no accessible trigger point (typically an action of a block) to trap when transporters have collisions. Yes, that situation obviously has to be captured internally to enable the transporters to avoid collisions, but in this situation that is not exposed as a block action, or action anywhere else. (AnyLogic space markup elements never have actions, except for some of the newer Material Handling library ones like Station, because these effectively represent a process step.)

The Transporter Control block has all the settings for collision detection and avoidance, but no related actions.

So your alternatives are really

  • 'Scan' for this situation occurring: Yashar's answer, inferring that zero speed when non-idle means 'waiting due to collision' (which may or may not be 100% robust) being one way.

  • Explicitly break down the movement (from the process perspective) to define the potential 'conflicts' and decision-making within the process flow (e.g., if you're trying to move to an aisle, move to an entrance node, reserve a space in the aisle using resource pools or similar, and only enter when free). Clearly that doesn't cover every possible case, but may be useful in some situations.

The actions that do exist in the Transporter Control block could help a bit here (for both alternatives) since at least you have action points on entering paths and nodes. (You could also raise an enhancement request with AnyLogic to add collision-related actions here....)

I have a huge model with large number of forklifts, checking any attribute every second would result in huge performance loss

I also can not use statecharts because it uses much performance

Have you actually tried it though? Some things do not result in as much of a performance hit as you might think, and performance should not be an a priori 'that will be too slow' thing; ideally you have requirements for acceptable performance and you work round that. (There are always trade-offs between performance, functionality and maintainability.)

[You also don't say how you think using statecharts could have helped. Did you mean doing the 'scanning' approach via a statechart, say with cyclic entry/exit from a Scan state?]

Stuart Rossiter
  • 2,432
  • 1
  • 17
  • 20
  • I have implemented a statechart and added onChange to cyclic event (1 per second) for the forklift, the performance drop is not so heavy as I expected, main reason why I had a huge performance drop when I used this approac before was that I had enabled all the logging databases and was also updating statechart graph during the simulation run – Kristian Nov 18 '21 at 09:11
  • 1
    Yes, turning on the logging of model execution (even if you 'disable' most of the tables) massively slows things down and, even if those tables contain some info you might want, you normally only use this for testing/debugging which is really what they're intended for. (They get overwritten on each new run and aren't produced at all for multi-run experiments which makes sense since they don't currently include any columns to identify the run they are for --- they are intrinsically just for 'the last run conducted'.) – Stuart Rossiter Nov 18 '21 at 13:47
  • Any data you could get from the model-logging tables are normally things you could explicitly extract via model code anyway (some with more effort than others), so you can always create your own persistent outputs in exactly the format you want. – Stuart Rossiter Nov 18 '21 at 13:49