Class LayeredModel

java.lang.Object
jline.examples.java.basic.LayeredModel

public class LayeredModel extends Object
Examples of layered networks
  • Constructor Details

    • LayeredModel

      public LayeredModel()
  • Method Details

    • lqn_rrobin

      public static LayeredNetwork lqn_rrobin()
      Round-robin call dispatch over a set of target tasks (lqn_rrobin.m).

      A client task issues its synchronous calls to three interchangeable server tasks in cyclic order rather than by probabilistic branching. The two models carry the same aggregate call rate; what differs is that round-robin removes the variance of the branching, which smooths the server queues.

      ONE call per invocation, its destination cycling over the three servers. A mean of 1 over 3 targets is where round-robin actually bites: the probabilistic twin makes 0..3 calls per invocation with the same mean, round-robin makes exactly one.

      Returns:
      the round-robin dispatch model
    • lqn_jsq

      public static LayeredNetwork lqn_jsq()
      Join-the-shortest-queue call dispatch over a set of target tasks (lqn_jsq.m).

      The twin of lqn_rrobin(): the target is the one holding the fewest jobs at dispatch time rather than the next one in cyclic order. What JSQ adds over round-robin is that the dispatch reacts to the state of the servers, so it also absorbs asymmetry in the service times, not only the variance of the branching.

      Returns:
      the JSQ dispatch model
    • lqn_bpmn_trace

      public static LayeredNetwork lqn_bpmn_trace()
      BPMN-derived layered network with OR and AND branching (lqn_bpmn_trace.m).

      Seven processors, seven tasks and sixteen entries: a reference task whose activity graph branches 0.6/0.4 through an OrFork, and a second-tier task whose graph forks and joins over an AndFork. Its point is the iteration trace, so the surrounding example drives the layered solver by hand rather than through the analyzer.

      Returns:
      the traced BPMN-derived model
    • lqn_paramident

      public static LayeredNetwork lqn_paramident()
      Base LQN whose think time and AS3 host demand are the hidden parameters of the EKF identification (lqn_paramident.m).
      Returns:
      the identification model, mirroring lqn_basic()
    • lqn_transient

      public static LayeredNetwork lqn_transient()
      Three-layer chain for the transient analysis (lqn_transient.m).

      A reference task T1 on processor P1 whose activity synchronously calls entry E2 of task T2 on processor P2. The three ensemble layers are the two processor (host) layers and the T2 task layer.

      Returns:
      the three-layer transient model
    • lqn_flatph

      public static LayeredNetwork lqn_flatph()
      Three-deep call chain for the squashed phase-type encoding (lqn_flatph.m).

      The middle task is at once a server to T1 and a caller of T3, so the two levels of the LQN accounting are both exercised. Under flat.ph a task station's service law is ALREADY the inflated entry law (host demand plus call counts times callee service and waiting), which the outer fixed point updates, exactly as lqns does under --squashed-layering.

      Returns:
      the three-deep chain model
    • lqn_srvnph

      public static LayeredNetwork lqn_srvnph()
      Activity graphs the series-parallel reduction composes exactly (lqn_srvnph.m).

      Exercises the two constructs srvn.ph handles exactly and the default routing encoding only approximates: an AND fork-join, whose branch times are a maximum and not a sum, and a geometric loop of mean 3.

      Returns:
      the fork-join plus loop model
    • lqn_basic

      public static LayeredNetwork lqn_basic() throws Exception
      Basic layered network with multiple processors and synchronous calls.

      Features: - Two PS processors P1 (2 cores) and P2 (3 cores) - Three tasks: T1 (50 jobs, REF), T2 (50 jobs, FCFS), T3 (25 jobs, FCFS) - Synchronous call chain: T1 -> E2 (1 call), T2 -> E3 (5 calls) - Demonstrates basic multi-tier application modeling

      Returns:
      configured basic layered network model
      Throws:
      Exception - if model creation fails
    • lqn_serial

      public static LayeredNetwork lqn_serial() throws Exception
      Basic layered network with two processors and synchronous calls.

      Features: - Two PS processors P1 and P2 with single server each - Task T1 (10 jobs, REF) with exponential think time (0.01) - Task T2 (1 job, FCFS) with immediate think time - Activities with serial precedence and synchronous calls - Demonstrates basic layered network modeling

      Returns:
      configured layered network model
      Throws:
      Exception - if model creation fails
    • lqn_multi_solvers

      public static LayeredNetwork lqn_multi_solvers() throws Exception
      Layered network with infinite servers and APH service.

      Features: - Two infinite capacity processors (P1, P2) - Task T1 (1 job, REF) with Erlang think time - Task T2 (infinite jobs, INF) with immediate think time - APH service distribution with high variability (SCV=10) - Synchronous call with multiplicity 3

      Returns:
      configured layered network with infinite servers
      Throws:
      Exception - if model creation fails
    • lqn_server_pools

      public static LayeredNetwork lqn_server_pools(boolean compatibility) throws Exception
      A processor whose servers are not interchangeable.

      P1 declares three servers, but they are not a homogeneous pool: S1 is dedicated to task T2, S3 to task T3, and only S2 can take either. Neither task can therefore reach more than two of the three servers, and the model is a different system from a plain multiplicity-3 processor even though it holds the same number of servers.

         P1 (3 servers)     S1 --- T2
                            S2 --< T2, T3
                            S3 --- T3
       

      The pools are declared with ServerType, the same class the heterogeneous queueing station uses, with the compatible entities being the OPERANDS of the layered server: the tasks of a processor, or the entries of a task.

      SolverLN lowers the declaration to the activated-server rate of SnCompatRate, carried onto the layer station as a joint dependence, so a compatibility declaration is an APPROXIMATION inside a layer and is admitted only under the class-switching layerings ("srvn.cs", "flat.cs").

      Parameters:
      compatibility - true for the compatibility graph, false for one fully-compatible pool of three (the neutral pool)
      Throws:
      Exception
    • lqn_setup

      public static LayeredNetwork lqn_setup() throws Exception
      Throws:
      Exception
    • lqn_twotasks

      public static LayeredNetwork lqn_twotasks() throws Exception
      Layered network with multiple entries and synchronous calls.

      Features: - Two PS processors with high task populations - Task T1 (100 jobs, REF) with Erlang think time - Task T2 (100 jobs, INF) with multiple entries (E2, E3) - Activity A1 makes synchronous calls to both E2 and E3 - Serial precedence pattern in T2 activities - Demonstrates concurrent service requests

      Returns:
      configured multi-entry layered network
      Throws:
      Exception - if model creation fails
    • lqn_bpmn

      public static LayeredNetwork lqn_bpmn() throws Exception
      Complex layered network with fork-join patterns and multiple precedence types.

      Features: - 7 processors with varying capacities and scheduling strategies - 7 tasks with different multiplicity and reference patterns - 16 entries across all tasks - OrFork, AndFork, OrJoin, AndJoin activity precedence patterns - Demonstrates advanced layered network control flow - Complex synchronous call patterns between layers

      Returns:
      configured fork-join layered network
      Throws:
      Exception - if model creation fails
    • lqn_workflows

      public static LayeredNetwork lqn_workflows() throws Exception
      Layered network demonstrating loop and fork-join precedence patterns.

      Features: - 3 processors: P1 (INF), P2 (INF), P3 (5 servers, PS) - Task T1 with loop precedence (3 iterations) - Task T2 with AndFork/AndJoin patterns - Task T3 with OrFork/OrJoin patterns (30%, 30%, 40% probabilities) - Nested synchronous calls between tasks - Demonstrates complex control flow in layered networks

      Returns:
      configured layered network with loops and forks
      Throws:
      Exception - if model creation fails
    • lqn_open_arrival

      public static LayeredNetwork lqn_open_arrival() throws Exception
      Entry-level open arrival: an exogenous Poisson stream that is not a call.

      Features: - One processor, one task, one entry taking Exp(0.2) open arrivals - Nothing else reaches T1, so the stream is carried by the thread pool it drives rather than by an open class of its own

      Rate 0.2 against a mean service of 1.6 is 0.32 of the host. With no caller T1 has no task layer, so SolverLN closes its caller chain on the known arrival rate, the construction a forwarding target gets. Reported: entry throughput 0.2, utilization 0.32, response time 1.6, which lqns gives exactly and lqsim (0.192-0.200) and LDES (0.19986 / 0.31957 / 1.599) confirm; MATLAB, native Python and the C++ port agree. The earlier reading of 0.425 / 0.68 / 2.3529 was an artifact of ALSO placing an open class on the layer, which loaded the host twice.

      Returns:
      configured layered network model
      Throws:
      Exception - if model creation fails
    • lqn_fork_open_arrival

      public static LayeredNetwork lqn_fork_open_arrival() throws Exception
      AND fork/join on a task that also receives an entry-level open arrival.

      Features: - Server task with two entries, each with its own AND fork/join - SE is called by the closed Client (rendezvous), OE takes a Poisson stream - OE has no reply activity: an open-arrival entry is send-no-reply

      External references: lqns 6.2.28 (valid) gives Client throughput 0.413391, Server task throughput 0.513391, OE throughput 0.1 with open-wait 1.22917; lqsim (T=5e5, seed 1234) gives 0.4154, 0.52242 and open-wait 1.10546. SolverLN refuses the combination: the fork-join transform mints its own Source and collides with the Source the open stream is routed through. The flat counterpart that IS solved is ForkJoinModel.fj_mixed_openclosed().

      Returns:
      configured layered network model
      Throws:
      Exception - if model creation fails
    • lqn_ofbiz

      public static LayeredNetwork lqn_ofbiz() throws Exception
      Throws:
      Exception
    • lqn_sockshop

      public static LayeredNetwork lqn_sockshop() throws Exception
      Sock Shop microservice layered network model.

      Features: - 7 processors: P1 (INF), P2_1 (PS, replication=2), P2_2-P2_3, P3_1-P3_3 (PS) - 7 tasks: T0 (1000 users, REF), T1-T5 and T6 (FCFS with various thread pools) - 12 entries, 24 activities with serial precedence - Processor replication on P2_1 (edge router) - Fan-in/fan-out for replicated task communication - Synchronous calls across a multi-tier microservice architecture - Based on the Sock Shop benchmark (atom2021)

      Returns:
      configured Sock Shop layered network model
      Throws:
      Exception - if model creation fails
    • main

      public static void main(String[] args) throws Exception
      Main method for testing and demonstrating layered model examples.

      Currently contains commented code for various testing scenarios: - XML parsing and export functionality - Solver integration and performance analysis - Model structure inspection and visualization - Ensemble analysis for layered networks

      Parameters:
      args - command line arguments (not used)
      Throws:
      Exception - if any example execution fails