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_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
      Large enterprise layered network model (ofbizExample substitute).

      Features: - 5 processors representing different system layers - Client layer with reference task (10 jobs) - 3 service layers with FCFS tasks - Database layer with FCFS task - Serial activity precedence with synchronous calls - Representative of Apache OFBiz-style enterprise architecture - Each service layer makes database calls

      Returns:
      configured large layered network model
      Throws:
      Exception - if model creation fails
    • 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