Clear Filters
Clear Filters

customized N server.

1 view (last 30 days)
Bouqui
Bouqui on 24 Mar 2016
Answered: Mo Zhao on 29 Mar 2016
Am not sure how to get started on writing a matlab function for a custom N server. The simevent N server service control does not work for me in that when a preemption signal is received, it disables all servers, what i want is to be able cycle through clients being served and preempt the lower priority users in the system. what i need help with is a function that stores an entity for a period of time depending on its service time. once that time is up, the entity exits the block.

Accepted Answer

Mo Zhao
Mo Zhao on 29 Mar 2016
If you are using the new SimEvents in R2016a, the best approach to preempting N-Server differently for entities is probably to use MATLAB Discrete-Event System to write a custom block. To get started quickly, you can drag a “Selection Queue” block from the “Design Patterns” in the SimEvents library. Then you can make changes to the source MATLAB code of the MATLAB Discrete-Event System block in a copy and link it to the block. In that model, the anonymous entities into “call” input port select the “passenger entities” that previously entered “IN” input port with matching index to depart. This actually realizes a preemption tactic. You can change the preemption algorithm to make it fit your use case.
You can also find this “Selection Server” and other examples of custom blocks in http://www.mathworks.com/help/simevents/examples.html

More Answers (0)

Categories

Find more on Discrete-Event Simulation in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!