jobshoplab.state_machine.core package¶
Subpackages¶
- jobshoplab.state_machine.core.state_machine package
- Submodules
- jobshoplab.state_machine.core.state_machine.handler module
- create_timed_machine_transitions
- create_avg_pickup_to_drop_transition
- create_avg_idle_to_pick_transition
- create_agv_drop_to_idle_transition
- create_timed_transport_transitions
- create_timed_transitions
- handle_machine_idle_to_setup_transition
- handle_machine_setup_to_working_transition
- handle_machine_working_to_outage_transition
- handle_machine_outage_to_idle_transition
- handle_agv_transport_pickup_to_waitingpickup_transition
- handle_agv_transport_pickup_to_transit_transition
- handle_agv_transport_idle_to_working_transition
- handle_agv_transport_transit_to_outage_transition
- handle_agv_transport_outage_to_idle_transition
- handle_agv_waiting_pickup_to_waiting_pickup_transition
- handle_transition
- handle_transport_transition
- handle_machine_transition
- extract_time
- jobshoplab.state_machine.core.state_machine.manipulate module
- jobshoplab.state_machine.core.state_machine.state module
- jobshoplab.state_machine.core.state_machine.validate module
- Module contents
Submodules¶
jobshoplab.state_machine.core.transitions module¶
Transition definitions for the JobShopLab state machine.
This module defines the valid state transitions for various components (machines, transports, buffers) in the JobShopLab simulation. It implements a state machine pattern where each component type has its own set of allowed state transitions.
- class StateEnum[source]¶
Bases:
object
Enumeration of generalized component states for the state machine.
These states represent the common high-level states that different components can be in, abstracting away component-specific state details.
-
IDLE =
'Idle'
¶
-
RUNNING =
'running'
¶
-
OUTAGE =
'outage'
¶
-
FULL =
'full'
¶
-
EMPTY =
'empty'
¶
-
SETUP =
'setup'
¶
-
IDLE =
- class Transition[source]¶
Bases:
object
Base class for defining state transitions in the state machine.
This class provides the core functionality for validating state transitions by mapping component-specific states to general state categories and checking if transitions between these categories are allowed.
- states¶
List of valid states for the component type
- transitions¶
Dictionary mapping from states to allowed target states
- __init__(states, transitions)[source]¶
Initialize a transition validator with states and valid transitions.
- is_valid_transition(current_state, new_state)[source]¶
Check if a transition from current_state to new_state is valid.
Rules: 1. Self-transitions (to same state) are generally invalid 2. Exception: WAITINGPICKUP can transition to itself (to extend waiting) 3. The transition must be in the allowed transitions map
- class BufferTransition[source]¶
Bases:
Transition
Defines valid state transitions for buffer components.
Buffers can transition between IDLE, EMPTY, FULL, and OUTAGE states according to the defined transition rules.
- class MachineTransition[source]¶
Bases:
Transition
Defines valid state transitions for machine components.
Machines follow a specific cycle: 1. IDLE → SETUP: Machine prepares for processing a job 2. SETUP → RUNNING: Machine begins processing the job 3. RUNNING → OUTAGE: Machine finishes processing or encounters a failure 4. OUTAGE → IDLE: Machine becomes available again
- class TransportTransition[source]¶
Bases:
Transition
Defines valid state transitions for transport components.
Transport components (like AGVs) follow a specific cycle: 1. IDLE → RUNNING: Transport starts moving to pick up or deliver a job 2. RUNNING → OUTAGE: Transport completes its movement task 3. OUTAGE → IDLE: Transport becomes available again
Transports can also transition from RUNNING to RUNNING (as in TRANSIT to WAITINGPICKUP).