import inspect
import os
import sys
import traceback


def feature_extraction_ocel():
    from examples import feature_extraction_ocel
    print("\n\nfeature_extraction_ocel")
    feature_extraction_ocel.execute_script()


def ocel_validation():
    from examples import ocel_validation
    print("\n\nocel_validation")
    ocel_validation.execute_script()


def process_tree_frequency_annotation():
    from examples import process_tree_frequency_annotation
    print("\n\nprocess_tree_frequency_annotation")
    process_tree_frequency_annotation.execute_script()


def tree_manual_generation():
    from examples import tree_manual_generation
    print("\n\ntree_manual_generation")
    tree_manual_generation.execute_script()


def workalendar_example():
    from examples import workalendar_example
    print("\n\nworkalendar_example")
    workalendar_example.execute_script()


def merging_case_relations():
    from examples import merging_case_relations
    print("\n\nmerging_case_relations")
    merging_case_relations.execute_script()


def activity_position():
    from examples import activity_position
    print("\n\nactivity_position")
    activity_position.execute_script()


def link_analysis_vbfa():
    from examples import link_analysis_vbfa
    print("\n\nlink_analysis_vbfa")
    link_analysis_vbfa.execute_script()


def ocel_streaming():
    from examples import ocel_streaming
    print("\n\nocel_streaming")
    ocel_streaming.execute_script()


def petri_manual_generation():
    from examples import petri_manual_generation
    print("\n\npetri_manual_generation")
    petri_manual_generation.execute_script()


def timestamp_interleavings():
    from examples import timestamp_interleavings
    print("\n\ntimestamp_interleavings")
    timestamp_interleavings.execute_script()


def object_centric_petri_net_discovery():
    from examples import object_centric_petri_net_discovery
    print("\n\nobject_centric_petri_net_discovery")
    object_centric_petri_net_discovery.execute_script()


def trans_system_stochastic_view():
    from examples import trans_system_stochastic_vis
    print("\n\ntrans_system_stochastic_view")
    trans_system_stochastic_vis.execute_script()


def network_analysis():
    from examples import network_analysis
    print("\n\nnetwork_analysis")
    network_analysis.execute_script()


def read_write_ocel():
    from examples import read_write_ocel
    print("\n\nread_write_ocel")
    read_write_ocel.execute_script()


def ocdfg_discovery():
    from examples import ocdfg_discovery
    print("\n\nocdfg_discovery")
    ocdfg_discovery.execute_script()


def enrich_log_with_align():
    from examples import enrich_log_with_align
    print("\n\nenrich_log_with_align")
    enrich_log_with_align.execute_script()


def extended_marking_equation():
    from examples import extended_marking_equation
    print("\n\nextended_marking_equation")
    extended_marking_equation.execute_script()


def features_locally_linear_embedding():
    from examples import features_locally_linear_embedding
    print("\n\nfeatures_locally_linear_embedding")
    features_locally_linear_embedding.execute_script()


def discovery_data_petri_net():
    from examples import discovery_data_petri_net
    print("\n\ndiscovery_data_petri_net")
    discovery_data_petri_net.execute_script()


def pandas_iterable():
    from examples import pandas_iterable
    print("\n\npandas_iterable")
    pandas_iterable.execute_script()


def pandas_iterable_to_trace_stream():
    from examples import pandas_iterable_to_trace_stream
    print("\n\npandas_iterable_to_trace_stream")
    pandas_iterable_to_trace_stream.execute_script()


def performance_dfg_simulation():
    from examples import performance_dfg_simulation
    print("\n\nperformance_dfg_simulation")
    performance_dfg_simulation.execute_script()


def data_petri_nets():
    from examples import data_petri_nets
    print("\n\ndata_petri_nets")
    data_petri_nets.execute_script()


def inhibitor_reset_arcs():
    from examples import inhibitor_reset_arcs
    print("\n\ninhibitor_reset_arcs")
    inhibitor_reset_arcs.execute_script()


def batch_detection():
    from examples import batch_detection
    print("\n\nbatch_detection")
    batch_detection.execute_script()


def case_overlap_stat():
    from examples import case_overlap_stat
    print("\n\ncase_overlap_stat")
    case_overlap_stat.execute_script()


def cycle_time():
    from examples import cycle_time
    print("\n\ncycle_time")
    cycle_time.execute_script()


