LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
opt_population_sizing.m
1% opt_population_sizing Largest closed-class population sustaining an
2% interactive response-time SLA, via BisectionSolver('max_feasible').
3% Interactive system: Delay (think) + PS server. Mirrors opt_population_sizing.py.
4
5model = Network('Interactive');
6think = Delay(model, 'Think');
7server = Queue(model, 'AppServer', SchedStrategy.PS);
8users = ClosedClass(model, 'Users', 1, think);
9think.setService(users, Exp(1.0));
10server.setService(users, Exp(2.0));
11model.link(Network.serialRouting(think, server));
12
13problem = opt.OptimizationProblem(model);
14problem.addVariable(opt.JobPopulation(users, [1 50]));
15problem.setObjective(opt.MinimizeCost([], [], [], {})); % pure feasibility sizing
16problem.addConstraint(opt.ResponseTimeConstraint(server, users, 2.0));
17
18result = opt.BisectionSolver(problem, 'max_feasible').solve();
19
20fprintf('Max users : %d\n', result.getVariableValue('Users_population'));
21fprintf('Feasible : %d\n', result.feasible);
22fprintf('LINE evaluations: %d\n', result.modelEvaluations);