The second conveyor functions as a buffer, so I would like the pusher to stop pushing whenever the buffer gets full. This way the excess pipes should keep on moving by means of the first conveyor.
However, right now the simulation just pushes them into each other when the buffer is full:
This fixes the problem with the overlapping products on the second conveyor, however it also brings the first conveyor to a halt.
Do you know if it is possible to have the first conveyor to continue running?
Cool, I get your point, it’s pretty smart, I guess your goal is to miss none of the workpiece.
Simply modify 2 lines of pusher’s script.
#while out_going_path and out_going_path.ComponentCount >= out_going_path.Capacity:
#delay(.1)
if out_going_path and out_going_path.ComponentCount >= out_going_path.Capacity:
continue
Do you also happen to know if it there is a way for the ‘second’ conveyor capacity to be automatically set based on the products that it is carrying?
The idea is that I would like to run different batches of products with various sizes and cycle times, and I would like to simulate for what batch type the buffer would get full.
Setting the buffercapacity manually however makes this very tedious
I guess it would also need some script to solve it. Do you have more details about it? Images or scene … ? It would be helpful to find an easier way to solve it.
One thing that I would like to add is that it also bases this automatically on the length of the buffer (length of the conveyor). Right now I manually added the value ‘1500’. How can I call this value inside the pusher script? (e.g. ConveyorOut.ConveyorLength)
outConveyor = comp.findBehaviour("PusherConveyorInterface").ConnectedComponent
capacity = math.floor(outConveyor.ConveyorLength / (part.Radius * 2.0))
if out_going_path and out_going_path.ComponentCount >= capacity:
continue
This is a very interesting topic. You could develop your own solver to input a production batch list and calculate how many stations you need or how long your conveyor would be.
Instead of using capacity, which is just a simulation abstraction, you could try to model this more realistically by having a volume or raycast sensor. The sensor would tell whether the area the products are being pushed to is free / has enough space to push another product into.
The size of the product you are about to push you can just get from its bounding box.
Great, thats what I was looking for. Thanks alot for the help!
And indeed an interesting topic, such a solver might be an idea to look into in a later stadium.
Thank you for the suggestion. Thats a good point, but because the production is in batches there will not be different sized products on the buffer at the same time. Simultenously, the system knows if products leave the buffer, so using the product- and buffer sizes is a realistic approach in this case