Utilities and Constants
Helper functions, constants, and enumerations.
These modules provide utility functions, constants, and example models.
Utility Functions (line_solver.utils)
The utils module contains helper functions for working with LINE models.
Mock module that can handle any attribute access
Constants and Enumerations (line_solver.constants)
The constants module defines enumerations and global constants used throughout
the LINE Solver package.
Scheduling Strategies
- class SchedStrategy(*values)[source]
Bases:
EnumScheduling strategies for service stations.
Values match lang/base.py SchedStrategy for consistency.
- LCFSPI = 3
- HOL = 9
- LPS = 17
- SETF = 18
- FCFSPR = 22
- EDF = 23
- JOIN = 25
- EDD = 27
- SRPT = 28
- SRPTPRIO = 29
- LCFSPRIO = 30
- LCFSPRPRIO = 31
- LCFSPIPRIO = 32
- FCFSPRPRIO = 33
- FCFSPIPRIO = 34
- PSJF = 36
- FB = 37
- LAS = 38
- LRPT = 39
- FSP = 40
- PAS = 41
- OI = 42
Distribution and Process Types
- class ProcessType(*values)[source]
Bases:
EnumTypes of stochastic processes for arrivals and service times.
- BMAP = 22
- MMAP = 23
- DUNIFORM = 24
- BERNOULLI = 25
- PRIOR = 26
- GEOMETRIC = 27
- ME = 28
- RAP = 29
- DISCRETESAMPLER = 30
- ZIPF = 31
- DMAP = 32
- EMPIRICALCDF = 33
- NHPP = 34
- static isMarkovian(t)[source]
True when
sn.proccarries an exact matrix representation of a process of typet: a genuine (D0, D1) pair, or its matrix-exponential analogue for ME/RAP.The distinction is about
sn.proc, NOT about whatgetProcessreturns.getProcesshands back raw distribution PARAMETERS for several non-Markovian families – Gamma, Weibull, Lognormal, Pareto and Uniform return two scalars (Pareto{alpha, k}, Uniform{min, max}) – and the network refresh replaces those withmap_erlang(mean, n)before storing them insn.proc, wheren = ceil(1/SCV)capped at 100 (n = 20whenSCV < CoarseTol). That fit matches the mean, and matches the SCV only whenSCV <= 1: Pareto with SCV 64 givesn = 1, a single exponential of SCV 1. So for these typessn.procis an approximation, not the law that was requested, and nothing on the cell says so – the only signal issn.procid.Solvers that read
sn.procas if it were the exact law must gate on this predicate. It is the procid-level counterpart of the JAR’sDistribution.isMarkovian(), i.e. of the Markovian class hierarchy, so the two lists must stay in step.
Node Types
Job Class Types
Routing Strategies
Service Strategies
Solver Types
Metric Types
Drop and Replacement Strategies
- class DropStrategy(*values)[source]
Bases:
EnumStrategies for handling queue overflow and capacity limits.
WaitingQueue: Jobs wait in a waiting queue when capacity is exceeded
Queue: Alias for WaitingQueue
Drop: Jobs are dropped (lost) when capacity is exceeded
BlockingAfterService: Jobs are blocked after service completion
BlockingBeforeService: Jobs are blocked before service starts
ReServiceOnRejection: Rejected jobs are re-served at the upstream station
Values match the MATLAB DropStrategy constants and the JAR jline.lang.constant.DropStrategy ids, which are the interchange encoding of sn.droprule and sn.regionrule. Keep the three Python definitions of this enum (here, lang/base.py, api/sn/network_struct.py) numerically identical: they are written and read by different modules over the same sn fields.
- BlockingBeforeService = 3
- ReServiceOnRejection = 4
Join Strategies
- class JoinStrategy(*values)[source]
Bases:
EnumStrategies for join node synchronization in fork-join networks.
STD: Standard join (wait for all parallel branches)
PARTIAL: Partial join (proceed when some branches complete)
Quorum: Quorum-based join (wait for minimum number of branches)
Guard: Guard condition join (custom completion criteria)
Layered Network Types
- class CallType(*values)[source]
Bases:
EnumTypes of calls between tasks in layered networks.
SYNC: Synchronous call (caller waits for response)
ASYNC: Asynchronous call (caller continues immediately)
FWD: Forward call (caller terminates, response goes to caller’s caller)
- class ActivityPrecedenceType(*values)[source]
Bases:
EnumTypes of activity precedence relationships in layered networks.
These specify how activities are ordered and synchronized: - PRE_SEQ: Sequential prerequisite (must complete before) - PRE_AND: AND prerequisite (all must complete before) - PRE_OR: OR prerequisite (any must complete before) - POST_SEQ: Sequential post-condition - POST_AND: AND post-condition - POST_OR: OR post-condition - POST_LOOP: Loop post-condition - POST_CACHE: Cache post-condition
Polling Types
Event and Timing Types
- class EventType(*values)[source]
Bases:
EnumTypes of events in discrete-event simulation.
INIT: Initialization event
LOCAL: Local processing event
ARV: Job arrival event
DEP: Job departure event
PHASE: Phase transition event in multi-phase processes
READ: Cache read event
STAGE: Staging area event
- READ = 6
- ENABLE = 8
- FIRE = 9
- PRE = 10
- POST = 11
- RENEGE = 12
- RETRY = 13
- SWITCH = 14
- FAILURE = 15
- REPAIR = 16
Verbose Level
Global Constants
- class GlobalConstants[source]
Bases:
objectGlobal constants and configuration for the LINE solver.
- Immediate = 100000000.0
- classmethod isLibraryAttributionShown()[source]
True if the library attribution has already been printed.
- classmethod setLibraryAttributionShown(value=True)[source]
Record that the library attribution has been printed.
- classmethod get_instance()
Get the singleton instance of GlobalConstants.
- classmethod get_verbose()
Get the current verbosity level.
- classmethod set_verbose(verbosity)
Set the verbosity level for solver output.
- classmethod get_constants()
Get a dictionary of all global constants.
Example Gallery (line_solver.gallery)
The gallery module provides a collection of example queueing models for
validation, testing, and learning purposes.