node_state_vars Module

Overview

This module contains the NodeStateVars class, which keeps track of the state variables for a node during a simulation.

Note

The terms “node” and “stage” are used interchangeably in the documentation.

Note

The notation and references (equations, sections, examples, etc.) used below refer to Snyder and Shen, Fundamentals of Supply Chain Theory (FoSCT), 2nd edition (2019).

API Reference

class NodeStateVars(node=None, period=None)[source]

The NodeStateVars class contains values of the state variables for a supply chain node during a simulation. All state variables refer to their values at the end of a period (except during the period itself, in which case the values might be intermediate until the period is complete).

node

The node the state variables refer to.

Type

SupplyChainNode

period

The period of the simulation that the state variables refer to.

Type

int

inbound_shipment_pipeline

inbound_shipment_pipeline[p][rm][r] = shipment quantity of raw material rm arriving from predecessor node p in r periods from the current period. If p is None, refers to external supplier.

Type

dict

inbound_shipment

inbound_shipment[p][rm] = shipment quantity of raw material rm arriving at node from predecessor node p in the current period. If p is None, refers to external supplier.

Type

dict

inbound_order_pipeline

inbound_order_pipeline[s][prod][r] = order quantity for product prod arriving from successor node s in r periods from the current period. If s is None, refers to external demand. If s is single-product or external demand, prod=None.

Type

dict

inbound_order

inbound_order[s][prod] = order quantity for product prod arriving at node from successor node s in the current period. If s is None, refers to external demand. If s is single-product or external demand, prod=None.

Type

dict

demand_cumul

demand_cumul[prod] = cumulative demand (from all sources, internal and external) for product prod from period 0 through the current period. If node is single-product, prod=None. (Used for fill_rate calculation.)

Type

float

outbound_shipment

outbound_shipment[s][prod] = outbound shipment of product prod to successor node s. If s is None, refers to external demand. If node is single-product, prod=None.

Type

dict

on_order_by_predecessor

on_order_by_predecessor[p][rm] = on-order quantity (items that have been ordered from predecessor node p but not yet received) for raw material rm at node. If p is None, refers to external supply.

Type

dict

inventory_level

inventory_level[prod] = inventory level (positive, negative, or zero) of product prod at node.

Type

float

backorders_by_successor

backorders_by_successor[s][prod] = number of backorders of product prod for successor s. If s is None, refers to external demand.

Type

dict

outbound_disrupted_items

outbound_disrupted_items[s][prod] = number of items of product prod held for successor s due to a type-SP disruption at s. (Since external demand cannot be disrupted, outbound_disrupted_items[None][prod] always = 0.) Items held for successor are not included in backorders_by_successor. Sum over all successors of backorders_by_successor + outbound_disrupted_items should always equal max{0, -inventory_level}.

Type

dict

inbound_disrupted_items

inbound_disrupted_items[p][rm] = number of items of raw material rm from predecessor p that are being held before receipt due to a type-RP disruption at the node.

Type

dict

raw_material_inventory

raw_material_inventory[rm] = number of units of raw material rm from _all_ predecessors in raw-material inventory at node.

Type

dict

pending_finished_goods

pending_finished_goods[prod] = number of units of product prod that are waiting to be produced from raw materials. (This is used internally to ensure that raw materials are used to produce the finished goods that they were originally ordered for.)

Type

dict

disrupted

True if the node was disrupted in the period, False otherwise.

Type

bool

holding_cost_incurred

Holding cost incurred at the node in the period.

Type

float

stockout_cost_incurred

Stockout cost incurred at the node in the period.

Type

float

in_transit_holding_cost_incurred

In-transit holding cost incurred at the node in the period.

Type

float

fixed_cost_incurred

fixed cost incurred at the node in the period.

Type

float

revenue_earned

Revenue earned at the node in the period.

Type

float

total_cost_incurred

Total cost (less revenue) incurred at the node in the period.

Type

float

demand_met_from_stock

demand_met_from_stock[prod] = demand for product prod met from stock at the node in the period. If node is single-product, prod=None.

Type

float

demand_met_from_stock_cumul

demand_met_from_stock_cumul[prod] = cumulative demand for product prod met from stock from period 0 through the current period. If node is single-product, prod=None. (Used for fill_rate calculation.)

Type

float

fill_rate

fill_rate[prod] = cumulative fill rate for product prod in periods 0, …, period. If node is single product, prod=None.

Type

float

order_quantity

