当前位置: 首页>>代码示例>>Python>>正文


Python Algorithm.apply_algorithm方法代码示例

本文整理汇总了Python中algorithm.Algorithm.apply_algorithm方法的典型用法代码示例。如果您正苦于以下问题:Python Algorithm.apply_algorithm方法的具体用法?Python Algorithm.apply_algorithm怎么用?Python Algorithm.apply_algorithm使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在algorithm.Algorithm的用法示例。


在下文中一共展示了Algorithm.apply_algorithm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: range

# 需要导入模块: from algorithm import Algorithm [as 别名]
# 或者: from algorithm.Algorithm import apply_algorithm [as 别名]
        for i in range(1, len(reader.fieldnames)):
            heuristic.append(float(row[reader.fieldnames[i]]))
        T[row[reader.fieldnames[0]]]=heuristic   

fin.close()
print 'T' ,T


rs=int(sys.argv[3])
if (rs >0):
    GivenRankingScore=rs


#applying DCI approach
alg=Algorithm(S,T,M,Parents,startActivity,GivenRankingScore)       
alg.apply_algorithm()

print "event logs"
i=1
for eLog in alg.constructedTraces:
    eLog.write_traceLog_into_file_csv(i)
    eLog.write_traceLog_into_file_txt(i)
    eLog.write_traceLog_into_XML(i)
    eLog.prepare_traceLog(i)
    i+=1

if (len(alg.otherConstructedTraces)>0):
    print "other event logs "
    for oeLog in alg.otherConstructedTraces:
        oeLog.write_traceLog_into_file_csv(i,otherDirectory)
        oeLog.write_traceLog_into_file_txt(i,otherDirectory)
开发者ID:ahtealeb,项目名称:DeducingCaseId,代码行数:33,代码来源:__init__.py

示例2: open

# 需要导入模块: from algorithm import Algorithm [as 别名]
# 或者: from algorithm.Algorithm import apply_algorithm [as 别名]
 alg=Algorithm(S,T,M,Parents,startActivity,GivenConfidenceLevel)  
 #alg.apply_algorithm() # old: running batch of S all at once 
 
 dashboard_filename = "dashboard.csv"
 header = ['Current timestamp;Case id;Actual timestamp;Activity;Ranking score']
 f = open(dashboard_filename,'wb')
 w = csv.writer(f, delimiter = ',')
 w.writerows([x.split(';') for x in header])
 f.close()
 
 # reading and preparing S, input 4 (offline/online)
 #new part code, changing call of apply_algorithm
 start_time_build_tree = time.clock()
 if (sys.argv[4].lower()=="offline"):
     for symbol in S:
         alg.apply_algorithm(symbol,dashboard_filename) # new: read symbol by symbol from S either online or offline
 
     # reach this code when offline
     end_time_build_tree = time.clock()
     print"Algorithm execution time time_build_tree :  %s seconds " % (end_time_build_tree - start_time_build_tree)
     
     alg.finish_algorithm(start_time_build_tree)
     end_time_algorithm=time.clock()
     
     print "event logs"
     i =1
     for eLog in alg.constructedTraces:
         if(i==1):
             #eLog.write_traceLog_into_file_csv(i)
             #eLog.write_traceLog_into_file_txt(i)
             eLog.write_traceLog_into_XML(i)
开发者ID:ahtealeb,项目名称:RuntimeDeductionCaseID,代码行数:33,代码来源:__init__.py


注:本文中的algorithm.Algorithm.apply_algorithm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。