LarrySnyder/stockpyl

Unnecessary external demand sources on non-retailer nodes in non-serial networks

rusk-ey opened this issue · 2 comments

In the multiproduct branch, when using the "network_from_edges" function to build a network, all nodes have an external demand source (not just the leaf nodes, which should have an external demand source.

network = network_from_edges(
edges=[(2, 1), (3, 1), (4, 2)],
node_order_in_lists=[1, 2, 3, 4],
local_holding_cost=[2,4,2,2],
stockout_cost=[50, 25, 25, 0],
demand_type='UD', # discrete uniform distribution, for easier debugging
lo=1,
hi=5,
shipment_lead_time=[1, 1, 1, 0]
)

Output has columns, for i=2: IO:EXT|20 IO:1|20 ....

@bruskey47 This is fixed now. Now network_from_edges() only creates a (non-None) demand source if the node is a sink node, or if the demand source attributes are specified explicitly for that node (i.e., they're not just given as a singleton). Can you check that it works as you expect? If it does, you can close this issue.

Issue fixed.