order_quantity[p][rm] = order quantity for raw material rm placed by the node to predecessor p in period. If p is None, refers to external supplier.

Type

dict

order_quantity_fg

order_quantity_fg[prod] = finished-goods order quantity for product prod at the node in period.

Type

dict

get_inbound_shipment_pipeline(periods_from_now, predecessor=None, raw_material=None)[source]

Shortcut to self.inbound_shipment_pipeline[predecessor][raw_material][periods_from_now] that does not require predecessor or raw_material to be specified if they are inferrable.

Parameters
  • periods_from_now (int) – Get pipeline inventory arriving this many periods into the future.

  • predecessor (SupplyChainNode or int, optional) – Predecessor node (as a SupplyChainNode) or its index, or None (the default) to detect predecessor automatically for a single-predecessor node. If node has both an external supplier and a predecessor node and predecessor is None, returns the external supplier.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

Inbound shipment pipeline.

Return type

float

get_inbound_shipment(predecessor=None, raw_material=None)[source]

Shortcut to self.inbound_shipment[predecessor][raw_material] that does not require predecessor or raw_material to be specified if they are inferrable.

Parameters
  • predecessor (SupplyChainNode or int, optional) – Predecessor node (as a SupplyChainNode) or its index, or None (the default) to detect predecessor automatically for a single-predecessor node. If node has both an external supplier and a predecessor node and predecessor is None, returns the external supplier.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

Inbound shipment.

Return type

float

get_inbound_order_pipeline(periods_from_now, successor=None, product=None)[source]

Shortcut to self.inbound_order_pipeline[successor][product][periods_from_now] that does not require successor or product to be specified if they are inferrable.

Parameters
  • periods_from_now (int) – Get pipeline order arriving this many periods into the future.

  • successor (SupplyChainNode or int, optional) – Successor node (as a SupplyChainNode) or its index, or None (the default) to detect successor automatically for a single-successor node. If node has both an external customer and a successor node and successor is None, returns the external customer.

  • product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Inbound order pipeline.

Return type

float

get_inbound_order(successor=None, product=None)[source]

Shortcut to self.inbound_order[successor][product] that does not require successor or product to be specified if they are inferrable.

Parameters
  • successor (SupplyChainNode or int, optional) – Successor node (as a SupplyChainNode) or its index, or None (the default) to detect successor automatically for a single-successor node. If node has both an external customer and a successor node and successor is None, returns the external customer.

  • product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Inbound order.

Return type

float

get_demand_cumul(product=None)[source]