def rework():
    from examples import rework
    print("\n\nrework")
    rework.execute_script()


def events_distribution():
    from examples import events_distribution
    print("\n\nevents_distribution")
    events_distribution.execute_script()


def dotted_chart():
    from examples import dotted_chart
    print("\n\ndotted_chart")
    dotted_chart.execute_script()


def performance_spectrum():
    from examples import perf_spectrum_visualization
    print("\n\nperformance_spectrum")
    perf_spectrum_visualization.execute_script()


def woflan():
    from examples import woflan
    print("\n\nwoflan")
    woflan.execute_script()


def bpmn_from_pt():
    from examples import bpmn_from_pt_conversion
    print("\n\nbpmn_from_pt_conversion")
    bpmn_from_pt_conversion.execute_script()


def bpmn_import_and_to_petri_net():
    from examples import bpmn_import_and_to_petri_net
    print("\n\nbpmn_import_and_to_petri_net")
    bpmn_import_and_to_petri_net.execute_script()


def tree_playout():
    from examples import tree_playout
    print("\n\ntree_playout")
    tree_playout.execute_script()


def emd_evaluation():
    from examples import emd_evaluation
    print("\n\nemd_evaluation")
    emd_evaluation.execute_script()


def footprints_tree_conf():
    from examples import footprints_tree_conf
    print("\n\nfootprints_tree_conf")
    footprints_tree_conf.execute_script()


def simplified_interface():
    from examples import simplified_interface
    print("\n\nsimplified_interface")
    simplified_interface.execute_script()


def footprints_petri_net():
    from examples import footprints_petri_net
    print("\n\nfootprints_petri_net")
    footprints_petri_net.execute_script()


def corr_mining():
    from examples import corr_mining
    print("\n\ncorr_mining")
    corr_mining.execute_script()


def log_skeleton():
    from examples import log_skeleton
    print("\n\nlog_skeleton")
    log_skeleton.execute_script()


def roles_detection():
    from examples import roles_detection
    print("\n\nroles_detection")
    roles_detection.execute_script()


def alignment_test():
    from examples import alignment_test
    print("\n\nalignment_test")
    alignment_test.execute_script()


def dec_treplay_imdf():
    from examples import dec_treplay_imdf
    print("\n\ndec_treplay_imdf")
    dec_treplay_imdf.execute_script()


def logs_petri_visual_comparison():
    from examples import logs_petri_visual_comparison
    print("\n\nlogs_petri_visual_comparison")
    logs_petri_visual_comparison.execute_script()


def imdf_example():
    from examples import im_example
    print("\n\nimdf_example")
    im_example.execute_script()


def test_evaluation():
    from examples import test_evaluation
    print("\n\ntestEvaluation")
    test_evaluation.execute_script()


def sna_log():
    from examples import sna_log
    print("\n\nsna_log")
    sna_log.execute_script()


def token_replay_alpha():
    from examples import token_replay_alpha
    print("\n\ntokenReplay_alpha")
    token_replay_alpha.execute_script()


def manual_log_generation():
    from examples import manual_log_generation
    print("\n\nmanual_log_generation")
    manual_log_generation.execute_script()


def token_replay_imdf():
    from examples import token_replay_imdf
    print("\n\ntokenReplay_imdf")
    token_replay_imdf.execute_script()


def decisiontree_trivial_example():
    from examples import decisiontree_trivial_example
    print("\n\ndecisiontree_trivial_example")
    decisiontree_trivial_example.execute_script()


def decisiontree_align_example():
    from examples import decisiontree_align_example
    print("\n\ndecisiontree_align_example")
    decisiontree_align_example.execute_script()


def align_decomposition_example():
    from examples import align_decomposition_example
    print("\n\nalign_decomposition_example")
    align_decomposition_example.execute_script()


def transition_system_test():
    from examples import transition_system_test
    print("\n\ntransition_system_test")
    transition_system_test.execute_script()


def heu_miner_test():
    from examples import heu_miner_test
    print("\n\nheu_miner_test")
    heu_miner_test.execute_script()


def dfg_min_ex_log():
    from examples import dfg_min_ex_log
    print("\n\ndfg_min_ex_log")
    dfg_min_ex_log.execute_script()


