Splitter
¶
Bases: Node
Splitter class representing a processing node that can unpack an incoming item and send it to multiple outgoing edges in a factory simulation.
Parameters: |
|
---|
Behavior
The Splitter node represents components that unpakcs an item (pallet) from an incoming edge. It can have multiple incoming edges
and multiple outgoing edge. Edge from which the item comes in and the edge to which processed item is pushed is decided using the method specified
in the parameter in_edge_selection
and out_edge_selection
. Splitter will transition through the states- SETUP_STATE
, PROCESSING_STATE
, IDLE_STATE
and
BLOCKED_STATE
. It unpacks the items and pushes it to one of the outgoing edges one by one. The Splitter 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 Splitter and waits until the out edge can accept the item. If blocking
=False
, the Splitter will
discard the item if the out edge is full and cannot accept the item that is being pushed by the machine.
Raises: |
|
---|
Output performance metrics
The key performance metrics of the 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 it has unpacked from a pallet.
num_item_discarded : Total number of items Splitter has discarded.
num_pallet_processed : Total number of pallets it has unpacked.
num_pallet_discarded : Total number of unpacked pallets Splitter has 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: |
|
---|