Inventory utils

Some additional classes and functions that help building inventory management environments.

source

OrderPipeline

 OrderPipeline (num_units:int, lead_time_mean:Union[ddopai.utils.Parameter
                ,numpy.ndarray,List,int,float], lead_time_stochasticity:Li
                teral['fixed','gamma','normal_absolute','normal_relative']
                ='fixed', lead_time_variance:Union[ddopai.utils.Parameter,
                numpy.ndarray,List,int,float,NoneType]=None,
                max_lead_time:list[object]|None=None,
                min_lead_time:list[object]|None=1)

Class to handle the order pipeline in the inventory environments. It is used to keep track of the orders that are placed. It can account for fixed and variable lead times.

Type Default Details
num_units int number of units (SKUs)
lead_time_mean Union mean lead time
lead_time_stochasticity Literal fixed “fixed”, “gamma”, “normal_absolute”, “normal_relative”
lead_time_variance Union None variance of the lead time
max_lead_time list[object] | None None maximum lead time in case of stochastic lead times
min_lead_time list[object] | None 1 minimum lead time in case of stochastic lead times
Returns None

source

OrderPipeline.get_pipeline

 OrderPipeline.get_pipeline ()

Get the current pipeline


source

OrderPipeline.reset

 OrderPipeline.reset ()

Reset the pipeline


source

OrderPipeline.step

 OrderPipeline.step (orders:numpy.ndarray)

Add orders to the pipeline and return the orders that are arriving


source

OrderPipeline.get_orders_arriving

 OrderPipeline.get_orders_arriving ()

Get the orders that are arriving in the current period


source

OrderPipeline.draw_lead_times

 OrderPipeline.draw_lead_times ()

Draw lead times for the orders


source

OrderPipeline.check_stochasticity

 OrderPipeline.check_stochasticity (max_lead_time)

Check that params for stochastic lead times are set correctly


source

OrderPipeline.check_max_min_mean_lt

 OrderPipeline.check_max_min_mean_lt ()

source

OrderPipeline.set_param

 OrderPipeline.set_param (name:str,
                          input:Union[ddopai.utils.Parameter,int,float,num
                          py.ndarray,List], shape:tuple=(1,),
                          new:bool=False)

Set a parameter for the environment. It converts scalar values to numpy arrays and ensures that environment parameters are either of the Parameter class of Numpy arrays. If new is set to True, the function will create a new parameter or update an existing one otherwise. If new is set to False, the function will raise an error if the parameter does not exist.

Type Default Details
name str name of the parameter (will become the attribute name)
input Union input value of the parameter
shape tuple (1,) shape of the parameter
new bool False whether to create a new parameter or update an existing one
Returns None

source

OrderPipeline.shape

 OrderPipeline.shape ()

Get the shape of the pipeline