Jump to content

How to model a bidirectional server


Kstudent
 Share

Recommended Posts

Dear members,


I could really use your help with the following for my research project:

A server that is capable to processing parts in both directions (I can only find tandem servers)? To be specific a waterway lock that is able to transfer ships from one direction to the other. Besides that, there are multiple ship sizes, so server capacity fluctuates over time, depending on entering ships.


Any ideas??


Thank you in advance!

Link to comment
Share on other sites

I would think about the lock as like it is a vehicle. Basically lock is nothing but an elevator.


Use two nodes (one for top level of lock and one for bottom). Then use vehicle to transfer entities from one node to another.


You can use Evaluating transport request add-on process to check if your ship that is about to enter the lock (be picked up by vehicle) is not bigger than remaining capacity of lock. There is a simbit dealing with this, I bet.


For this you would probably need to subclass vehicle definition and add some state to vehicle and update it each time you load or unload a ship into the lock.

Link to comment
Share on other sites

Many thanks for all your input and ideas!


It is so clever to look like it is an elevator, going to try this right away!

Not sure whether I completely understand (just a novice user..) how to implement the add-on process to check for remaining capacity, but that is exactly how the model should look like!


Thanks for creating a simple model!!


Kindest regards,

Kim

Link to comment
Share on other sites

Just take a look somehere in help or documentation about Evaluating Transport Request, if token used in this process (so you have to search for tokens as well) is assigned value 0 or less, the entity trying to reserve transport on this vehicle is rejected and have to wait for another try.


This is just a simple model, for production use (models with multiple locks) it make a good sense to use object approach as David showed in Elevator Simbit. That way you would be able to have logic in one place.

Link to comment
Share on other sites

 Share

×
×
  • Create New...