Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
        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)
Exemplo n.º 3
0
print fields
for row in reader:

        heuristic=[]
        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


start_time_algorithm = time.clock()
print "start apply labeling algorithm"
alg=Algorithm(S,T,M,Parents,startActivity,GivenConfidenceLevel)       
alg.apply_algorithm()
end_time_algorithm=time.clock()
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
#print other traces that have produces but not completely fit
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)
Exemplo n.º 4
0
 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)