Class LqnAdapter
line_solver.opt.layered.
line-opt's core (OptimizationProblem/LineEvaluator/
decision variables/LineOptSolver) was written for the
flat Network: it copies the model, solves it with
SolverAUTO, and reads a per-(station, class) average table. A
LayeredNetwork cannot go through that path -- it is an ensemble of
per-layer submodels, solved by SolverLN into a per-LQN-node average
table (Node, NodeType, QLen, Util, RespT, ResidT, ArvR, Tput). This class is
the adapter that lets the same optimizer drive an LQN: element resolution by
name in a per-evaluation model copy, a quiet SolverLN factory, and a reshape
of SolverLN's per-layer service-rate sensitivity table.
IMPORTANT (see LayeredNetworkSensitivityTable): the per-layer table
holds WITHIN-LAYER PARTIAL derivatives, taken with the fixed-point layer
parameters held constant. It omits the cross-layer coupling term, so it is a
biased estimate of the total derivative of the solved layered model. The
optimizer's lqn_gradient='fd' mode finite-differences the whole
LayeredNetwork instead (correct total derivative); partial_sens uses
this table directly (cheap, biased); partial_plus_fd corrects it with
a periodic full-model finite difference.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringactivityProcessorName(LayeredNetwork model, String activityName) Name of the processor an activity ultimately runs on (Activity -> parent Task -> deployed Processor), or null if the chain is incomplete.computeLqnSensitivities(SolverLN solver) Reshape SolverLN's per-layer service-rate sensitivity table into{station||jobclass: {Tput,RespT,QLen,Util}}, each value the derivative of that layer row's mean measure with respect to that station-class service RATE.static booleanTrue if the model is a LayeredNetwork (LQN), false for a flat Network.static SolverLNmakeLqnSolver(LayeredNetwork model) Construct a quiet SolverLN for a per-evaluation LQN model copy.static ActivityresolveActivity(LayeredNetwork model, String name) Resolve an Activity by name inside a (possibly copied) LQN model.static HostresolveProcessor(LayeredNetwork model, String name) Resolve a Processor by name inside a (possibly copied) LQN model.static TaskresolveTask(LayeredNetwork model, String name) Resolve a Task by name inside a (possibly copied) LQN model.static StringtaskProcessorName(LayeredNetwork model, String taskName) Name of the processor a task is deployed on (null if undeployed).
-
Method Details
-
isLayered
True if the model is a LayeredNetwork (LQN), false for a flat Network. -
resolveActivity
Resolve an Activity by name inside a (possibly copied) LQN model. -
resolveTask
Resolve a Task by name inside a (possibly copied) LQN model. -
resolveProcessor
Resolve a Processor by name inside a (possibly copied) LQN model. The LQN has no getProcessors(); processors are theProcessorentries among the hosts, so this matches by name overgetHosts(). -
activityProcessorName
Name of the processor an activity ultimately runs on (Activity -> parent Task -> deployed Processor), or null if the chain is incomplete. Used both to tag a HostDemand variable with the host layer it perturbs and to key its row in the per-layer sensitivity table, whose host-layer rows are (Layer=processor, Station=processor, JobClass=activity). -
taskProcessorName
Name of the processor a task is deployed on (null if undeployed). -
makeLqnSolver
Construct a quiet SolverLN for a per-evaluation LQN model copy. Silences the layer/avg-table printing so an optimization run of thousands of solves does not flood stdout. -
computeLqnSensitivities
Reshape SolverLN's per-layer service-rate sensitivity table into{station||jobclass: {Tput,RespT,QLen,Util}}, each value the derivative of that layer row's mean measure with respect to that station-class service RATE. Returns null if the table is unavailable. See the class docstring for the partial-vs-total caveat.
-