Combiner
¶
Bases: Node
Combiner class representing a processing node in a factory simulation. Inherits from the Node class.The combiner can have multiple input edges and a multiple output edges. It gets items from the input edges and packs them into a pallet or box and pushes it to the output edge.
Parameters: |
|
---|
Behavior
The combiner node represents components that joints together or packs items from multiple in_edges. It can have multiple incoming edges
and multiple outgoing edge. User can specify a list in_edges and the number of quantity that has to be packed from each of the in_edges
as a list. The first item corresponds to the pallet used to put these packed items and the corresponding entry in the
target_quantity_of_each_item
list is 1. Edge to which packed item is pushed is decided using the method specified
in the parameter out_edge_selection
. Combiner will transition through the states- SETUP_STATE
, PROCESSING_STATE
, IDLE_STATE
and
BLOCKED_STATE
. The combiner has a blocking behavior if blocking
=True
and gets blocked when all its worker threads have processed items and the out edge is full and
cannot accept the item that is being pushed by the combiner. It waits until the out edge becomes available to push the item. If blocking
=False
,
it will discard the item if the out edge is full and cannot accept the item that is being pushed by the combiner.
Raises: |
|
---|
Output performance metrics
The key performance metrics of the combiner node is captured in stats
attribute (dict) during a simulation run.
last_state_change_time : Time when the state was last changed.
num_item_processed : Total number of items that is put into pallets.
num_pallet_processed : Total number of pallets packed.
num_pallet_discarded : Total number of packed pallets discarded.
total_time_spent_in_states: Dictionary with total time spent in each state.
update_state(i, new_state, current_time)
¶
Update node state and track the time spent in the previous state.
Parameters: |
|
---|
add_in_edges(edge)
¶
Adds an in_edge to the node. Raises an error if the edge already exists in the in_edges list.
Parameters: |
|
---|
add_out_edges(edge)
¶
Adds an out_edge to the node. Raises an error if the edge already exists in the out_edges list.
Parameters: |
|
---|