Jump to content
Simio Forum
Sign in to follow this  
15700771

Transferring vehicles from a Basicnode parkingstation

<t></t>  

  1. 1. <t></t>



Recommended Posts

Good day,

I have vehicles carrying entities in a batch process that arrive at servers at various time intervals. The vehicles are transferred to a basicnode parkingstation to wait until vehicles with the same properties arrive. These vehicles then have to be transferred to the server after the delay has occurred.

I am currently using [i]BasicNode.ParkingStation.Contents.ItemAtIndex(object).Vehicle.Priority[/i] to loop through the values in the queue, but I cannot transfer the specific vehicles to the input at the server once the conditions are met since the expression for the entity object in the Transfer step would not allow me to do so.

Hope you have a solution,

Thank you in advance
Rhynard Prins

Share this post


Link to post
Share on other sites
Do you use Search step to loop through the queue?

Each Search step has two endings original and found. The found token is associated with the found object (entity, vehicle whatever)
You just use Transfer step on this ending.

Search step also has many way to prioritize or match exact condition to find what you want.

Share this post


Link to post
Share on other sites
Thank you very much for the reply.

My problem is that the executing token is a ModelEntity and I want that ModelEntity to search through a Basicnode Parkingstation as soon as it enters the server to find the vehicle with the same priority as the executing token. The matching vehicle then needs to be transferred to the input node of the server. If I use the search step I keep getting an error that there is an object miss-match between the entity and the vehicle.

Is there a way to search through a Basicnode parking station with an executing token and return the vehicle to be transferred once it is found?

I am currently looping through the queue with [i]BasicNode.ParkingStation.Contents.ItemAtIndex(object).Vehicle.Priority[/i] using a decide within another decide step and the [i]object[/i] as the counter. It works to find the combination but cannot return the correct vehicle properties for the transfer step.

Hope you can help,

Rhynard Prins.

Share this post


Link to post
Share on other sites
You can use the search step to return the [i]index[/i] of the vehicle you're looking for fairly easily.

For the search step return value, try something along the lines of [i]Candidate.CurrentStation.Contents.IndexOfItem(Candidate)[/i] which should cause your tokens return value (Token.ReturnValue) to be set to the index of the object you want.

Alternatively, make use of the Search steps 'return index of item found' property.

Share this post


Link to post
Share on other sites
Model Entity bound token can still search through queue.

You just need to specify match condition like: ModelEntity.Priority == Candidate.vehicle.priority
ModelEntity is bound to the original token and you use the keyword [i]Candidate[/i] to specify, that you mean items that are in the queue.

Vehicles (and there can be more then one) which match the condition will be associated with the Found Token.
So on the Found branch you can use Transfer step.

Share this post


Link to post
Share on other sites
Sign in to follow this  

×