def all_prolif_qty(path, qty, eqn_type, file=None): file_list = make_list(path) qty_df = pd.DataFrame() agent_df = pd.DataFrame() for f in file_list: db = cym.dbopen(f) weapon_progress = cym.root_metric(name='WeaponProgress') evaluator = cym.Evaluator(db) frame = evaluator.eval('WeaponProgress', conds=[('Decision', '==', 1), ('EqnType', '==', eqn_type)]) qty_df = pd.concat([qty_df, frame[:][qty]], ignore_index=True) agent_entry = cym.root_metric(name='AgentEntry') evaluator2 = cym.Evaluator(db) agent_frame = evaluator2.eval('AgentEntry', conds=[('Kind', '==', 'Inst')]) agent_df = pd.concat( [agent_df, agent_frame[:][['AgentId', 'Prototype']]], ignore_index=True) if (file != None): qty_df.to_csv(path + file, sep='\t') agent_df.to_csv(path + 'agent_' + file, sep='\t') return else: return qty_df
def first_prolif_qty(path, qty, csv=None): file_list = make_list(path) qty_df = pd.DataFrame() for f in file_list: db = cym.dbopen(f) weapon_progress = cym.root_metric(name='WeaponProgress') evaluator = cym.Evaluator(db) frame = evaluator.eval('WeaponProgress', conds=[('Decision', '==', 1)]) qty_df = pd.concat([qty_df, frame[:1][qty]], ignore_index=True) if (csv != None): qty_df.to_csv(path + csv, sep='\t') return else: return qty_df
"""Root metrics for Cycamore""" from cymetric import root_metric # root metrics that come with the archetypes within the cycamore module agentstate_cycamore_enrichmentinfo = root_metric( name='AgentState_cycamore_EnrichmentInfo') agentstate_cycamore_fuelfabinfo = root_metric( name='AgentState_cycamore_FuelFabInfo') agentstate_cycamore_reactorinfo = root_metric( name='AgentState_cycamore_ReactorInfo') agentstate_cycamore_separationsinfo = root_metric( name='AgentState_cycamore_SeparationsInfo') agentstate_cycamore_sinkinfo = root_metric(name='AgentState_cycamore_SinkInfo') agentstate_cycamore_sourceinfo = root_metric( name='AgentState_cycamore_SourceInfo') enrichments = root_metric(name='Enrichments') reactor_events = root_metric(name='ReactorEvents')
"""Root metrics for Cycamore""" from cymetric import root_metric #root metrics that come with the archetypes within the cycamore module agentstate_cycamore_enrichmentinfo = root_metric( name='AgentState_cycamore_EnrichmentInfo') agentstate_cycamore_fuelfabinfo = root_metric( name='AgentState_cycamore_FuelFabInfo') agentstate_cycamore_reactorinfo = root_metric( name='AgentState_cycamore_ReactorInfo') agentstate_cycamore_separationsinfo = root_metric( name='AgentState_cycamore_SeparationsInfo') agentstate_cycamore_sinkinfo = root_metric( name='AgentState_cycamore_SinkInfo') agentstate_cycamore_sourceinfo = root_metric( name='AgentState_cycamore_SourceInfo') enrichments = root_metric(name='Enrichments') reactor_events = root_metric(name='ReactorEvents')