Jump to content

Transferring entity from one vehicle to another


dvdl16
 Share

Recommended Posts

Hey guys, first of all, thanks for the contribution on these forums, I have learned a lot from the SimBit solutions along with forum threads. Herewith my first post/question:


Based on the Vehicle Fixed Route SimBit, I've set up the following model:

snip2.PNG.07763a34b8527e7e10d0997a7a2520a2.PNG

 

There are specific pickup/drop-off locations in each of the vehicles' fixed routes. Entities entering at the various Sources will each be allocated a destination location Sinks randomly (ie. at Source_1 Output Node the destination is randomly selected from a DestinationList, which contains all destination nodes). Enities in the right-side loop are only picked up by Vehicle 1, and entities in the left-hand loop are picked up by Vehicle 2.


Sequence Allocated to Vehicle 1: Output@Source_1 -- Input@Sink_1 -- Input@Sink_3 -- Input@Sink_5 -- TransferNode1

Sequence Allocated to Vehicle 2: Output@Source_2 -- Input@Sink_2 -- TransferNode1 -- Input@Sink_4


Of course some entities' destinations in the right-hand loop are set to destination sinks on the left-hand loop, i.e. Source 1 entity destination is set to Sink 4, and vv.

In this case I would like Vehicle 1 to transfer this specific entity to Vehicle 2 via TransferNode1, after which Vehicle 2 can drop the entity off at Sink 4. There can even be sort of a "swap" of entities which need to go to destinations not in its original vehicle's route/sequence.


I've tried setting up a process where Vehicle 1 stops at TransferNode1, checks if entities need to be transferred, and if so, waits for Vehicle 2 which then picks up the entity from TransferNode1.

Actually I don't know where to start with this process, or if I'm even thinking in the correct direction?


Any ideas?


Thanks in advance

snip.PNG.67752d8cf801c9dbb7952a112804d561.PNG

Link to comment
Share on other sites

All right to start solving the problem, I created logic for both the vehicles (add-on process triggers > Loaded) to Search through the opposite loop/vehicle's SequenceTable for the DestinationNode assigned to the loaded entity. If the Search step finds the DestinationNode in that Table, it assigns the DestinationNode.ID to a temporary integer state, and sets the entity's priority to the other loop's vehicle's priority. After the Assign Step, a SetNode step is used to set the entity's destination to TransferNode1 (the node between the two loops).


At the TransferNode: Upon entered, a process is triggered in which a Decide step checks whether a entity or vehicle enters the Node (Entity.Is.DefaultEntity), and if it is a DefaultEntity, a SetNode step sets the Entity's DestinationNode to the temp variable assigned earlier.


I used one transfernode/no paths between the loops as I would like to force the vehicles to wait for the entity to be picked up by the other vehicle before moving on.


The above logic mostly solves my initial question, but I'm struggling with one more thing:

- If both vehicles want to transfer entities at the mutual transfernode, they just pause and no swapping is possible. The node's capacity is set to infinity, must I rather place a delay in one of the vehicles' transfer logic to overcome this?


Find attached the model for reference purposes

Model_Transfer_Question.spfx

Link to comment
Share on other sites

×
×
  • Create New...