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: Enum

Scheduling 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
static fromString(obj)[source]
static fromLINEString(sched)[source]
static toID(sched)[source]
class SchedStrategyType(*values)[source]

Bases: Enum

Categories of scheduling strategies by preemption behavior.

Distribution and Process Types

class ProcessType(*values)[source]

Bases: Enum

Types 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 fromString(obj)[source]

Node Types

class NodeType(*values)[source]

Bases: Enum

Types of nodes in queueing network models.

static from_line(obj)[source]

Job Class Types

class JobClassType(*values)[source]

Bases: Enum

Types of job classes in queueing networks.

  • OPEN: Open class (jobs arrive from outside the system)

  • CLOSED: Closed class (fixed population circulating in the system)

  • DISABLED: Disabled class (not currently active)

Routing Strategies

class RoutingStrategy(*values)[source]

Bases: Enum

Strategies for routing jobs between network nodes. Values must match MATLAB’s RoutingStrategy constants for JMT compatibility.

RL = 7

Service Strategies

class ServiceStrategy(*values)[source]

Bases: Enum

Service strategies defining service time dependence.

Solver Types

class SolverType(*values)[source]

Bases: Enum

Types of solvers available in LINE.

BA = 2
LDES = 4

Metric Types

class MetricType(*values)[source]

Bases: Enum

Types of performance metrics that can be computed.

SysDropR = 11
SysPower = 13
Tard = 24
SysTard = 25

Drop and Replacement Strategies

class DropStrategy(*values)[source]

Bases: Enum

Strategies 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: Enum

Strategies 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: Enum

Types 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: Enum

Types 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

class PollingType(*values)[source]

Bases: Enum

Polling strategies for polling systems.

DECREMENTING = 4
static fromString(obj)[source]

Event and Timing Types

class EventType(*values)[source]

Bases: Enum

Types 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
class TimingStrategy(*values)[source]

Bases: Enum

Timing strategies for transitions in Petri nets.

Verbose Level

class VerboseLevel(*values)[source]

Bases: Enum

Verbosity levels for LINE solver output.

Global Constants

class GlobalConstants[source]

Bases: object

Global constants and configuration for the LINE solver.

Immediate = 100000000.0
classmethod getInstance()[source]

Get the singleton instance of GlobalConstants.

classmethod get_instance()

Get the singleton instance of GlobalConstants.

classmethod getVerbose()[source]

Get the current verbosity level.

classmethod get_verbose()

Get the current verbosity level.

classmethod setVerbose(verbosity)[source]

Set the verbosity level for solver output.

classmethod set_verbose(verbosity)

Set the verbosity level for solver output.

classmethod getConstants()[source]

Get a dictionary of all global constants.

classmethod get_constants()

Get a dictionary of all global constants.