MATLAB: It is possible to change the capacity of an entity server dynamically

event serverSimEvents

It is possible to change the capacity of an entity server dynamically? For example if the utilization exceeds some threshold then an the capacity increases (in effect adding another server). If so, how can this be done? Is there documentation I could look at? The entity server documentation didn't seem to have any clues.
For context, I'm modeling a cloud type service, where new servers are started as needed. I'm using the SimEvents library as it has queues, but if there is a better way I'd be happy to hear it.
Thanks.

Best Answer

Hi Scott,
Entity server itself does not support dynamic capacity currently. However, this is doable using several blocks in combination. Consider introducing several spare servers connected in parallel with the initial server, each connected thru an Entity Gate, which is controlled by the statistics port(#n) of the entity server(s) via a Simulink Function. If the number of entities in block exceeds certain threshold, the statistics would trigger the gate to open and place an additional server in connection.
You can also do this logic with MATLAB Discrete-Event System, where instead of drawing connections, you can write code to schedule the forwarding and processing events of server and this can put additional storages in use.
You can have a look at the complex examples to see how to use Simulink Functions with statistic ports of SimEvents blocks, and how to use MATLAB Discrete-Event System.
Thanks,
Mo