jobshoplab.env.factories package

Submodules

jobshoplab.env.factories.actions module

class MinimalActionFactory[source]

Bases: ABC

__init__()[source]
Return type:

None

interpret(action)[source]
Parameters:
action : Action

Return type:

Action

class ActionFactory[source]

Bases: ABC

Abstract base class for action_factorys.

abstractmethod __init__(loglevel, config, instance, action_space, *args, **kwargs)[source]

Initialize the ActionFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

action_space : Space

get_dummy_action()[source]
Return type:

Action

abstractmethod interpret(action, *args, **kwargs)[source]

Interpret the given state.

Parameters:
state : State

The state to interpret.

action : Space

Returns:

The result of the interpretation.

Return type:

StateMachineResult

class DummyActionFactory[source]

Bases: ActionFactory

A dummy action_factory for testing purposes.

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the DummyFactory.

Parameters:
loglevel : int | str

config : __SPHINX_IMMATERIAL_TYPE_VAR__V_Config

instance : InstanceConfig

interpret(action)[source]

Interpret the given state.

Parameters:
action : Space

Return type:

Action

class BinaryJobActionFactory[source]

Bases: ActionFactory

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the ActionFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

interpret(action, state, *args, **kwargs)[source]

Interpret the given state.

Parameters:
state : State

The state to interpret.

action : int

Returns:

The result of the interpretation.

Return type:

StateMachineResult

class MultiDiscreteActionSpaceFactory[source]

Bases: ActionFactory

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the ActionFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

interpret(action, state, *args, **kwargs)[source]

Interpret the given state.

Parameters:
state : State

The state to interpret.

action : tuple[int]

Returns:

The result of the interpretation.

Return type:

StateMachineResult

jobshoplab.env.factories.observations module

class Observation

Bases: object

class ObservationFactory[source]

Bases: ABC

Abstract base class for observation factories. :param loglevel: The log level. :type loglevel: int :param config: The configuration object. :type config: Config :param instance: The instance configuration object. :type instance: InstanceConfig

abstractmethod __init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the ObservationFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

abstractmethod make(state_result, *args, **kwargs)[source]

Create an observation based on the given state.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

Returns:

The created observation.

Return type:

Observation

class DummyObservationFactory[source]

Bases: ObservationFactory

A dummy observation factory for testing purposes. Args:

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the DummyObservationFactory.

Parameters:
loglevel : int

config : __SPHINX_IMMATERIAL_TYPE_VAR__V_Config

instance : InstanceConfig

make(state_result, *args, **kwargs)[source]

Create a dummy observation. :param state: The state to create the observation from. :type state: State

Returns:

The dummy observation.

Return type:

Observation

Parameters:
state_result : StateMachineResult

class PassTroughObservation[source]

Bases: ObservationFactory

Pass through observation factory the whole state Args:

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the PassTroughObservation.

Parameters:
loglevel : int

config : __SPHINX_IMMATERIAL_TYPE_VAR__V_Config

instance : InstanceConfig

make(state_result, *args, **kwargs)[source]

Create an observation based on the given state.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

Returns:

The created observation.

Return type:

Observation

class SimpleJsspObservationFactory[source]

Bases: ObservationFactory

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the SimpleJsspObservationFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

The instance configuration object.

make(state_result, done=None)[source]

Create an observation.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

done : bool

Returns:

The observation.

Return type:

dict

class BinaryActionObservationFactory[source]

Bases: SimpleJsspObservationFactory

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the SimpleJsspObservationFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

The instance configuration object.

make(state_result, done)[source]

Create an observation.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

done : bool

Returns:

The observation.

Return type:

dict

class OperationArrayObservation[source]

Bases: ObservationFactory

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the ObservationFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

make(state_result)[source]

Create an observation based on the given state.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

Returns:

The created observation.

Return type:

Observation

class BinaryOperationArrayObservation[source]

Bases: OperationArrayObservation

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the ObservationFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

make(state_result, done)[source]

Create an observation.

Parameters:
state : State

The state to create the observation from.

state_result : StateMachineResult

done : bool

Returns:

The observation.

Return type:

dict

jobshoplab.env.factories.rewards module

class RewardFactory[source]

Bases: ABC

Abstract base class for reward factories. :param loglevel: The log level. :type loglevel: int :param config: The configuration object. :type config: Config :param instance: The instance configuration object. :type instance: InstanceConfig

Raises:

NotImplementedError – If the method has not been implemented.

abstractmethod __init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the RewardFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

abstractmethod make(state, terminated, truncated)[source]

Create a reward based on the given state.

Parameters:
state : State

The state to create the reward from.

terminated : bool

truncated : bool

Returns:

The created reward.

Return type:

float

class DummyRewardFactory[source]

Bases: RewardFactory

A dummy reward factory for testing purposes.

__init__(loglevel, config, instance, *args, **kwargs)[source]

Initialize the DummyRewardFactory. :param loglevel: The log level. :type loglevel: int :param config: The configuration object. :type config: Config :param instance: The instance configuration object. :type instance: InstanceConfig

Parameters:
loglevel : int

config : __SPHINX_IMMATERIAL_TYPE_VAR__V_Config

instance : InstanceConfig

make(state, done)[source]

Create a dummy reward.

Parameters:
state : State

The state to create the reward from.

done : bool

Returns:

The created reward.

Return type:

float

class BinaryActionJsspReward[source]

Bases: RewardFactory

__init__(loglevel, config, instance, sparse_bias, dense_bias, truncation_bias, max_allowed_time)[source]

Initialize the RewardFactory.

Parameters:
loglevel : int

The log level.

config : Config

The configuration object.

instance : InstanceConfig

sparse_bias : float

dense_bias : float

truncation_bias : float

max_allowed_time : int

make(state, terminated, truncated)[source]

Create a reward based on the given state.

Parameters:
state : State

The state to create the reward from.

Returns:

The created reward.

Return type:

float

Module contents