Statistics#

class automatic_warehouse.utils.statistics.warehouse_statistics.WarehouseStatistics(warehouse_actions: DataFrame)#

The main purpose of this object is to provide a set of methods to allow the programmer to easily manipulate the data of the simulation.

The purpose of use is:

from automatic_warehouse.warehouse import Warehouse
from automatic_warehouse.simulation.simulation_type.warehouse_simulation import WarehouseSimulation

# generate a Warehouse
warehouse = Warehouse()

# generate a simulation environment
simulation = WarehouseSimulation(warehouse)

# run the simulation
simulation.run_simulation()

statistics = WarehouseStatistics(simulation.get_store_history_dataframe())
action_completed_every(action: ActionEnum, time: TimeEnum) DataFrame#

Request the action to be completed, specifying the action requested and the time period. Calculate a Series with Start datetime, Finish datetime and their relative count.

If an action is started at (e.g.) 10:58 and finished at 11:05, it will not be counted in the 10-hour counter. So it’s possible to find some lines with a Start time different from the Finish time.

Return type:

DataFrame

Parameters:
  • action (ActionEnum) – the type of action to consider.

  • time (TimeEnum) – time period requested.

Returns:

a table of “action” actions completed each “time”, both given as parameters. The DataFrame contains three columns: Type of Action, Start, Finish, and Count.

action_finished_every(action: ActionEnum, time: TimeEnum) DataFrame#

Calculate a Series with a number of rows with datetime and their relative count (number of actions finished ONLY).

The counter only refers to the action specified in the “action” parameter.

Return type:

DataFrame

Parameters:
Returns:

a table of the requested action finished each “time” given as a parameter. The DataFrame contains three columns: Type of Action, Finish, and Count.

action_started_every(action: ActionEnum, time: TimeEnum) DataFrame#

Calculate a Series with a number of rows with datetime and their relative count (number of actions started ONLY).

The counter only refers to the action specified in the “action” parameter.

Return type:

DataFrame

Parameters:
Returns:

a table of the requested action started each “time” given as a parameter. The DataFrame contains three columns: Type of Action, Start, and Count.

actions_completed_every(time: TimeEnum) DataFrame#

Calculate a Series with Start datetime, Finish datetime and their relative count.

If an action is started at (e.g.) 10:58 and finished at 11:05, it will not be counted in the 10-hour counter. So it’s possible to find some lines with a Start time different from the Finish time.

Return type:

DataFrame

Parameters:

time (TimeEnum) – Time requested.

Returns:

A table of actions completed each “time” given as a parameter. The DataFrame contains three columns: Start, Finish, and Count.

actions_finished_every(time: TimeEnum) DataFrame#

Calculate a Series with a number of rows with datetime and their relative count (number of actions finished ONLY).

The counter refers to all actions in the simulation.

Return type:

DataFrame

Parameters:

time (TimeEnum) – Time requested.

Returns:

A table of actions finished each “time” given as a parameter. The DataFrame contains two columns: Finish and Count.

actions_started_every(time: TimeEnum) DataFrame#

Calculate a Series with a number of rows with datetime and their relative count (number of actions started ONLY).

The counter refers to all actions in the simulation.

Return type:

DataFrame

Parameters:

time (TimeEnum) – Time requested.

Returns:

A table of actions started each “time” given as a parameter. The DataFrame contains two columns: Start and Count.

count_action_completed(action: ActionEnum) int64#

Calculate how many actions are completed for a given action.

Return type:

numpy.int64

Parameters:

action (ActionEnum) – count calculation actions

Returns:

how many actions are completed in the whole simulation.

finish_time_simulation() Timestamp#

Get the finish of the simulation.

Return type:

Timestamp

Returns:

the finish of the simulation as pandas Timestamp.

start_time_simulation() Timestamp#

Get the start of the simulation.

Return type:

Timestamp

Returns:

the start of the simulation as pandas Timestamp.

total_simulation_time() Timedelta#

Get the total time of the simulation.

Return type:

Timestamp

Returns:

the total time of the simulation as pandas Timedelta.

class automatic_warehouse.utils.statistics.warehouse_statistics.TimeEnum(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)#

Enum of supported time units.

BUSINESS_DAY = 'B'#

Business day.

DAY = 'D'#

Day.

HOUR = 'h'#

Hour.

MICROSECOND = 'us'#

Microsecond.

MILLISECOND = 'ms'#

Millisecond.

MINUTE = 'min'#

Minute.

MONTH = 'M'#

Month.

NANOSECOND = 'ns'#

Nanosecond.

SECOND = 's'#

Second.

YEAR = 'Y'#

Year.