How can I set that only one of the subservers can be used at a time?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Per server that I have there are two 'sub'-servers to choose. One 'sub'-server with 0,25 probability, and the other with 0,75 (=> this I implemented with an output switch with four equiprobable output ports and a pathcombiner with 3 input ports for the 0,75 probability). But there is an additional condition: only one of those 'sub'-servers can be used at a time. This means: total content of both servers at every arbitrary time is maximum 1. How can I implement this?
0 Kommentare
Antworten (2)
Doug Eastman
am 8 Jan. 2013
Bearbeitet: Doug Eastman
am 8 Jan. 2013
Here are two possibilities:
1) Do you really need two separate server blocks? The simplest solution might be to set an entity attribute based on what server it was processed by (75% chance Server Attribute is A, 25% chance it is B). Then you can simply use a Set Attribute block and a single Server block (note service time can depend on the attribute so you can set different times based on the server). No need for any routing blocks at all in this case.
2) If you really need two separate blocks, you can use the routing blocks you've set up. In order to only allow one entity in either server you can put an Enabled Gate before the Output Switch. For each server output the number of entities in block (#n), add those two signals together (Add block), then use a Compare To Zero to see when that signal equals (==) 0. Convert that signal to double using a Data Type Conversion block, then send that signal in the enable port on the gate block. So basically you will open the gate only when there are no entities in either server block.
0 Kommentare
Ry
am 10 Jan. 2013
1 Kommentar
Doug Eastman
am 10 Jan. 2013
You can use the Event-Based Random Number set to Arbitrary Discrete distribution. You can set the value vector to 1:n where n is the number of servers, then the probability vector can be the different probabilities for each of the servers. The trick is that you have to use a Signal Latch block to connect that signal to the port on the Output Switch block. See:
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!