def dfg_min_ex_pandas():
    from examples import dfg_min_ex_pandas
    print("\n\ndfg_min_ex_pandas")
    dfg_min_ex_pandas.execute_script()


def dfg_filt_act_paths_perc():
    from examples import dfg_filt_act_paths_perc
    print("\n\ndfg_filt_act_paths_perc")
    dfg_filt_act_paths_perc.execute_script()


def graphs_visualization():
    from examples import graphs_visualization
    print("\n\ngraphs_visualization")
    graphs_visualization.execute_script()


def backwards_token_replay():
    from examples import backwards_token_replay
    print("\n\nbackwards_token_replay")
    backwards_token_replay.execute_script()


def transient_dfg():
    from examples import transient_dfg
    print("\n\ntransient_dfg")
    transient_dfg.execute_script()


def transient_petri_net():
    from examples import transient_petri_net
    print("\n\ntransient_petri_net")
    transient_petri_net.execute_script()


def monte_carlo_dfg():
    from examples import montecarlo_dfg
    print("\n\nmontecarlo_dfg")
    montecarlo_dfg.execute_script()


def monte_carlo_petri_net():
    from examples import montecarlo_petri_net
    print("\n\nmontecarlo_petri_net")
    montecarlo_petri_net.execute_script()


def visualization_processtree():
    from examples import visualization_processtree
    print("\n\nvisualization_processtree")
    visualization_processtree.execute_script()


def diagn_add_dataframe():
    from examples import diagn_add_dataframe
    print("\n\ndiagn_add_dataframe")
    diagn_add_dataframe.execute_script()


def pn_to_pt():
    from examples import pn_to_pt
    print("\n\npn_to_pt")
    pn_to_pt.execute_script()


def visualization_align_table():
    from examples import visualization_align_table
    print("\n\nvisualization_align_table")
    visualization_align_table.execute_script()


def align_approx_pt():
    from examples import align_approx_pt
    print("\n\nalign_approx_pt")
    align_approx_pt.execute_script()


def streaming_conformance_footprints():
    from examples import streaming_conformance_footprints
    print("\n\nstreaming_conformance_footprints")
    streaming_conformance_footprints.execute_script()


def streaming_conformance_tbr():
    from examples import streaming_conformance_tbr
    print("\n\nstreaming_conformance_tbr")
    streaming_conformance_tbr.execute_script()


def streaming_conformance_temporal_profile():
    from examples import streaming_conformance_temporal_profile
    print("\n\nstreaming_conformance_temporal_profile")
    streaming_conformance_temporal_profile.execute_script()


def streaming_csv_reader_event_stream():
    from examples import streaming_csv_reader_event_stream
    print("\n\nstreaming_csv_reader_event_stream")
    streaming_csv_reader_event_stream.execute_script()


def streaming_discovery_dfg():
    from examples import streaming_discovery_dfg
    print("\n\nstreaming_discovery_dfg")
    streaming_discovery_dfg.execute_script()


def streaming_xes_reader_event_stream():
    from examples import streaming_xes_reader_event_stream
    print("\n\nstreaming_xes_reader_event_stream")
    streaming_xes_reader_event_stream.execute_script()


def streaming_xes_reader_trace_stream():
    from examples import streaming_xes_reader_trace_stream
    print("\n\nstreaming_xes_reader_trace_stream")
    streaming_xes_reader_trace_stream.execute_script()


def example_check_fitness():
    from examples import example_check_fitness
    print("\n\nexample_check_fitness")
    example_check_fitness.execute_script()


def dfg_align_log():
    from examples import dfg_align_log
    print("\n\ndfg_align_log")
    dfg_align_log.execute_script()


def dfg_playout():
    from examples import dfg_playout
    print("\n\ndfg_playout")
    dfg_playout.execute_script()


def temporal_profile_log():
    from examples import temporal_profile_log
    print("\n\ntemporal_profile_log")
    temporal_profile_log.execute_script()


def temporal_profile_dataframe():
    from examples import temporal_profile_dataframe
    print("\n\ntemporal_profile_dataframe")
    temporal_profile_dataframe.execute_script()


def dataframe_prefix_and_fea_extraction():
    from examples import dataframe_prefix_and_fea_extraction
    print("\n\ndataframe_prefix_and_fea_extraction")
    dataframe_prefix_and_fea_extraction.execute_script()


