Jump to content

Selection of Multiple Vehicle Types


mtila21
 Share

Recommended Posts

Hello,

In my model, I have two vehicle types.  The first type, MyVehicle, is a subclassed vehicle similar to the vehicles in the SimBit Electric Vehicle, except they use Free Space Only.  The other type of vehicles are standard vehicles.  

My problem is when entities seize a vehicle for transport from one server, I want them to seize the closest MyVehicle and only seize a standard vehicle if no MyVehicles are available.  

The output node at each server is set to select from the transport list which includes both vehicle types.  If I set the reservation method to "Reserve Closest" the closest vehicle of either type is reserved and if I set the reservation method to "Reserve Best", MyVehicle[1] will be attempted to be seized even if it is not the closest MyVehicle.  

I assume there is a way to use an add-on process to control which vehicle is seized, but I am unsure.  

Just FYI, I have MyVehicles starting at two different HomeNodes, 5 per node.  

Any thoughts would be greatly appreciated!! Thank you!  Please let me know if this description is not clear.  

Link to comment
Share on other sites

The problem simplified:

Right now I am trying to create an add-on process for each server to decide if any MyVehicles are not in use, and if true a MyVehicle will be seized based on smallest distance and if false seize a standard vehicle also based on smallest distance.  I know how to do the seize steps, but I do not know what to write for the condition in the Decide step.  Is it even possible to check if any of a vehicle type are not in use in a decide step?

Thanks again!

Link to comment
Share on other sites

First rank the vehicles accoding to your preference in your node list (My vehicle first then the standard vehicles). Then, setting "reservation method" as "reserve closest" and "selection goal" as "preffered order" and "selection condition" as "Candidate.Vehicle.ResourceState!=1" will work for you.

Link to comment
Share on other sites

Thanks for the reply!  I think I have implemented this the way you are describing, but the closest of the two vehicle types, either MyVehicle or standard vehicle, is still being selected.  If you have any other ideas, they would be greatly appreciated!! 

 

Now,  I'm trying to play around with "Reserve Best" and a selection condition that might choose the closest of all possible candidate types.  I've tried  Candidate.Transporter.NetworkDistanceTo.Node(Output@Server) with selection goal of smallest value and this still just picks the closest of the two vehicle types.  

Link to comment
Share on other sites

I have made a small model with the issue.  You will see the green MyVehicles start at two nodes.  MyVehicle[1] is further away, but will be selected first.  I want MyVehicle[2], the closer of the two MyVehicles, to be selected first.  I only want the blue Vehicles selected if both MyVehicles are in use.  

SmallModel.spfx

Link to comment
Share on other sites

×
×
  • Create New...