Cyclopts Results Investigation
This notebook provides a series of tools to confirm expected behavior of solutions and investigate possible errors thereof.
The autoreload extension is already loaded. To reload it, use:
%reload_ext autoreload
Group quantity constraint equals the number of requested assemblies as expected.
617 runs had more mass flow than total group qty.
Of flows with expected total mass behavior, 79.65% meet total request demand.
#
# this cell is raw text and intended to be a place from which common operations can be copy/pasted
#
http://imgur.com/Q3ai1U7
iids = set(iid for _, iid, _ in bad)
sids = set(sid for sid, _, _ in bad)
pids = set(inst_to_param[x] for x in iids)
print("n in list not in set:", len(bad) - len(iids), '\n')
x = set(x['solver'] for x in results.iterrows() if x['solnid'] in sids)
print('solvers with incorrect answers:', ' '.join(x), '\n')
x = set(x['req_qty_avg'] for x in samplers.iterrows() \
if x['paramid'] in pids)
print('Request quantities with incorrect answers:', x, '\n')
min_iid = '86f45b85b8c04d028308cdc3cd17795c'
print('testing ', min_iid, '\n')
min_iid = uuid.UUID(min_iid).bytes
x = [x['n_commods_avg'] for x in samplers.iterrows() \
if x['paramid'] == inst_to_param[min_iid]]
print('N commods in this inst:', x[0], '\n')
caps = [x['caps'][0] for x in grps.iterrows() \
if x['instid'] == min_iid and x['kind']]
print('That instid has a total request quantity of', sum(caps), '\n')
caps = [x['caps'][0] for x in grps.iterrows() \
if x['instid'] == min_iid and x['kind']]
print('req group caps', caps, '\n')
caps = [x['caps'][0] for x in grps.iterrows() \
if x['instid'] == min_iid and not x['kind']]
print('sup group caps', caps, '\n')
caps = [x['ucaps'][0] for x in arcs.iterrows() \
if x['instid'] == min_iid]
print('node caps', caps, '\n')
qtys = [x['qty'] for x in nodes.iterrows() \
if x['instid'] == min_iid and x['kind']]
print('node request qtys', qtys, '\n')
excls = [x['excl'] for x in nodes.iterrows() \
if x['instid'] == min_iid and x['kind']]
print('node request excl', excls, '\n')
efracs = [x['excl_frac'] for x in props.iterrows() \
if x['instid'] == min_iid]
print('excl_fraction', efracs, '\n')
nper = [x['n_u_nodes']/float(x['n_u_grps']) for x in props.iterrows() \
if x['instid'] == min_iid]
print('req nodes per req', nper, '\n')
nper = [x['n_v_nodes']/float(x['n_v_grps']) for x in props.iterrows() \
if x['instid'] == min_iid]
print('sup nodes per sup', nper, '\n')