def logs_alignments():
    from examples import logs_alignment
    print("\n\nlogs_alignment")
    logs_alignment.execute_script()


def visualization_serialization():
    from examples import visualization_serialization
    print("\n\visualization_serialization")
    visualization_serialization.execute_script()


def orgmining_local_diagn():
    from examples import orgmining_local_diagn
    print("\n\norgmining_local_diagn")
    orgmining_local_diagn.execute_script()


def resource_profiles_log():
    from examples import resource_profiles_log
    print("\n\nresource_profiles_log")
    resource_profiles_log.execute_script()


def resource_profile_pandas():
    from examples import resource_profiles_pandas
    print("\n\nresource_profile_pandas")
    resource_profiles_pandas.execute_script()


def process_tree_reduction():
    from examples import process_tree_reduction
    print("\n\nprocess_tree_reduction")
    process_tree_reduction.execute_script()


def execute_script(f):
    try:
        f()
    except:
        traceback.print_exc()
        input("\npress INPUT if you want to continue")


sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))))

if __name__ == "__main__":
    execute_script(feature_extraction_ocel)
    execute_script(ocel_validation)
    execute_script(process_tree_frequency_annotation)
    execute_script(tree_manual_generation)
    execute_script(workalendar_example)
    execute_script(merging_case_relations)
    execute_script(activity_position)
    execute_script(link_analysis_vbfa)
    execute_script(ocel_streaming)
    execute_script(petri_manual_generation)
    execute_script(timestamp_interleavings)
    execute_script(object_centric_petri_net_discovery)
    execute_script(trans_system_stochastic_view)
    execute_script(network_analysis)
    execute_script(read_write_ocel)
    execute_script(ocdfg_discovery)
    execute_script(enrich_log_with_align)
    execute_script(extended_marking_equation)
    execute_script(features_locally_linear_embedding)
    execute_script(discovery_data_petri_net)
    execute_script(pandas_iterable)
    execute_script(pandas_iterable_to_trace_stream)
    execute_script(data_petri_nets)
    execute_script(inhibitor_reset_arcs)
    execute_script(dotted_chart)
    execute_script(performance_spectrum)
    execute_script(orgmining_local_diagn)
    execute_script(resource_profiles_log)
    execute_script(resource_profile_pandas)
    execute_script(process_tree_reduction)
    execute_script(dataframe_prefix_and_fea_extraction)
    execute_script(logs_alignments)
    execute_script(visualization_serialization)
    execute_script(woflan)
    execute_script(bpmn_from_pt)
    execute_script(bpmn_import_and_to_petri_net)
    execute_script(tree_playout)
    execute_script(emd_evaluation)
    execute_script(footprints_tree_conf)
    execute_script(footprints_petri_net)
    execute_script(corr_mining)
    execute_script(log_skeleton)
    execute_script(roles_detection)
    execute_script(alignment_test)
    execute_script(dec_treplay_imdf)
    execute_script(logs_petri_visual_comparison)
    execute_script(imdf_example)
    execute_script(test_evaluation)
    execute_script(sna_log)
    execute_script(token_replay_alpha)
    execute_script(manual_log_generation)
    execute_script(token_replay_imdf)
    execute_script(decisiontree_trivial_example)
    execute_script(decisiontree_align_example)
    execute_script(align_decomposition_example)
    execute_script(transition_system_test)
    execute_script(heu_miner_test)
    execute_script(dfg_min_ex_log)
    execute_script(dfg_min_ex_pandas)
    execute_script(graphs_visualization)
    execute_script(backwards_token_replay)
    execute_script(transient_dfg)
    execute_script(transient_petri_net)
    execute_script(monte_carlo_dfg)
    execute_script(monte_carlo_petri_net)
    execute_script(visualization_processtree)
    execute_script(visualization_align_table)
    execute_script(pn_to_pt)
    execute_script(simplified_interface)
    execute_script(align_approx_pt)
    execute_script(streaming_conformance_footprints)
    execute_script(streaming_conformance_tbr)
    execute_script(streaming_csv_reader_event_stream)
    execute_script(streaming_discovery_dfg)
    execute_script(streaming_xes_reader_event_stream)
    execute_script(streaming_xes_reader_trace_stream)
    execute_script(example_check_fitness)
