jobshoplab.compiler package¶
Submodules¶
jobshoplab.compiler.compiler module¶
- class Compiler[source]¶
Bases:
object
jobshoplab.compiler.manipulators module¶
- class Manipulator[source]¶
Bases:
ABC
Abstract base class for manipulators.
- abstractmethod manipulate(init_state, instance)[source]¶
Perform manipulation on the initial state and instance configuration.
- class DummyManipulator[source]¶
Bases:
Manipulator
A dummy manipulator implementation.
- manipulate(instance_config, init_state)[source]¶
Perform manipulation on the instance configuration and initial state.
- class InstanceRandomizer[source]¶
Bases:
Manipulator
A manipulator that randomizes the instance configuration. but keeps the num jobs and machines the same.
- manipulate(instance_config, init_state)[source]¶
Perform manipulation on the instance configuration and initial state.
jobshoplab.compiler.mapper module¶
- class DefaultInstanceLookUpFactory[source]¶
Bases:
object
- get_default_machine(machine_id, prebuffer, postbuffer, machine_buffer_id)[source]¶
Get the default machine configuration with standard settings.
- Parameters:¶
- machine_id : str¶
The machine ID string (format: m-[number])
- prebuffer : BufferConfig¶
The prebuffer configuration for the machine
- postbuffer : BufferConfig¶
The postbuffer configuration for the machine
- machine_buffer_id : str¶
The ID for the machine’s internal buffer
- Returns:¶
The default machine configuration
- Return type:¶
-
get_default_buffer(buffer_id, parent, description=
None
)[source]¶ Get the default buffer configuration.
- get_default_transport(transport_id, buffer_id)[source]¶
Get the default transport configuration.
- class DefaultStateLookUpFactory[source]¶
Bases:
object
- class AbstractDictMapper[source]¶
Bases:
ABC
Abstract base class for dictionary mappers.
- abstractmethod __init__(loglevel, config, default_factory, *args, **kwargs)[source]¶
Initialize the AbstractDictMapper.
- Parameters:¶
- loglevel : int¶
The log level.
- config : Config¶
The configuration object.
- default_factory : DefaultInstanceLookUpFactory | DefaultStateLookUpFactory¶
- class DictToInstanceMapper[source]¶
Bases:
AbstractDictMapper
Dictionary to InstanceConfig mapper.
This class is responsible for mapping a dictionary representation of an instance configuration to an InstanceConfig object. It provides methods for parsing and mapping the specification, components, and logistics of the instance.
- map(spec_dict)[source]¶
Map a specification dictionary to an InstanceConfig object.
Takes a dictionary representation of the instance specification and converts it into a structured InstanceConfig object with typed components, including machines, transports, buffers, and logistics.
- Parameters:¶
- Returns:¶
The complete instance configuration object
- Return type:¶
- Raises:¶
ValueError – If required configuration elements are missing or invalid
- class DictToInitStateMapper[source]¶
Bases:
AbstractDictMapper
Dictionary to State mapper
jobshoplab.compiler.repos module¶
- class Repository[source]¶
Bases:
ABC
Abstract base class for repositories.
- class DslRepository[source]¶
Bases:
Repository
Repository for YAML files.
- class DslStrRepository[source]¶
Bases:
Repository
- class SpecRepository[source]¶
Bases:
Repository
Repository for specification files.
- class ApiRepo[source]¶
Bases:
Repository
Repository for API data.
jobshoplab.compiler.validators module¶
- class AbstractValidator[source]¶
Bases:
ABC
Abstract base class for validators.
- class DummyValidator[source]¶
Bases:
AbstractValidator
A dummy validator for testing purposes.
- class SimpleDSLValidator[source]¶
Bases:
AbstractValidator
Validator for Instance DSL syntax in YAML configurations.
This validator checks the structure and syntax of instance configuration files, ensuring they adhere to the expected format before they are processed by the mapper.
- validate(spec_dict)[source]¶
Validates the given instance specification dictionary.
- Parameters:¶
- Raises:¶
MissingRequiredFieldError – If a required field is missing.
InvalidFieldValueError – If a field has an invalid value.
JobSpecificationSyntaxError – If the job specification syntax is invalid.
InstanceSchemaError – For other schema-related errors.
- Return type:¶
None