Class LayeredExamples
This class contains Java implementations that mirror the example notebooks found in jar/src/main/java/jline/examples/java/basic/layeredModel/. Each method demonstrates a specific layered network concept using models from the basic package.
The examples cover: - Basic layered network structures with processors and tasks - Activity precedence patterns and synchronous calls - Multi-solver approaches for layered networks - Enterprise application modeling patterns - BPMN-style workflow representations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidlqn_bpmn()BPMN-style layered network (lqn_bpmn.ipynb).static voidIteration trace of the layered fixed point (lqn_bpmn_trace.m).static voidMethod 'flat.ph': the squashed layering with the composed encoding (lqn_flatph.m).static voidlqn_init()Initializing a layered run from the LQNS solution (lqn_init.m).static voidlqn_jsq()Join-the-shortest-queue call dispatch over a set of target tasks (lqn_jsq.m).static voidMulti-solver layered network (lqn_multi_solvers.ipynb).static voidOFBiz-style layered network (lqn_ofbiz.ipynb).static voidIdentify hidden LQN parameters from measured performance (lqn_paramident.m).static voidRound-robin call dispatch over a set of target tasks (lqn_rrobin.m).static voidSerial layered network (lqn_serial.ipynb).static voidA processor whose servers are not interchangeable (lqn_server_pools).static voidLayered network with a setup / delay-off task (lqn_setup.ipynb).static voidSock Shop microservice layered network (lqn_sockshop).static voidMethod 'srvn.ph': an entry's activity graph as a phase-type law (lqn_srvnph.m).static voidTransient (time-dependent) analysis of a layered network (lqn_transient.m).static voidTwo-task layered network (lqn_twotasks.ipynb).static voidWorkflow layered network (lqn_workflows.ipynb).static voidMain method demonstrating selected layered network examples.
-
Constructor Details
-
LayeredExamples
public LayeredExamples()
-
-
Method Details
-
lqn_rrobin
Round-robin call dispatch over a set of target tasks (lqn_rrobin.m).Only the squashed ("flat") layering can express this: under "srvn" each server task lives in its own submodel and is replaced, in the client's submodel, by a surrogate delay, so no node ever has arcs to more than one of them. The layer solver must also implement state-dependent routing (SSA here); MVA, NC and FLD are rejected rather than silently returning the probabilistic split.
- Throws:
Exception- if the solver fails
-
lqn_jsq
Join-the-shortest-queue call dispatch over a set of target tasks (lqn_jsq.m).The twin of
lqn_rrobin(), with the cyclic pointer replaced by the least loaded target at dispatch time. Like round-robin it needs the squashed layering and a layer solver carrying state-dependent routing.- Throws:
Exception- if the solver fails
-
lqn_bpmn_trace
Iteration trace of the layered fixed point (lqn_bpmn_trace.m).Drives the layered solver by hand (init, pre, analyze, post, converged) instead of through the analyzer, printing the largest throughput and queue length each layer carries at each iteration. That is what makes a non-converging or a silently-zero layer visible, which an aggregate table hides.
- Throws:
Exception- if the solver fails
-
lqn_paramident
Identify hidden LQN parameters from measured performance (lqn_paramident.m).Demonstrates
InferLqn.inferLqn, an Extended Kalman Filter that tracks hidden LQN parameters (host demands, think times) from measurable performance data, following Zheng, Yang, Woodside, Litoiu, Iszlai, "Tracking Time-Varying Parameters in Software Systems with Extended Kalman Filters", CASCON 2005.Two parameters are hidden: the reference-task think time (the paper's Z) and the P2 host demand of activity AS3 (the paper's service demand S_d). The measurable vector is [R(E1), U(P1), U(P2)]. A measurement sequence with a step change plus noise is synthesised, then the parameter trajectory is recovered.
- Throws:
Exception- if the solver fails
-
lqn_transient
Transient (time-dependent) analysis of a layered network (lqn_transient.m).getTranAvgreturns the transient mean queue length, utilization and throughput of every ensemble layer over time. The traces are assembled block-diagonally: layer e occupies a disjoint block of rows (its stations) and columns (its classes). Only transient-capable per-layer solvers (Fluid, CTMC, SSA) produce them; here the layers are solved with the fluid ODE solver. Do NOT set a timespan on the per-layer factory: the steady-state fixed point rejects it, and getTranAvg auto-selects the timespan per layer.The initial point is the layer's default state (all closed jobs at the reference station), NOT the converged occupancy, so each curve relaxes from all-at-reference to the layer steady state.
- Throws:
Exception- if the solver fails
-
lqn_init
Initializing a layered run from the LQNS solution (lqn_init.m).Runs the external solver first, when it is installed, then the layered solver on its own, and finally reads the response-time CDF off the layer the calls terminate in. The layer solver must be transient-capable for that last step, which is why it is the fluid one.
- Throws:
Exception- if the solver fails
-
lqn_flatph
Method 'flat.ph': the squashed layering with the composed encoding (lqn_flatph.m).A method name of the layered solver carries TWO decisions. The part before the dot is the LAYERING, which fixes what a submodel is; the part after it is the ENCODING, which fixes how an activity graph is written into that submodel. The four combinations are "srvn.cs", "srvn.ph", "flat.cs" and "flat.ph".
"flat" is the ALIAS of "flat.cs" and resolves unconditionally rather than probing "flat.ph", because a model is squashed in order to express the routed call groups that only the routing encoding dispatches; naming "flat.ph" is therefore not the same as naming "flat".
- Throws:
Exception- if the solver fails
-
lqn_srvnph
Method 'srvn.ph': an entry's activity graph as a phase-type law (lqn_srvnph.m).The default method turns every activity graph into routing: one class per task, entry, activity and call, plus Fork, Join, Router and ClassSwitch nodes. Method "srvn.ph" composes each entry graph into a single phase-type law by the exact series-parallel reduction, so a layer becomes a two-station cycle, Delay plus Queue, with one closed class per caller task. The sequencing survives as a distribution rather than as routing.
- Throws:
Exception- if the solver fails
-
lqn_server_pools
A processor whose servers are not interchangeable (lqn_server_pools).Prints the fully-compatible pool, which is the neutral declaration, and then the compatibility graph, under which neither task reaches more than two of the three servers.
- Throws:
Exception
-
lqn_basic
- Throws:
Exception
-
lqn_serial
Serial layered network (lqn_serial.ipynb).Shows serial activity precedence in layered networks with synchronous call patterns.
- Throws:
Exception
-
lqn_multi_solvers
Multi-solver layered network (lqn_multi_solvers.ipynb).Demonstrates different solver approaches for layered networks with infinite server capacity.
- Throws:
Exception
-
lqn_twotasks
Two-task layered network (lqn_twotasks.ipynb).Shows interaction between multiple tasks with synchronous call patterns.
- Throws:
Exception
-
lqn_bpmn
BPMN-style layered network (lqn_bpmn.ipynb).Shows fork-join patterns with OrFork, AndFork, OrJoin, and AndJoin activity precedence.
- Throws:
Exception
-
lqn_setup
Layered network with a setup / delay-off task (lqn_setup.ipynb).The servers of task F2 switch off when idle and pay a setup time when a request reactivates them.
- Throws:
Exception
-
lqn_workflows
Workflow layered network (lqn_workflows.ipynb).Demonstrates loop and fork-join precedence patterns with nested synchronous calls.
- Throws:
Exception
-
lqn_ofbiz
OFBiz-style layered network (lqn_ofbiz.ipynb).Enterprise application model inspired by Apache OFBiz with database and application layers.
- Throws:
Exception
-
lqn_sockshop
Sock Shop microservice layered network (lqn_sockshop).Demonstrates a multi-tier microservice architecture with processor replication, fan-in/fan-out, and PS scheduling.
- Throws:
Exception
-
main
Main method demonstrating selected layered network examples.- Throws:
Exception
-