コード例 #1
0
def import_xes_data(filename):
    if not os.path.abspath(filename):
        # modify the path of file
        file_path = global_util.get_full_path_input_file(filename)
    else:
        file_path = filename
        filename = os.path.basename(filename)

    # import the name of log
    parameters = {"timestamp_sort": True}
    log = importer.apply(file_path,
                         variant="nonstandard",
                         parameters=parameters)

    # apply miner
    net, initial_marking, final_marking = alpha_miner.apply(log)

    # apply visualizer
    gviz = visualizer.apply(net, initial_marking, final_marking)

    # generate the name of the file
    file, _ = os.path.splitext(filename)
    output_full_name = "output_" + file + ".png"
    # generate the path of all generated files
    output_file = global_util.get_full_path_output_file(output_full_name)

    # save file
    visualizer.save(gviz, output_file)
    # return the name of the file
    return output_full_name
コード例 #2
0
def import_xes_data(filename):
    if not os.path.abspath(filename):

        file_path = global_util.get_full_path_input_file(filename)
    else:
        file_path = filename
        filename = os.path.basename(filename)

    parameters = {"timestamp_sort": True}
    log = importer.apply(file_path,
                         variant="nonstandard",
                         parameters=parameters)
    print(log)

    net, initial_marking, final_marking = alpha_miner.apply(log)

    gviz = visualizer.apply(net, initial_marking, final_marking)

    file, _ = os.path.splitext(filename)
    output_full_name = "output_" + file + ".png"

    output_file = global_util.get_full_path_output_file(output_full_name)

    visualizer.save(gviz, output_file)

    return output_full_name
コード例 #3
0
def import_xes_data(filename):
    if not os.path.abspath(filename):

        file_path = global_util.get_full_path_input_file(filename)
    else:
        file_path = filename
        filename = os.path.basename(filename)

    # import the name of log
    parameters = {"timestamp_sort": True}
    log = importer.apply(file_path,
                         variant="nonstandard",
                         parameters=parameters)
    print(log)

    # file of miner application log
    net, initial_marking, final_marking = alpha_miner.apply(log)

    # Visual interface application analysis results
    gviz = visualizer.apply(net, initial_marking, final_marking)

    # Generate output file name
    file, _ = os.path.splitext(filename)
    output_full_name = "output_" + file + ".png"
    # Generate the full path of the output file
    output_file = global_util.get_full_path_output_file(output_full_name)

    # save document
    visualizer.save(gviz, output_file)
    # Returns the output file name
    return output_full_name
コード例 #4
0
def import_xes_data(filename):
    if not os.path.abspath(filename):
        # 修改日志文件路径
        file_path = global_util.get_full_path_input_file(filename)
    else:
        file_path = filename
        filename = os.path.basename(filename)

    # 导入日志文件名
    parameters = {"timestamp_sort": True}
    log = importer.apply(file_path, variant="nonstandard", parameters=parameters)

    # 矿工应用日志文件
    net, initial_marking, final_marking = alpha_miner.apply(log)

    # 可视化界面应用分析结果
    gviz = visualizer.apply(net, initial_marking, final_marking)

    # 生成输出文件名
    file, _ = os.path.splitext(filename)
    output_full_name = "output_" + file + ".png"
    # 生成输出文件全路径
    output_file = global_util.get_full_path_output_file(output_full_name)

    # 保存文件
    visualizer.save(gviz, output_file)
    # 返回输出文件名
    return output_full_name
コード例 #5
0
    def __init__(self, file):
        file_path = None
        if not os.path.abspath(file):

            file_path = global_util.get_full_path_input_file(file)
        else:
            file_path = file
        self.fileName = os.path.basename(file_path)
コード例 #6
0
 def __init__(self, file):
     file_path = None
     if not os.path.abspath(file):
         # If it's not absolute path, get path
         self.fileName = global_util.get_full_path_input_file(file)
     else:
         # otherwise set file_path as file
         self.fileName = file
     self.log = None
コード例 #7
0
def import_csv_file(filename):
    filename = os.path.basename(filename)

    file_path = global_util.get_full_path_input_file(filename)

    event_stream = csv_importer.import_event_stream(file_path)
    # dataframe = csv_import_adapter.import_dataframe_from_path(file_path, sep=",")

    log = conversion_factory.apply(
        event_stream,
        parameters={constants.PARAMETER_CONSTANT_TIMESTAMP_KEY: "日期和时间"})

    net, initial_marking, final_marking = alpha_miner.apply(log)

    gviz = visualizer.apply(net, initial_marking, final_marking)

    visualizer.view(gviz)
コード例 #8
0
def import_csv_file(filename):
    filename = os.path.basename(filename)
    # 修改日志文件路径
    file_path = global_util.get_full_path_input_file(filename)

    # 将文件按 csv 文件格式导入,得到事件流结构
    event_stream = csv_importer.import_event_stream(file_path)
    # dataframe = csv_import_adapter.import_dataframe_from_path(file_path, sep=",")

    # 将事件流转换成 xes 结构
    log = conversion_factory.apply(event_stream, parameters={constants.PARAMETER_CONSTANT_TIMESTAMP_KEY: "日期和时间"})

    # 矿工应用日志文件,这里简单的应用阿尔法矿工
    net, initial_marking, final_marking = alpha_miner.apply(log)

    # 可视化界面应用分析结果
    gviz = visualizer.apply(net, initial_marking, final_marking)

    # 显示结果
    visualizer.view(gviz)