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.
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));
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));
18result = opt.BisectionSolver(problem,
'max_feasible').solve();
20fprintf(
'Max users : %d\n', result.getVariableValue(
'Users_population'));
21fprintf(
'Feasible : %d\n', result.feasible);
22fprintf(
'LINE evaluations: %d\n', result.modelEvaluations);