Shortcut to self.demand_cumul[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Cumulative demand.

Return type

float

get_outbound_shipment(successor=None, product=None)[source]

Shortcut to self.outbound_shipment[successor][product] that does not require successor or product to be specified if they are inferrable.

Parameters
  • successor (SupplyChainNode or int, optional) – Successor node (as a SupplyChainNode) or its index, or None (the default) to detect successor automatically for a single-successor node. If node has both an external customer and a successor node and successor is None, returns the external customer.

  • product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Outbound shipment.

Return type

float

get_on_order_by_predecessor(predecessor=None, raw_material=None)[source]

Shortcut to self.on_order_by_predecessor[predecessor][raw_material] that does not require predecessor or raw_material to be specified if they are inferrable.

Parameters
  • predecessor (SupplyChainNode or int, optional) – Predecessor node (as a SupplyChainNode) or its index, or None (the default) to detect predecessor automatically for a single-predecessor node. If node has both an external supplier and a predecessor node and predecessor is None, returns the external supplier.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

On order by predecessor.

Return type

float

get_inventory_level(product=None)[source]

Shortcut to self.inventory_level[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Inventory level.

Return type

float

get_backorders_by_successor(successor=None, product=None)[source]

Shortcut to self.backorders_by_successor[successor][product] that does not require successor or product to be specified if they are inferrable.

Parameters
  • successor (SupplyChainNode or int, optional) – Successor node (as a SupplyChainNode) or its index, or None (the default) to detect successor automatically for a single-successor node. If node has both an external customer and a successor node and successor is None, returns the external customer.

  • product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Backorders by successor.

Return type

float

get_outbound_disrupted_items(successor=None, product=None)[source]

Shortcut to self.outbound_disrupted_items[successor][product] that does not require successor or product to be specified if they are inferrable.

Parameters
  • successor (SupplyChainNode or int, optional) – Successor node (as a SupplyChainNode) or its index, or None (the default) to detect successor automatically for a single-successor node. If node has both an external customer and a successor node and successor is None, returns the external customer.

  • product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Outbound disrupted items.

Return type

float

get_inbound_disrupted_items(predecessor=None, raw_material=None)[source]

Shortcut to self.inbound_disrupted_items[predecessor][raw_material] that does not require predecessor or raw_material to be specified if they are inferrable.

Parameters
  • predecessor (SupplyChainNode or int, optional) – Predecessor node (as a SupplyChainNode) or its index, or None (the default) to detect predecessor automatically for a single-predecessor node. If node has both an external supplier and a predecessor node and predecessor is None, returns the external supplier.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

Inbound disrupted items.

Return type

float

get_raw_material_inventory(raw_material=None)[source]

Shortcut to self.raw_material_inventory[raw_material] that does not require raw_material to be specified if it is inferrable.

Parameters

raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

Raw material inventory.

Return type

float

get_pending_finished_goods(product=None)[source]

Shortcut to self.pending_finished_goods[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Pending finished goods.

Return type

float

get_demand_met_from_stock(product=None)[source]

Shortcut to self.demand_met_from_stock[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Demand met from stock.

Return type

float

get_demand_met_from_stock_cumul(product=None)[source]

Shortcut to self.demand_met_from_stock_cumul[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Cumulative demand met from stock.

Return type

float

get_fill_rate(product=None)[source]

Shortcut to self.fill_rate[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Fill rate.

Return type

float

get_order_quantity(predecessor=None, raw_material=None)[source]

Shortcut to self.order_quantity[predecessor][raw_material] that does not require predecessor or raw_material to be specified if they are inferrable.

Parameters
  • predecessor (SupplyChainNode or int, optional) – Predecessor node (as a SupplyChainNode) or its index, or None (the default) to detect predecessor automatically for a single-predecessor node. If node has both an external supplier and a predecessor node and predecessor is None, returns the external supplier.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as a SupplyChainProduct) or its index, or None (the default) to detect raw material automatically for a single-raw material node (including a dummy product).

Returns

Order quantity.

Return type

float

get_order_quantity_fg(product=None)[source]

Shortcut to self.order_quantity_fg[product] that does not require product to be specified if it is inferrable.

Parameters

product (SupplyChainProduct or int, optional) – Product (as a SupplyChainProduct) or its index, or None (the default) to detect product automatically for a single-product node (including a dummy product).

Returns

Finished-goods order quantity.

Return type

float

property on_hand

Current on-hand inventory at node. If node is single-product, returns the on-hand inventory as a singleton. If node is multi-product, returns dict whose keys are product indices and whose values are the corresponding on-hand inventory levels. Read only.

property backorders

Current number of backorders. Should always equal sum over all successors s of backorders_by_successor[s] + outbound_disrupted_items[s]. If node is single-product, returns the backorders as a singleton. If node is multi-product, returns dict whose keys are product indices and whose values are the corresponding numbers of backorders. Read only.

in_transit_to(successor, product=None)[source]

Return current total inventory of product in transit to successor. Includes items that will be/have been delivered during the current period.

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically.

Parameters
  • successor (SupplyChainNode) – The successor node.

  • product (SupplyChainProduct or int, optional) – The outbound product (as a SupplyChainProduct object or index), or None if successor is single-product.

Returns

The current inventory in transit to the successor.

Return type

float

in_transit_from(predecessor=None, raw_material=None)[source]

Return current total inventory of raw_material in transit from a given predecessor. Includes items that will be/have been delivered during the current period.

Set predecessor to None if the predecessor is the external supplier. If the node has a single raw material, either set raw_material to the single raw material, or to None and the function will determine the raw material automatically.

Parameters
  • predecessor (SupplyChainNode) – The predecessor node.

  • raw_material (SupplyChainProduct or int, optional) – The inbound raw_material (as a SupplyChainProduct object or index), or None if predecessor has a single product or external supplier.

Returns

The current inventory in transit from the predecessor.

Return type

float

in_transit(product=None)[source]

Current inventory of raw materials for product that is in transit to the node. Read only.

In-transit items are counted using the “units” of the node (or node-product pair) itself. That is, each in-transit quantity is divided by the number of units of the inbound item required to make one unit of product at this node, according to the bill of materials; and then the sum of those quantities is divided by the total number of raw materials required for this node (or node-product pair).

For example, if the bill of materials specifies that to make one unit at the node requires 2 units from predecessor node A and 6 units from predecessor node B, and if there are 10 in-transit units from A and 18 from B, then in_transit equals

\[\frac{\frac{10}{2} + \frac{18}{6}}{2} = 4\]

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically.

If the node has multiple products that use the same raw material, this function includes all units of that raw material, even though some of them may wind up being used to make products other than product.

To get the number of units in transit by predecessor and/or product, use in_transit_from().

Changed in version 1.0: This was previously a property and is now a function.

Parameters

product (SupplyChainProduct or int, optional) – The product (as a SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

Returns

The current inventory in transit from predecessors.

Return type

float

on_order(product=None)[source]

Current inventory of raw materials for product that is on order to the node. Read only.

On-order items are counted using the “units” of the node (or node-product pair) itself. That is, each on-order quantity is divided by the number of units of the inbound item required to make one unit of product product at this node, according to the bill of materials; and then the sum of those quantities is divided by the total number of raw materials required for this node (or node-product pair).

For example, if the bill of materials specifies that to make one unit at the node requires 2 units from predecessor node A and 6 units from predecessor node B, and if there are 10 on-order units from A and 18 from B, then on_order equals

\[\]

frac{frac{10}{2} + frac{18}{6}}{2} = 4

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically.

If the node has multiple products that use the same raw material, this function includes all units of that raw material, even though some of them may wind up being used to make products other than product.

Changed in version 1.0: This was previously a property and is now a function.

Parameters

product (SupplyChainProduct or int, optional) – The product (as a SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

Returns

The current inventory on order from predecessors.

Return type

float

raw_material_aggregate(product=None)[source]

Current raw materials for product that are in raw-material inventory at the node. Read only.

Raw materials are counted using the “units” of the node (or node-product pair) itself. That is, each raw material quantity is divided by the number of units of the raw material required to make one unit of product product at this node, according to the bill of materials; and then the sum of those quantities is divided by the total number of raw materials required for this node (or node-product pair).

For example, if the bill of materials specifies that to make one unit at the node requires 2 units from predecessor node A and 6 units from predecessor node B, and if there are 10 node-A units and 18 node-B units in raw material inventory at the node, then raw_material_aggregate equals

\[\]

frac{frac{10}{2} + frac{18}{6}}{2} = 4

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically.

If the node has multiple products that use the same raw material, this function includes all units of that raw material, even though some of them may wind up being used to make products other than product.

Changed in version 1.0: This was previously a property and is now a function.

Parameters

product (SupplyChainProduct or int, optional) – The product (as a SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

Returns

The current raw material inventory.

Return type

float

inbound_disrupted_items_aggregate(product=None)[source]

Current total inbound disrupted inventory of raw materials for product. Read only.

Inbound items are counted using the “units” of the node (or node-product pair) itself. That is, each inbound quantity is divided by the number of units of the inbound item required to make one unit of product at this node, according to the bill of materials; and then the sum of those quantities is divided by the total number of raw materials required for this node (or node-product pair).

For example, if the bill of materials specifies that to make one unit at the node requires 2 units from predecessor node A and 6 units from predecessor node B, and if there are 10 inbound disrupted units from A and 18 from B, then inbound_disrupted_items_aggregate equals

\[\]

frac{frac{10}{2} + frac{18}{6}}{2} = 4

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically.

If the node has multiple products that use the same raw material, this function includes all disrupted units of that raw material, even though some of them may wind up being used to make products other than product.

Changed in version 1.0: This was previously a property and is now a function.

Parameters

product (SupplyChainProduct or int, optional) – The product (as a SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

Returns

The current disrupted inventory from predecessors.

Return type

float

inventory_position(product=None, exclude_earmarked_units=False)[source]

Current (local) inventory position at node for product. Equals inventory level plus pipeline inventory. (Pipeline inventory equals on-order inventory of the raw material, raw material inventory that has not yet been processed, and inbound disrupted items of the raw material due to type-RP disruptions). Inventory position is expressed in the units of the product (not the raw materials).

If the product uses multiple raw materials, the pipeline inventory is the maximum number of units of the product that can be produced, given the quantities of raw materials in the pipeline. For example, suppose product A requires 10 units of product B and 5 units of product C; there are 4 units of product A on hand; and there are 20 units of product B and 15 units of product C in the pipeline. The the inventory level is 4, and the pipeline inventory contains enough raw materials to make 2 units of product A. So, the inventory position is 6.

If exclude_earmarked_units is True, raw materials that are already “earmarked” for a different product at this node are excluded from the pipeline inventory. In particular, the pipeline of a given raw material is reduced by the sum, over all _other_ products at the node, of the number of units of that product that are pending times the NBOM for that product/raw material.

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically. If the node is multi-product, product must be set to a single product at the node.

If the node has multiple products that use the same raw material, the inventory position returned by this function includes all units of that raw material, even though some of them may wind up being used to make products other than product.

Parameters

product (SupplyChainProduct or int, optional) – The product (as a SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

Returns

The inventory position.

Return type

float

property echelon_on_hand_inventory

Current echelon on-hand inventory at node. Equals on-hand inventory at node and at or in transit to all of its downstream nodes. If node is single-product, returns the echelon on-hand inventory as a singleton. If node is multi-product, returns dict whose keys are product indices and whose values are the corresponding echelon on-hand inventory levels. Read only.

property echelon_inventory_level

Current echelon inventory level at node. Equals echelon on-hand inventory minus backorders at terminal node(s) downstream from node. If node is single-product, returns the echelon inventory level as a singleton. If node is multi-product, returns dict whose keys are product indices and whose values are the corresponding echelon inventory levels. Read only.

echelon_inventory_position(product=None, predecessor=None, raw_material=None)[source]

Current echelon inventory position at node for product with index product. Equals echelon inventory level plus on order items.

On-order includes raw material inventory that has not yet been processed, as well as inbound disrupted items due to type-RP disruptions.

If the node is single-product, either set product to the single product, or to None and the function will determine the product automatically. If the node is multi-product, product must be set to a single product at the node.

If the node has a single predecessor, which provides a single raw material, either set predecessor and raw_material to the appropriate indicies, or set them to None and the function will determine them automatically. If the node has multiple predecessors and/or raw materials, either set predecessor and raw_material to the indices of a single predecessor and raw material (to get the raw-material-specific inventory position) or set both to None to use the aggregate on-order and raw material inventory for all predecessors and raw materials (counting such items using the “units” of the node itself; see documentation for on_order() for more details). predecessor and raw_material must both either be None or not None.

If the node has multiple products that use the same raw material, this function includes all units of that raw material, even though some of them may wind up being used to make products other than product.

Parameters
  • product (SupplyChainProduct or int, optional) – The product (as SupplyChainProduct object or index), or None to set the product automatically if node is single-product.

  • predecessor (SupplyChainNode or int, optional) – Predecessor (as SupplyChainNode object or index) to consider in inventory position calculation (including all others), or None to include all predecessors.

  • raw_material (SupplyChainProduct or int, optional) – Raw material (as SupplyChainProduct or index) to consider in inventory position calculation (excluding all others), or None to include all raw materials.

Returns

The echelon inventory position.

Return type

float

Raises

ValueError – If predecessor is None and raw_material is not None, or vice-versa.

to_dict()[source]

Convert the NodeStateVars object to a dict. List and dict attributes are deep-copied so changes to the original object do not get propagated to the dict. The node attribute is set to the index of the node (if any), rather than to the object.

Returns

The dict representation of the object.

Return type

dict

classmethod from_dict(the_dict)[source]

Return a new NodeStateVars object with attributes copied from the values in the_dict. List and dict attributes are deep-copied so changes to the original dict do not get propagated to the object.

The node attribute is set to the index of the node, like it is in the dict, but should be converted to a node object if this function is called recursively from a SupplyChainNode’s from_dict() method.

Parameters

the_dict (dict) – Dict representation of a NodeStateVars, typically created using to_dict().

Returns

The object converted from the dict.

Return type

NodeStateVars

reindex_state_variables(old_to_new_dict, old_to_new_prod_dict)[source]

Change indices of node-based state variable dict keys using old_to_new_dict and indices of product-based state variable dict keys using old_to_new_prod_dict.

Parameters
  • old_to_new_dict (dict) – Dict in which keys are old node indices and values are new node indices.

  • old_to_new_prod_dict (dict) – Dict in which keys are old product indices and values are new product indices.

deep_equal_to(other, rel_tol=1e-08)[source]

Check whether object “deeply equals” other, i.e., if all attributes are equal, including attributes that are lists or dicts.

Note the following caveats:

  • Checks the equality of node.index but not the entire node object.

Parameters
  • other (NodeStateVars) – The state variables to compare this one to.

  • rel_tol (float, optional) – Relative tolerance to use when comparing equality of float attributes.

Returns

True if the two state variables objects are equal, False otherwise.

Return type

bool