diff --git a/.github/workflows/simod.yml b/.github/workflows/simod.yml index ecb35738..dfd70775 100644 --- a/.github/workflows/simod.yml +++ b/.github/workflows/simod.yml @@ -28,7 +28,7 @@ jobs: timeout-minutes: 120 strategy: matrix: - python-version: [ '3.9' ] + python-version: [ '3.11' ] steps: - uses: actions/checkout@v3 with: @@ -121,7 +121,7 @@ jobs: if: github.ref == 'refs/heads/master' strategy: matrix: - python-version: [ '3.9' ] + python-version: [ '3.11' ] environment: name: PyPI url: https://pypi.org/p/simod diff --git a/README.md b/README.md index b8887ddf..75ca8473 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ the [Prosimos](https://github.com/AutomatedProcessImprovement/Prosimos) simulato | Dependency | Version | Notes | |------------|---------|------------------------------------------------------------------------------------------------------------------------------------------------| -| Python | 3.9 | For Windows, [Python 3.9.13](https://www.python.org/downloads/release/python-3913/) is the last distribution with Windows installers. | +| Python | 3.11 | For Windows, [Python 3.9.13](https://www.python.org/downloads/release/python-3913/) is the last distribution with Windows installers. | | Java | 1.8 | For example, use [Amazon Corretto 8](https://docs.aws.amazon.com/corretto/latest/corretto-8-ug/downloads-list.html). | | Poetry | latest | If using Docker or compiling from source, use [Poetry](https://python-poetry.org/) for building, installing, and managing Python dependencies. | diff --git a/pyproject.toml b/pyproject.toml index 70a0141e..4084f878 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "simod" -version = "5.1.6" +version = "5.2.0" authors = [ "Ihar Suvorau ", "David Chapela ", @@ -15,40 +15,40 @@ readme = "README.md" packages = [{ include = "simod", from = "src" }] [tool.poetry.dependencies] -python = "^3.9,<3.12" -click = "^8.1.3" -hyperopt = "^0.2.7" -lxml = "^5.3.0" -matplotlib = "^3.6.0" -networkx = "^3.2.1" -numpy = "^1.24.23" -pandas = "^2.1.0" -pendulum = "^3.0.0" -pydantic = "^2.3.0" -python-dotenv = "^1.0.0" -python-multipart = "^0.0.12" -pytz = "^2024.2" -PyYAML = "^6.0" -requests = "^2.28.2" -scipy = "^1.13.0" +python = ">=3.11,<3.13" +click = "^8.4.2" +hyperopt = "^0.3.0" +lxml = "^6.1.1" +matplotlib = "^3.11.1" +networkx = "^3.6.1" +numpy = "^2.4.6" +pandas = "^2.3.3" +pendulum = "^3.2.0" +pydantic = "^2.13.4" +python-dotenv = "^1.2.2" +python-multipart = "^0.0.32" +pytz = "^2026.3" +PyYAML = "^6.0.3" +requests = "^2.34.2" +scipy = "^1.17.1" statistics = "^1.0.3.5" -tqdm = "^4.64.1" -xmltodict = "^0.13.0" -prosimos = "^2.0.6" -extraneous-activity-delays = "^2.1.21" +tqdm = "^4.70.0" +xmltodict = "^1.0.4" +prosimos = "^2.1.0" +extraneous-activity-delays = "^2.3.0" openxes-cli-py = "^0.1.15" -pix-framework = "^0.13.17" -log-distance-measures = "^2.0.0" +pix-framework = "^0.15.0" +log-distance-measures = "^2.2.0" [tool.poetry.group.dev.dependencies] -pytest = "^7.1.3" -pytest-cov = "^4" +pytest = "^9.0.1" +pytest-cov = "^7.0.0" memory-profiler = "^0.61.0" -pylint = "^2.17.4" -setuptools = "^67.8.0" -seaborn = "^0.12.2" -pytest-benchmark = "^4.0.0" -snakeviz = "^2.2.0" +pylint = "^4.0.3" +setuptools = "^80.9.0" +seaborn = "^0.13.2" +pytest-benchmark = "^5.2.3" +snakeviz = "^2.2.2" [tool.poetry.scripts] simod = "simod.cli:main" diff --git a/resources/config/benchmark/benchmark_pool.yml b/resources/config/benchmark/AcademicCredentials_diff.yml similarity index 69% rename from resources/config/benchmark/benchmark_pool.yml rename to resources/config/benchmark/AcademicCredentials_diff.yml index a6be57fb..99e019da 100644 --- a/resources/config/benchmark/benchmark_pool.yml +++ b/resources/config/benchmark/AcademicCredentials_diff.yml @@ -1,12 +1,12 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/AcademicCredentials_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz + test_log_path: ../../event_logs/AcademicCredentials_test.csv.gz # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -23,10 +23,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -40,7 +61,7 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 40 # Number of times to evaluate each iteration (using the mean of all of them) num_evaluations_per_iteration: 5 # Methods for discovering gateway probabilities @@ -77,7 +98,7 @@ resource_model: # Resource profiles configuration resource_profiles: # Resource profile discovery type - discovery_type: pool + discovery_type: differentiated # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) granularity: 60 # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) @@ -89,4 +110,4 @@ resource_model: - 0.05 - 0.5 # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) - participation: 0.4 + participation: 0.4 \ No newline at end of file diff --git a/resources/config/benchmark/AcademicCredentials_diff_extr.yml b/resources/config/benchmark/AcademicCredentials_diff_extr.yml new file mode 100644 index 00000000..0409306e --- /dev/null +++ b/resources/config/benchmark/AcademicCredentials_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/AcademicCredentials_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/AcademicCredentials_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/AcademicCredentials_diff/best_result/AcademicCredentials_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/AcademicCredentials_fuzz.yml b/resources/config/benchmark/AcademicCredentials_fuzz.yml new file mode 100644 index 00000000..8c300773 --- /dev/null +++ b/resources/config/benchmark/AcademicCredentials_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/AcademicCredentials_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/AcademicCredentials_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/AcademicCredentials_diff/best_result/AcademicCredentials_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/AcademicCredentials_fuzz_extr.yml b/resources/config/benchmark/AcademicCredentials_fuzz_extr.yml new file mode 100644 index 00000000..9c4cf7bb --- /dev/null +++ b/resources/config/benchmark/AcademicCredentials_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/AcademicCredentials_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/AcademicCredentials_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/AcademicCredentials_diff/best_result/AcademicCredentials_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/AcademicCredentials_pool.yml b/resources/config/benchmark/AcademicCredentials_pool.yml new file mode 100644 index 00000000..be806a2c --- /dev/null +++ b/resources/config/benchmark/AcademicCredentials_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/AcademicCredentials_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/AcademicCredentials_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/AcademicCredentials_diff/best_result/AcademicCredentials_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/benchmark_diff.yml b/resources/config/benchmark/BPIC_2012_diff.yml similarity index 71% rename from resources/config/benchmark/benchmark_diff.yml rename to resources/config/benchmark/BPIC_2012_diff.yml index 49c2cd3d..d4c3b79c 100644 --- a/resources/config/benchmark/benchmark_diff.yml +++ b/resources/config/benchmark/BPIC_2012_diff.yml @@ -1,14 +1,12 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/BPIC_2012_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz - # Use observed arrival distributions - use_observed_arrival_distribution: false + test_log_path: ../../event_logs/BPIC_2012_test.csv.gz # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -25,10 +23,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -42,7 +61,7 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 40 # Number of times to evaluate each iteration (using the mean of all of them) num_evaluations_per_iteration: 5 # Methods for discovering gateway probabilities diff --git a/resources/config/benchmark/BPIC_2012_diff_extr.yml b/resources/config/benchmark/BPIC_2012_diff_extr.yml new file mode 100644 index 00000000..57e1a95f --- /dev/null +++ b/resources/config/benchmark/BPIC_2012_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2012_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2012_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2012_diff/best_result/BPIC_2012_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/BPIC_2012_fuzz.yml b/resources/config/benchmark/BPIC_2012_fuzz.yml new file mode 100644 index 00000000..c67c2da8 --- /dev/null +++ b/resources/config/benchmark/BPIC_2012_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2012_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2012_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2012_diff/best_result/BPIC_2012_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/BPIC_2012_fuzz_extr.yml b/resources/config/benchmark/BPIC_2012_fuzz_extr.yml new file mode 100644 index 00000000..5338dd7a --- /dev/null +++ b/resources/config/benchmark/BPIC_2012_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2012_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2012_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2012_diff/best_result/BPIC_2012_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/BPIC_2012_pool.yml b/resources/config/benchmark/BPIC_2012_pool.yml new file mode 100644 index 00000000..4b3097de --- /dev/null +++ b/resources/config/benchmark/BPIC_2012_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2012_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2012_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2012_diff/best_result/BPIC_2012_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/benchmark_diff_data_aware.yml b/resources/config/benchmark/BPIC_2017_diff.yml similarity index 69% rename from resources/config/benchmark/benchmark_diff_data_aware.yml rename to resources/config/benchmark/BPIC_2017_diff.yml index 1c153804..9db075c3 100644 --- a/resources/config/benchmark/benchmark_diff_data_aware.yml +++ b/resources/config/benchmark/BPIC_2017_diff.yml @@ -1,12 +1,12 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/BPIC_2017_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz + test_log_path: ../../event_logs/BPIC_2017_test.csv.gz # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -23,10 +23,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not - discover_data_attributes: true + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -40,7 +61,7 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 40 # Number of times to evaluate each iteration (using the mean of all of them) num_evaluations_per_iteration: 5 # Methods for discovering gateway probabilities @@ -61,12 +82,6 @@ control_flow: - false # Whether to prioritize parallelism over loops or not prioritize_parallelism: true - # Discover data-aware branching rules, i.e., BPMN decision points based on value of data attributes - discover_branch_rules: true - # Minimum f-score value to consider the discovered data-aware branching rules - f_score: - - 0.3 - - 0.9 ################## # Resource model # ################## diff --git a/resources/config/benchmark/BPIC_2017_diff_extr.yml b/resources/config/benchmark/BPIC_2017_diff_extr.yml new file mode 100644 index 00000000..d81f3818 --- /dev/null +++ b/resources/config/benchmark/BPIC_2017_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2017_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2017_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2017_diff/best_result/BPIC_2017_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/BPIC_2017_fuzz.yml b/resources/config/benchmark/BPIC_2017_fuzz.yml new file mode 100644 index 00000000..e06c5774 --- /dev/null +++ b/resources/config/benchmark/BPIC_2017_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2017_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2017_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2017_diff/best_result/BPIC_2017_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/BPIC_2017_fuzz_extr.yml b/resources/config/benchmark/BPIC_2017_fuzz_extr.yml new file mode 100644 index 00000000..5d24f8b4 --- /dev/null +++ b/resources/config/benchmark/BPIC_2017_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2017_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2017_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2017_diff/best_result/BPIC_2017_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/BPIC_2017_pool.yml b/resources/config/benchmark/BPIC_2017_pool.yml new file mode 100644 index 00000000..6ef5916d --- /dev/null +++ b/resources/config/benchmark/BPIC_2017_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/BPIC_2017_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/BPIC_2017_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/BPIC_2017_diff/best_result/BPIC_2017_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/Governmental_Agency_diff.yml b/resources/config/benchmark/Governmental_Agency_diff.yml new file mode 100644 index 00000000..2b195ffc --- /dev/null +++ b/resources/config/benchmark/Governmental_Agency_diff.yml @@ -0,0 +1,113 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/Governmental_Agency_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/Governmental_Agency_test.csv.gz + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery + # Discover process model with SplitMiner v3 + mining_algorithm: sm1 + # Number of concurrent relations between events to be captured + epsilon: + - 0.05 + - 0.4 + # Threshold for filtering the incoming and outgoing edges + eta: + - 0.2 + - 0.7 + # Whether to replace non-trivial OR joins or not + replace_or_joins: + - true + - false + # Whether to prioritize parallelism over loops or not + prioritize_parallelism: true +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 \ No newline at end of file diff --git a/resources/config/benchmark/Governmental_Agency_diff_extr.yml b/resources/config/benchmark/Governmental_Agency_diff_extr.yml new file mode 100644 index 00000000..a01285c0 --- /dev/null +++ b/resources/config/benchmark/Governmental_Agency_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/Governmental_Agency_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/Governmental_Agency_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/Governmental_Agency_diff/best_result/Governmental_Agency_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/Governmental_Agency_fuzz.yml b/resources/config/benchmark/Governmental_Agency_fuzz.yml new file mode 100644 index 00000000..f037dbd2 --- /dev/null +++ b/resources/config/benchmark/Governmental_Agency_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/Governmental_Agency_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/Governmental_Agency_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/Governmental_Agency_diff/best_result/Governmental_Agency_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/Governmental_Agency_fuzz_extr.yml b/resources/config/benchmark/Governmental_Agency_fuzz_extr.yml new file mode 100644 index 00000000..8be9432a --- /dev/null +++ b/resources/config/benchmark/Governmental_Agency_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/Governmental_Agency_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/Governmental_Agency_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/Governmental_Agency_diff/best_result/Governmental_Agency_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/Governmental_Agency_pool.yml b/resources/config/benchmark/Governmental_Agency_pool.yml new file mode 100644 index 00000000..70ca90d4 --- /dev/null +++ b/resources/config/benchmark/Governmental_Agency_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/Governmental_Agency_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/Governmental_Agency_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/Governmental_Agency_diff/best_result/Governmental_Agency_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/benchmark_diff_extr.yml b/resources/config/benchmark/P2PFin_diff.yml similarity index 71% rename from resources/config/benchmark/benchmark_diff_extr.yml rename to resources/config/benchmark/P2PFin_diff.yml index afb32fde..3d136979 100644 --- a/resources/config/benchmark/benchmark_diff_extr.yml +++ b/resources/config/benchmark/P2PFin_diff.yml @@ -1,12 +1,12 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/P2PFin_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz + test_log_path: ../../event_logs/P2PFin_test.csv.gz # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -23,10 +23,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -40,7 +61,7 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 40 # Number of times to evaluate each iteration (using the mean of all of them) num_evaluations_per_iteration: 5 # Methods for discovering gateway probabilities @@ -89,14 +110,4 @@ resource_model: - 0.05 - 0.5 # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) - participation: 0.4 -##################### -# Extraneous delays # -##################### -extraneous_activity_delays: - # Method to compute the extraneous delay (naive or eclipse-aware) - discovery_method: eclipse-aware - # Metric to guide the optimization process (loss function to minimize) - optimization_metric: relative_emd - # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) - num_iterations: 20 + participation: 0.4 \ No newline at end of file diff --git a/resources/config/benchmark/P2PFin_diff_extr.yml b/resources/config/benchmark/P2PFin_diff_extr.yml new file mode 100644 index 00000000..aa33e3c9 --- /dev/null +++ b/resources/config/benchmark/P2PFin_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/P2PFin_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/P2PFin_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/P2PFin_diff/best_result/P2PFin_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/benchmark_fuzz.yml b/resources/config/benchmark/P2PFin_fuzz.yml similarity index 60% rename from resources/config/benchmark/benchmark_fuzz.yml rename to resources/config/benchmark/P2PFin_fuzz.yml index 8c020907..6fe24f5a 100644 --- a/resources/config/benchmark/benchmark_fuzz.yml +++ b/resources/config/benchmark/P2PFin_fuzz.yml @@ -1,12 +1,14 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/P2PFin_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz + test_log_path: ../../event_logs/P2PFin_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/P2PFin_diff/best_result/P2PFin_train.bpmn # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -23,10 +25,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -40,27 +63,11 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 1 # Number of times to evaluate each iteration (using the mean of all of them) - num_evaluations_per_iteration: 5 + num_evaluations_per_iteration: 1 # Methods for discovering gateway probabilities gateway_probabilities: discovery - # Discover process model with SplitMiner v3 - mining_algorithm: sm1 - # Number of concurrent relations between events to be captured - epsilon: - - 0.05 - - 0.4 - # Threshold for filtering the incoming and outgoing edges - eta: - - 0.2 - - 0.7 - # Whether to replace non-trivial OR joins or not - replace_or_joins: - - true - - false - # Whether to prioritize parallelism over loops or not - prioritize_parallelism: true ################## # Resource model # ################## diff --git a/resources/config/benchmark/benchmark_fuzz_extr.yml b/resources/config/benchmark/P2PFin_fuzz_extr.yml similarity index 64% rename from resources/config/benchmark/benchmark_fuzz_extr.yml rename to resources/config/benchmark/P2PFin_fuzz_extr.yml index dddd2da0..84db14db 100644 --- a/resources/config/benchmark/benchmark_fuzz_extr.yml +++ b/resources/config/benchmark/P2PFin_fuzz_extr.yml @@ -1,12 +1,14 @@ -version: 5 +version: 5.2 ########## # Common # ########## common: # Path to the event log in CSV format - train_log_path: ../../event_logs/BPIC_2012_W_train.csv.gz + train_log_path: ../../event_logs/P2PFin_train.csv.gz # Event log to evaluate the discovered BPS model with - test_log_path: ../../event_logs/BPIC_2012_W_test.csv.gz + test_log_path: ../../event_logs/P2PFin_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/P2PFin_diff/best_result/P2PFin_train.bpmn # Specify the name for each of the columns in the CSV file (XES standard by default) log_ids: case: "case_id" @@ -23,10 +25,31 @@ common: - absolute_event_distribution - relative_event_distribution - circadian_event_distribution + - circadian_workforce_distribution - arrival_event_distribution - cycle_time_distribution # Whether to discover case attributes or not discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 ################# # Preprocessing # ################# @@ -40,27 +63,11 @@ control_flow: # Metric to guide the optimization process (loss function to minimize) optimization_metric: two_gram_distance # Number of optimization iterations over the search space - num_iterations: 30 + num_iterations: 1 # Number of times to evaluate each iteration (using the mean of all of them) - num_evaluations_per_iteration: 5 + num_evaluations_per_iteration: 1 # Methods for discovering gateway probabilities gateway_probabilities: discovery - # Discover process model with SplitMiner v3 - mining_algorithm: sm1 - # Number of concurrent relations between events to be captured - epsilon: - - 0.05 - - 0.4 - # Threshold for filtering the incoming and outgoing edges - eta: - - 0.2 - - 0.7 - # Whether to replace non-trivial OR joins or not - replace_or_joins: - - true - - false - # Whether to prioritize parallelism over loops or not - prioritize_parallelism: true ################## # Resource model # ################## diff --git a/resources/config/benchmark/P2PFin_pool.yml b/resources/config/benchmark/P2PFin_pool.yml new file mode 100644 index 00000000..e3ab987b --- /dev/null +++ b/resources/config/benchmark/P2PFin_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/P2PFin_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/P2PFin_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/P2PFin_diff/best_result/P2PFin_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/WorkOrders_postdrift_diff.yml b/resources/config/benchmark/WorkOrders_postdrift_diff.yml new file mode 100644 index 00000000..06011c26 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_postdrift_diff.yml @@ -0,0 +1,113 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_postdrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_postdrift_test.csv.gz + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery + # Discover process model with SplitMiner v3 + mining_algorithm: sm1 + # Number of concurrent relations between events to be captured + epsilon: + - 0.05 + - 0.4 + # Threshold for filtering the incoming and outgoing edges + eta: + - 0.2 + - 0.7 + # Whether to replace non-trivial OR joins or not + replace_or_joins: + - true + - false + # Whether to prioritize parallelism over loops or not + prioritize_parallelism: true +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 \ No newline at end of file diff --git a/resources/config/benchmark/WorkOrders_postdrift_diff_extr.yml b/resources/config/benchmark/WorkOrders_postdrift_diff_extr.yml new file mode 100644 index 00000000..c2a45030 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_postdrift_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_postdrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_postdrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_postdrift_diff/best_result/WorkOrders_postdrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/WorkOrders_postdrift_fuzz.yml b/resources/config/benchmark/WorkOrders_postdrift_fuzz.yml new file mode 100644 index 00000000..21eb2fc0 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_postdrift_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_postdrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_postdrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_postdrift_diff/best_result/WorkOrders_postdrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/WorkOrders_postdrift_fuzz_extr.yml b/resources/config/benchmark/WorkOrders_postdrift_fuzz_extr.yml new file mode 100644 index 00000000..5604bc01 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_postdrift_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_postdrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_postdrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_postdrift_diff/best_result/WorkOrders_postdrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/WorkOrders_postdrift_pool.yml b/resources/config/benchmark/WorkOrders_postdrift_pool.yml new file mode 100644 index 00000000..9946ce5f --- /dev/null +++ b/resources/config/benchmark/WorkOrders_postdrift_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_postdrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_postdrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_postdrift_diff/best_result/WorkOrders_postdrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/benchmark/WorkOrders_predrift_diff.yml b/resources/config/benchmark/WorkOrders_predrift_diff.yml new file mode 100644 index 00000000..dd6061d5 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_predrift_diff.yml @@ -0,0 +1,113 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_predrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_predrift_test.csv.gz + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery + # Discover process model with SplitMiner v3 + mining_algorithm: sm1 + # Number of concurrent relations between events to be captured + epsilon: + - 0.05 + - 0.4 + # Threshold for filtering the incoming and outgoing edges + eta: + - 0.2 + - 0.7 + # Whether to replace non-trivial OR joins or not + replace_or_joins: + - true + - false + # Whether to prioritize parallelism over loops or not + prioritize_parallelism: true +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 \ No newline at end of file diff --git a/resources/config/benchmark/WorkOrders_predrift_diff_extr.yml b/resources/config/benchmark/WorkOrders_predrift_diff_extr.yml new file mode 100644 index 00000000..be2e7576 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_predrift_diff_extr.yml @@ -0,0 +1,109 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_predrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_predrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_predrift_diff/best_result/WorkOrders_predrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/WorkOrders_predrift_fuzz.yml b/resources/config/benchmark/WorkOrders_predrift_fuzz.yml new file mode 100644 index 00000000..fd1772b8 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_predrift_fuzz.yml @@ -0,0 +1,92 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_predrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_predrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_predrift_diff/best_result/WorkOrders_predrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 diff --git a/resources/config/benchmark/WorkOrders_predrift_fuzz_extr.yml b/resources/config/benchmark/WorkOrders_predrift_fuzz_extr.yml new file mode 100644 index 00000000..96a40f33 --- /dev/null +++ b/resources/config/benchmark/WorkOrders_predrift_fuzz_extr.yml @@ -0,0 +1,102 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_predrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_predrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_predrift_diff/best_result/WorkOrders_predrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: differentiated_fuzzy + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + fuzzy_angle: + - 0.1 + - 0.9 +##################### +# Extraneous delays # +##################### +extraneous_activity_delays: + # Method to compute the extraneous delay (naive or eclipse-aware) + discovery_method: eclipse-aware + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: relative_emd + # Number of optimization iterations over the search space (1 = direct discovery, no optimization stage) + num_iterations: 20 diff --git a/resources/config/benchmark/WorkOrders_predrift_pool.yml b/resources/config/benchmark/WorkOrders_predrift_pool.yml new file mode 100644 index 00000000..316a9adf --- /dev/null +++ b/resources/config/benchmark/WorkOrders_predrift_pool.yml @@ -0,0 +1,99 @@ +version: 5.2 +########## +# Common # +########## +common: + # Path to the event log in CSV format + train_log_path: ../../event_logs/WorkOrders_predrift_train.csv.gz + # Event log to evaluate the discovered BPS model with + test_log_path: ../../event_logs/WorkOrders_predrift_test.csv.gz + # Use this process model and skip its discovery + process_model_path: ../../../outputs/WorkOrders_predrift_diff/best_result/WorkOrders_predrift_train.bpmn + # Specify the name for each of the columns in the CSV file (XES standard by default) + log_ids: + case: "case_id" + activity: "activity" + resource: "resource" + start_time: "start_time" + end_time: "end_time" + # Number of evaluations of the discovered BPS model + num_final_evaluations: 10 + # Metrics to evaluate the discovered BPS model + evaluation_metrics: + - 3_gram_distance + - 2_gram_distance + - absolute_event_distribution + - relative_event_distribution + - circadian_event_distribution + - circadian_workforce_distribution + - arrival_event_distribution + - cycle_time_distribution + # Whether to discover case attributes or not + discover_data_attributes: false +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 +################# +# Preprocessing # +################# +preprocessing: + multitasking: false + enable_time_concurrency_threshold: 0.5 +################ +# Control-flow # +################ +control_flow: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: two_gram_distance + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # Methods for discovering gateway probabilities + gateway_probabilities: discovery +################## +# Resource model # +################## +resource_model: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: circadian_emd + # Number of optimization iterations over the search space + num_iterations: 40 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 5 + # Whether to discover prioritization or batching behavior + discover_prioritization_rules: false + discover_batching_rules: false + # Resource profiles configuration + resource_profiles: + # Resource profile discovery type + discovery_type: pool + # Time granularity (in minutes) for the resource calendar (the higher the density of events in the log, the smaller the granularity can be) + granularity: 60 + # Minimum confidence of the intervals in the discovered calendar (of a resource or set of resources) + confidence: + - 0.5 + - 0.85 + # Minimum support of the intervals in the discovered calendar (of a resource or set of resources) + support: + - 0.05 + - 0.5 + # Participation of a resource in the process to discover a calendar for them (gathered together otherwise) + participation: 0.4 diff --git a/resources/config/complete_configuration.yml b/resources/config/complete_configuration.yml index f37603e7..a0037be5 100644 --- a/resources/config/complete_configuration.yml +++ b/resources/config/complete_configuration.yml @@ -1,4 +1,4 @@ -version: 5 +version: 5.2 ########## # Common # @@ -31,9 +31,6 @@ common: - circadian_event_distribution - arrival_event_distribution - cycle_time_distribution - # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, - # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. - use_observed_arrival_distribution: false # Whether to delete all files created during the optimization phases or not clean_intermediate_files: true # Whether to discover global/case/event attributes and their update rules or not @@ -55,6 +52,27 @@ preprocessing: concurrency_l2l: 0.9 # Length 2 loops threshold concurrency_l1l: 0.9 # Length 1 loops threshold +###################### +# Case Arrival model # +###################### +case_arrival: + # Metric to guide the optimization process (loss function to minimize) + optimization_metric: arrival_event_distribution + # Number of optimization iterations over the search space + num_iterations: 5 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 3 + # Whether to simulate the arrival times using the distribution of inter-arrival times observed in the training log, + # or fitting a parameterized probabilistic distribution (e.g., norm, expon) with these observed values. + use_observed_arrival_distribution: false + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: + - 5.0 + - 50.0 + ################ # Control-flow # ################ diff --git a/resources/config/configuration_example.yml b/resources/config/configuration_example.yml index 186512ea..aa371347 100644 --- a/resources/config/configuration_example.yml +++ b/resources/config/configuration_example.yml @@ -6,7 +6,7 @@ # - Increase the num_iterations to (potentially) improve the quality of that discovered model # # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## diff --git a/resources/config/configuration_example_data_aware.yml b/resources/config/configuration_example_data_aware.yml index aeaddffb..51f0047c 100644 --- a/resources/config/configuration_example_data_aware.yml +++ b/resources/config/configuration_example_data_aware.yml @@ -6,7 +6,7 @@ # - Increase the num_iterations to (potentially) improve the quality of that discovered model # # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## diff --git a/resources/config/configuration_example_fuzzy.yml b/resources/config/configuration_example_fuzzy.yml index 5e74418d..ced6af60 100644 --- a/resources/config/configuration_example_fuzzy.yml +++ b/resources/config/configuration_example_fuzzy.yml @@ -6,7 +6,7 @@ # - Increase the num_iterations to (potentially) improve the quality of that discovered model # # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## diff --git a/resources/config/configuration_example_with_evaluation.yml b/resources/config/configuration_example_with_evaluation.yml index 10f412a7..1e9a6187 100644 --- a/resources/config/configuration_example_with_evaluation.yml +++ b/resources/config/configuration_example_with_evaluation.yml @@ -4,7 +4,7 @@ # - Increase the num_iterations to (potentially) improve the quality of that discovered model # # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## diff --git a/resources/config/configuration_example_with_provided_process_model.yml b/resources/config/configuration_example_with_provided_process_model.yml index b490161d..95e331c5 100644 --- a/resources/config/configuration_example_with_provided_process_model.yml +++ b/resources/config/configuration_example_with_provided_process_model.yml @@ -4,7 +4,7 @@ # - Increase the num_iterations to (potentially) improve the quality of that discovered model # # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## diff --git a/resources/config/configuration_one_shot.yml b/resources/config/configuration_one_shot.yml index 9c45b7e8..7cfac9d8 100644 --- a/resources/config/configuration_one_shot.yml +++ b/resources/config/configuration_one_shot.yml @@ -4,7 +4,7 @@ ################################################################################################################# # - Visit 'complete_configuration.yml' example for a description of all configurable parameters # ################################################################################################################# -version: 5 +version: 5.2 ########## # Common # ########## @@ -19,6 +19,19 @@ common: enabled_time: "enabled_time" # If not present in the log, automatically computed start_time: "start_time" end_time: "end_time" +###################### +# Case Arrival model # +###################### +case_arrival: + # Number of optimization iterations over the search space + num_iterations: 1 + # Number of times to evaluate each iteration (using the mean of all of them) + num_evaluations_per_iteration: 1 + # When fitting a probabilistic distribution, threshold used to filter out outliers in the sample of inter-arrival + # times observed in the training event log (fixed or range between two floats). Increasing the outlier threshold + # increases the "range" of accepted values, thus, potentially decreasing the number of observations considered + # an outlier. + outlier_threshold: 50.0 ################ # Control-flow # ################ diff --git a/resources/event_logs/LoanApp_simplified_test.csv.gz b/resources/event_logs/LoanApp_simplified_test.csv.gz deleted file mode 100644 index 8174e0c1..00000000 Binary files a/resources/event_logs/LoanApp_simplified_test.csv.gz and /dev/null differ diff --git a/resources/event_logs/LoanApp_simplified_train.csv.gz b/resources/event_logs/LoanApp_simplified_train.csv.gz deleted file mode 100644 index b250be6c..00000000 Binary files a/resources/event_logs/LoanApp_simplified_train.csv.gz and /dev/null differ diff --git a/resources/event_logs/PurchasingExample.csv.gz b/resources/event_logs/PurchasingExample.csv.gz deleted file mode 100644 index 6655dfb1..00000000 Binary files a/resources/event_logs/PurchasingExample.csv.gz and /dev/null differ diff --git a/src/simod/__init__.py b/src/simod/__init__.py index e7b5ac10..8b4926b3 100644 --- a/src/simod/__init__.py +++ b/src/simod/__init__.py @@ -1 +1,10 @@ +import warnings + +# Supress HyperOpt TPE warning +warnings.filterwarnings( + "ignore", + category=UserWarning, + message=r".*pkg_resources is deprecated as an API.*" +) + __all__ = ["simod"] diff --git a/src/simod/case_arrival/__init__.py b/src/simod/case_arrival/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/simod/case_arrival/optimizer.py b/src/simod/case_arrival/optimizer.py new file mode 100644 index 00000000..6a52abab --- /dev/null +++ b/src/simod/case_arrival/optimizer.py @@ -0,0 +1,289 @@ +import json +import shutil +from pathlib import Path +from typing import List, Optional, Tuple + +import hyperopt +import numpy as np +import pandas as pd +from hyperopt import STATUS_FAIL, STATUS_OK, Trials, fmin, hp, tpe +from pix_framework.discovery.case_arrival import discover_case_arrival_model, CaseArrivalModel +from pix_framework.filesystem.file_manager import create_folder, get_random_folder_id, remove_asset + +from .settings import HyperoptIterationParams +from ..cli_formatter import print_message, print_step, print_subsection +from ..event_log.event_log import EventLog +from ..settings.case_arrival_settings import CaseArrivalSettings +from ..simulation.parameters.BPS_model import BPSModel +from ..simulation.prosimos import simulate_and_evaluate +from ..utilities import get_process_model_path, get_simulation_parameters_path, hyperopt_step + + +class CaseArrivalOptimizer: + """ + Optimizes the case-arrival of a business process simulation (BPS) model using hyperparameter + optimization. + + This class performs iterative optimization to refine the case arrival model of a BPS model.. + + The search space is built based on the parameters ranges in [settings]. + + Attributes + ---------- + event_log : :class:`EventLog` + Event log containing train and validation partitions. + initial_bps_model : :class:`BPSModel` + Business process simulation (BPS) model to use as a base, by replacing its control-flow model + with the discovered one in each iteration. + settings : :class:`~simod.settings.case_arrival_settings.CaseArrivalSettings` + Configuration settings to build the search space for the optimization process. + base_directory : :class:`pathlib.Path` + Root directory where output files will be stored. + best_bps_model : :class:`BPSModel`, optional + Best discovered BPS model after the optimization process. + evaluation_measurements : :class:`pandas.DataFrame` + Quality measures recorded for each hyperopt iteration. + + Notes + ----- + - Currently, this process only optimizes the threshold to discard outliers when learning the + inter-arrival probability distribution. + """ + + # Event log with train/validation partitions + event_log: EventLog + # BPS model taken as starting point + initial_bps_model: BPSModel + # Configuration settings + settings: CaseArrivalSettings + # Root directory for the output files + base_directory: Path + # Path to the best process model + best_bps_model: Optional[BPSModel] + # Quality measure of each hyperopt iteration + evaluation_measurements: pd.DataFrame + + # Set of trials for the hyperparameter optimization process + _bayes_trials = Trials + + def __init__( + self, + event_log: EventLog, + bps_model: BPSModel, + settings: CaseArrivalSettings, + base_directory: Path, + ): + # Save event log, optimization settings, and output directory + self.event_log = event_log + self.initial_bps_model = bps_model.deep_copy() + self.settings = settings + self.base_directory = base_directory + # Check if it is needed to discover the process model + self.best_bps_model = None + # Initialize table to store quality measures of each iteration + self.evaluation_measurements = pd.DataFrame( + columns=[ + "distance", + "metric", + "status", + "outlier_threshold", + ] + ) + # Instantiate trials for hyper-optimization process + self._bayes_trials = Trials() + self.iteration_index = 0 + + def _hyperopt_iteration(self, hyperopt_iteration_dict: dict): + # Report new iteration + print_subsection(f"Case Arrival Model optimization iteration {self.iteration_index}") + # Initialize status + status = STATUS_OK + # Create folder for this iteration + output_dir = self.base_directory / get_random_folder_id(prefix="iteration_") + create_folder(output_dir) + # Initialize BPS model for this iteration + current_bps_model = self.initial_bps_model.deep_copy() + # Parameters of this iteration + hyperopt_iteration_params = HyperoptIterationParams.from_hyperopt_dict( + hyperopt_dict=hyperopt_iteration_dict, + optimization_metric=self.settings.optimization_metric, + output_dir=output_dir, + project_name=self.event_log.process_name, + ) + print_message(f"Parameters: {hyperopt_iteration_params}") + + # Discover case arrival model + status, current_bps_model.case_arrival_model = hyperopt_step( + status, + self._discover_case_arrival_model, + hyperopt_iteration_params, + ) + + # Simulate candidate and evaluate its quality + status, evaluation_measurements = hyperopt_step( + status, + self._simulate_bps_model, + current_bps_model, + hyperopt_iteration_params.output_dir + ) + + # Define the response of this iteration + status, response = self._define_response( + status, evaluation_measurements, hyperopt_iteration_params.output_dir, current_bps_model.process_model + ) + print(f"Case Arrival Model optimization iteration response: {response}") + + # Save the quality of this evaluation and increase iteration index + self._process_measurements(hyperopt_iteration_params, status, evaluation_measurements) + self.iteration_index += 1 + + return response + + def run(self) -> HyperoptIterationParams: + """ + Run the case arrival optimization process. + + This method defines the hyperparameter search space and executes a + TPE-hyperparameter optimization process to discover the best case arrival model. + It evaluates multiple iterations and selects the best-performing set of parameters + for its discovery. + + Returns + ------- + :class:`~simod.case_arrival.settings.HyperoptIterationParams` + The parameters of the best iteration of the optimization process. + """ + # Define search space + self.iteration_index = 0 + search_space = self._define_search_space() + + # Launch optimization process + params_best_iteration = fmin( + fn=self._hyperopt_iteration, + space=search_space, + algo=tpe.suggest, + max_evals=self.settings.num_iterations, + trials=self._bayes_trials, + show_progressbar=False, + ) + params_best_iteration = hyperopt.space_eval(search_space, params_best_iteration) + + # Process best results + results = pd.DataFrame(self._bayes_trials.results).sort_values("loss") + best_result = results[results.status == STATUS_OK].iloc[0] + + # Re-build parameters of the best hyperopt iteration + best_hyperopt_parameters = HyperoptIterationParams.from_hyperopt_dict( + hyperopt_dict=params_best_iteration, + optimization_metric=self.settings.optimization_metric, + output_dir=best_result["output_dir"], + project_name=self.event_log.process_name, + ) + + # Instantiate best BPS model + self.best_bps_model = self.initial_bps_model.deep_copy() + # Update best process model (save it in base directory) + self.best_bps_model.process_model = get_process_model_path(self.base_directory, self.event_log.process_name) + shutil.copyfile(best_result["process_model_path"], self.best_bps_model.process_model) + # Update simulation parameters (save them in base directory) + best_parameters_path = get_simulation_parameters_path(self.base_directory, self.event_log.process_name) + shutil.copyfile( + get_simulation_parameters_path(best_result["output_dir"], self.event_log.process_name), best_parameters_path + ) + # Update case arrival model + self.best_bps_model.case_arrival_model = CaseArrivalModel.from_dict(json.load(open(best_parameters_path, "r"))) + + # Save evaluation measurements + self.evaluation_measurements.sort_values("distance", ascending=True, inplace=True) + self.evaluation_measurements.to_csv(self.base_directory / "evaluation_measures.csv", index=False) + + # Return settings of the best iteration + return best_hyperopt_parameters + + def _define_search_space(self) -> dict: + space = {} + # Outlier threshold + if isinstance(self.settings.outlier_threshold, tuple): + space["outlier_threshold"] = hp.uniform( + "outlier_threshold", + self.settings.outlier_threshold[0], + self.settings.outlier_threshold[1] + ) + else: + space["outlier_threshold"] = self.settings.outlier_threshold + return space + + def cleanup(self): + remove_asset(self.base_directory) + + @staticmethod + def _define_response( + status: str, + evaluation_measurements: list, + output_dir: Path, + process_model_path: Path + ) -> Tuple[str, dict]: + # Compute mean distance if status is OK + if status is STATUS_OK: + distance = np.mean([x["distance"] for x in evaluation_measurements]) + # Change status if distance value is negative + if distance < 0.0: + status = STATUS_FAIL + else: + distance = 1.0 + # Define response dict + response = { + "loss": distance, # Loss value for the fmin function + "status": status, # Status of the optimization iteration + "output_dir": output_dir, + "process_model_path": process_model_path, + } + # Return updated status and processed response + return status, response + + def _process_measurements(self, params: HyperoptIterationParams, status, evaluation_measurements): + optimization_parameters = params.to_dict() + optimization_parameters["status"] = status + + if status == STATUS_OK: + for measurement in evaluation_measurements: + values = { + "distance": measurement["distance"], + "metric": measurement["metric"], + } + values = values | optimization_parameters + self.evaluation_measurements = pd.concat([self.evaluation_measurements, pd.DataFrame([values])]) + else: + values = { + "distance": 0, + "metric": params.optimization_metric, + } + values = values | optimization_parameters + self.evaluation_measurements = pd.concat([self.evaluation_measurements, pd.DataFrame([values])]) + + def _discover_case_arrival_model(self, params: HyperoptIterationParams) -> CaseArrivalModel: + print_step(f"Discovering Case Arrival Model with threshold {params.outlier_threshold}") + return discover_case_arrival_model( + self.event_log.train_partition, + self.event_log.log_ids, + outlier_threshold=params.outlier_threshold, + ) + + def _simulate_bps_model(self, bps_model: BPSModel, output_dir: Path) -> List[dict]: + bps_model.replace_activity_names_with_ids() + + json_parameters_path = bps_model.to_json(output_dir, self.event_log.process_name) + + evaluation_measures = simulate_and_evaluate( + process_model_path=bps_model.process_model, + parameters_path=json_parameters_path, + output_dir=output_dir, + simulation_cases=self.event_log.validation_partition[self.event_log.log_ids.case].nunique(), + simulation_start_time=self.event_log.validation_partition[self.event_log.log_ids.start_time].min(), + validation_log=self.event_log.validation_partition, + validation_log_ids=self.event_log.log_ids, + metrics=[self.settings.optimization_metric], + num_simulations=self.settings.num_evaluations_per_iteration, + ) + + return evaluation_measures diff --git a/src/simod/case_arrival/settings.py b/src/simod/case_arrival/settings.py new file mode 100644 index 00000000..28aae4ea --- /dev/null +++ b/src/simod/case_arrival/settings.py @@ -0,0 +1,74 @@ +from dataclasses import dataclass +from pathlib import Path +from typing import Optional + +from simod.settings.common_settings import Metric + + +@dataclass +class HyperoptIterationParams: + """ + Parameters for a single iteration of the Case-Arrival optimization process. + + This class defines the configuration settings used during an iteration of the + optimization process of the case arrival model. + + Attributes + ---------- + output_dir : :class:`pathlib.Path` + Directory where all output files for the current iteration will be stored. + project_name : str + Name of the project, mainly used for file naming. + optimization_metric : :class:`Metric` + Metric used to evaluate the candidate process model in this iteration. + outlier_threshold : float, optional + Threshold to use when filtering outliers (positive number). + + Notes + ----- + - Currently, this process only tries different outlier thresholds. Implemented + as HyperOpt process for convenience and potential extension with more complex + case arrival model discovery. + """ + + # General settings + output_dir: Path # Directory where to output all the files of the current iteration + project_name: str # Name of the project for file naming + + optimization_metric: Metric # Metric to evaluate the candidate of this iteration + outlier_threshold: Optional[float] # Outlier threshold + + def to_dict(self) -> dict: + """ + Converts the instance into a dictionary representation of the optimization parameters. + + Returns + ------- + dict + A dictionary containing the optimization parameters for this iteration. + """ + optimization_parameters = { + "output_dir": str(self.output_dir), + "project_name": str(self.project_name), + "optimization_metric": str(self.optimization_metric), + "outlier_threshold": self.outlier_threshold, + } + + return optimization_parameters + + @staticmethod + def from_hyperopt_dict( + hyperopt_dict: dict, + optimization_metric: Metric, + output_dir: Path, + project_name: str, + ) -> "HyperoptIterationParams": + """Create the params for this run from the hyperopt dictionary returned by the fmin function.""" + outlier_threshold = hyperopt_dict.get("outlier_threshold", 20.0) + + return HyperoptIterationParams( + output_dir=output_dir, + project_name=project_name, + optimization_metric=optimization_metric, + outlier_threshold=outlier_threshold + ) diff --git a/src/simod/runtime_meter.py b/src/simod/runtime_meter.py index bb4d38fb..b418e9a1 100644 --- a/src/simod/runtime_meter.py +++ b/src/simod/runtime_meter.py @@ -12,6 +12,7 @@ class RuntimeMeter: PREPROCESSING: str = "preprocessing" INITIAL_MODEL: str = "discover-initial-BPS-model" CONTROL_FLOW_MODEL: str = "optimize-control-flow-model" + CASE_ARRIVAL_MODEL: str = "case-arrival-model" RESOURCE_MODEL: str = "optimize-resource-model" DATA_ATTRIBUTES_MODEL: str = "discover-data-attributes" EXTRANEOUS_DELAYS: str = "discover-extraneous-delays" diff --git a/src/simod/settings/case_arrival_settings.py b/src/simod/settings/case_arrival_settings.py new file mode 100644 index 00000000..55efda47 --- /dev/null +++ b/src/simod/settings/case_arrival_settings.py @@ -0,0 +1,108 @@ +from enum import Enum +from typing import List, Optional, Tuple, Union + +from pix_framework.discovery.gateway_probabilities import GatewayProbabilitiesDiscoveryMethod +from pydantic import BaseModel + +from .common_settings import Metric +from ..utilities import parse_single_value_or_interval + + +class CaseArrivalSettings(BaseModel): + """ + Case arrival model configuration parameters. + + This class defines the ranges of the configurable parameters for optimizing the case arrival + model of a discovered BPS model, including the metric to assess the quality of each iteration, + iteration settings, and the threshold parameter to discard outlier observations. In each + iteration of the optimization process, the parameters are sampled from these values or ranges. + + Attributes + ---------- + optimization_metric : :class:`~simod.settings.common_settings.Metric` + The metric used to evaluate process model quality at each iteration of the optimization process (i.e., + loss function). + num_iterations : int + The number of optimization iterations to perform. + num_evaluations_per_iteration : int + The number of replications for the evaluations of each iteration. + outlier_threshold : Union[float, Tuple[float, float]], optional + Fixed value or range for the threshold used to filter outliers. + use_observed_arrival_distribution : bool + Boolean indicating whether to use the distribution of observed case arrival times (true), or to discover a + probability distribution function to model them (false). + """ + + optimization_metric: Metric = Metric.ARRIVAL_EMD + num_iterations: int = 5 + num_evaluations_per_iteration: int = 3 + outlier_threshold: Optional[Union[float, Tuple[float, float]]] = (5.0, 50.0) + use_observed_arrival_distribution: bool = False + + @staticmethod + def one_shot() -> "CaseArrivalSettings": + """ + Instantiates the case arrival model configuration for the one-shot mode (i.e., no optimization, one single + iteration). + + Returns + ------- + :class:`CaseArrivalSettings` + Instance of the case arrival model configuration for the one-shot mode. + """ + return CaseArrivalSettings( + optimization_metric=Metric.THREE_GRAM_DISTANCE, + num_iterations=1, + num_evaluations_per_iteration=1, + outlier_threshold=20.0, + use_observed_arrival_distribution=False, + ) + + @staticmethod + def from_dict(config: dict) -> "CaseArrivalSettings": + """ + Instantiates the case arrival model configuration from a dictionary. + + Parameters + ---------- + config : dict + Dictionary with the configuration values for the case arrival model parameters. + + Returns + ------- + :class:`CaseArrivalSettings` + Instance of the case arrival model configuration for the specified dictionary values. + """ + optimization_metric = Metric.from_str(config.get("optimization_metric", "arrival_event_distribution")) + num_iterations = config.get("num_iterations", 5) + num_evaluations_per_iteration = config.get("num_evaluations_per_iteration", 3) + + outlier_threshold = parse_single_value_or_interval(config.get("outlier_threshold", (5.0, 50.0))) + use_observed_arrival_distribution = config.get("use_observed_arrival_distribution", False) + + return CaseArrivalSettings( + optimization_metric=optimization_metric, + num_iterations=num_iterations, + num_evaluations_per_iteration=num_evaluations_per_iteration, + outlier_threshold=outlier_threshold, + use_observed_arrival_distribution=use_observed_arrival_distribution, + ) + + def to_dict(self) -> dict: + """ + Translate the control-flow model configuration stored in this instance into a dictionary. + + Returns + ------- + dict + Python dictionary storing this configuration. + """ + dictionary = { + "optimization_metric": self.optimization_metric.value, + "num_iterations": self.num_iterations, + "num_evaluations_per_iteration": self.num_evaluations_per_iteration, + "outlier_threshold": self.outlier_threshold, + "use_observed_arrival_distribution": self.use_observed_arrival_distribution + } + + return dictionary diff --git a/src/simod/settings/common_settings.py b/src/simod/settings/common_settings.py index 484f21b2..69620616 100644 --- a/src/simod/settings/common_settings.py +++ b/src/simod/settings/common_settings.py @@ -149,9 +149,6 @@ class CommonSettings(BaseModel): Number of replications of the final evaluation to perform. evaluation_metrics : list List of :class:`Metric` evaluation metrics to use in the final evaluation. - use_observed_arrival_distribution : bool - Boolean indicating whether to use the distribution of observed case arrival times (true), or to discover a - probability distribution function to model them (false). clean_intermediate_files : bool Boolean indicating whether to delete all intermediate created files. discover_data_attributes : bool @@ -168,7 +165,6 @@ class CommonSettings(BaseModel): num_final_evaluations: int = 10 evaluation_metrics: List[Metric] = field(default_factory=list) # Common config - use_observed_arrival_distribution: bool = False clean_intermediate_files: bool = True discover_data_attributes: bool = False @@ -254,7 +250,6 @@ def from_dict(config: dict, config_dir: Optional[Path] = None) -> "CommonSetting ) num_final_evaluations = 10 - use_observed_arrival_distribution = config.get("use_observed_arrival_distribution", False) clean_up = config.get("clean_intermediate_files", True) discover_data_attributes = config.get("discover_data_attributes", False) @@ -266,7 +261,6 @@ def from_dict(config: dict, config_dir: Optional[Path] = None) -> "CommonSetting perform_final_evaluation=perform_final_evaluation, num_final_evaluations=num_final_evaluations, evaluation_metrics=metrics, - use_observed_arrival_distribution=use_observed_arrival_distribution, clean_intermediate_files=clean_up, discover_data_attributes=discover_data_attributes, ) @@ -287,7 +281,6 @@ def to_dict(self) -> dict: "process_model_path": str(self.process_model_path) if self.process_model_path is not None else None, "num_final_evaluations": self.num_final_evaluations, "evaluation_metrics": [str(metric) for metric in self.evaluation_metrics], - "use_observed_arrival_distribution": self.use_observed_arrival_distribution, "clean_intermediate_files": self.clean_intermediate_files, "discover_data_attributes": self.discover_data_attributes, } diff --git a/src/simod/settings/simod_settings.py b/src/simod/settings/simod_settings.py index bb7b531e..0727b919 100644 --- a/src/simod/settings/simod_settings.py +++ b/src/simod/settings/simod_settings.py @@ -5,6 +5,7 @@ import yaml from pydantic import BaseModel +from .case_arrival_settings import CaseArrivalSettings from .common_settings import CommonSettings from .control_flow_settings import ControlFlowSettings from .extraneous_delays_settings import ExtraneousDelaysSettings @@ -18,8 +19,8 @@ class SimodSettings(BaseModel): """ - SIMOD configuration v5 with the settings for all the stages and optimizations. - If configuration is provided in v2 or v4, it is automatically translated to v5. + SIMOD configuration v5.2 with the settings for all the stages and optimizations. + If configuration is provided in v2, v4, or v5 it is automatically translated to v5.2. Attributes ---------- @@ -34,16 +35,17 @@ class SimodSettings(BaseModel): extraneous_activity_delays : :class:`~simod.settings.extraneous_delays_settings.ExtraneousDelaysSettings` Configuration parameters for the extraneous delays model discovery stage. If not provided, the extraneous delays are not discovered. - version : int + version : float SIMOD version. """ common: CommonSettings = CommonSettings() preprocessing: PreprocessingSettings = PreprocessingSettings() + case_arrival: CaseArrivalSettings = CaseArrivalSettings() control_flow: ControlFlowSettings = ControlFlowSettings() resource_model: ResourceModelSettings = ResourceModelSettings() extraneous_activity_delays: Union[ExtraneousDelaysSettings, None] = None - version: int = 5 + version: float = 5.2 @staticmethod def default() -> "SimodSettings": @@ -59,6 +61,7 @@ def default() -> "SimodSettings": return SimodSettings( common=CommonSettings(), preprocessing=PreprocessingSettings(), + case_arrival=CaseArrivalSettings(), control_flow=ControlFlowSettings(), resource_model=ResourceModelSettings(), extraneous_activity_delays=ExtraneousDelaysSettings(), @@ -78,6 +81,7 @@ def one_shot() -> "SimodSettings": return SimodSettings( common=CommonSettings(), preprocessing=PreprocessingSettings(), + case_arrival=CaseArrivalSettings.one_shot(), control_flow=ControlFlowSettings.one_shot(), resource_model=ResourceModelSettings.one_shot(), extraneous_activity_delays=ExtraneousDelaysSettings(), @@ -101,13 +105,15 @@ def from_yaml(config: dict, config_dir: Optional[Path] = None) -> "SimodSettings :class:`SimodSettings` Instance of the SIMOD configuration for the specified dictionary values. """ - assert config["version"] in [2, 4, 5], "Configuration version must be 2, 4, or 5" + assert config["version"] in [2, 4, 5, 5.2], "Configuration version must be 2, 4, 5, or 5.2" # Transform from previous version to the latest if needed if config["version"] == 2: config = _parse_legacy_config_2(config) elif config["version"] == 4: config = _parse_legacy_config_4(config) + elif config["version"] == 5: + config = _parse_legacy_config_5(config) # Get each of the settings components if present, default otherwise if "common" in config: @@ -119,6 +125,11 @@ def from_yaml(config: dict, config_dir: Optional[Path] = None) -> "SimodSettings preprocessing_settings = PreprocessingSettings.from_dict(config["preprocessing"]) else: preprocessing_settings = PreprocessingSettings() + if "case_arrival" in config: + case_arrival_settings = CaseArrivalSettings.from_dict(config["case_arrival"]) + else: + print_notice("No 'case_arrival' settings provided, running Simod with default values.") + case_arrival_settings = CaseArrivalSettings() if "control_flow" in config: control_flow_settings = ControlFlowSettings.from_dict(config["control_flow"]) else: @@ -147,6 +158,7 @@ def from_yaml(config: dict, config_dir: Optional[Path] = None) -> "SimodSettings version=config["version"], common=common_settings, preprocessing=preprocessing_settings, + case_arrival=case_arrival_settings, control_flow=control_flow_settings, resource_model=resource_model_settings, extraneous_activity_delays=extraneous_delays_settings, @@ -184,6 +196,7 @@ def to_dict(self) -> dict: "version": self.version, "common": self.common.to_dict(), "preprocessing": self.preprocessing.to_dict(), + "case_arrival": self.case_arrival.to_dict(), "control_flow": self.control_flow.to_dict(), "resource_model": self.resource_model.to_dict(), } @@ -215,8 +228,8 @@ def to_yaml(self, output_dir: Path) -> Path: def _parse_legacy_config_2(config: dict) -> dict: parsed_config = copy.deepcopy(config) if config["version"] == 2: - # Transform dictionary from version 2 to 5 - parsed_config["version"] = 5 + # Transform dictionary from version 2 to 5.2 + parsed_config["version"] = 5.2 # Common elements if "log_path" in parsed_config["common"]: parsed_config["common"]["train_log_path"] = parsed_config["common"]["log_path"] @@ -255,11 +268,28 @@ def _parse_legacy_config_2(config: dict) -> dict: def _parse_legacy_config_4(config: dict) -> dict: parsed_config = copy.deepcopy(config) if config["version"] == 4: - # Transform dictionary from version 4 to 5 + # Transform dictionary from version 4 to 5.2 parsed_config["version"] = 5 # Common elements if "discover_case_attributes" in parsed_config["common"]: parsed_config["common"]["discover_data_attributes"] = parsed_config["common"]["discover_case_attributes"] del parsed_config["common"]["discover_case_attributes"] + # Transform from v5 to v5.2 + parsed_config = _parse_legacy_config_5(parsed_config) + # Return parsed configuration + return parsed_config + + +def _parse_legacy_config_5(config: dict) -> dict: + parsed_config = copy.deepcopy(config) + if config["version"] == 5: + # Transform dictionary from version 5 to 5.2 + parsed_config["version"] = 5.2 + # Common elements + if "use_observed_arrival_distribution" in parsed_config["common"]: + parsed_config["case_arrival"] = { + "use_observed_arrival_distribution": parsed_config["common"]["use_observed_arrival_distribution"] + } + del parsed_config["common"]["use_observed_arrival_distribution"] # Return parsed configuration return parsed_config diff --git a/src/simod/simod.py b/src/simod/simod.py index 5e5992f9..deec79aa 100644 --- a/src/simod/simod.py +++ b/src/simod/simod.py @@ -16,6 +16,8 @@ from simod.batching.discovery import discover_batching_rules from simod.branch_rules.discovery import discover_branch_rules, map_branch_rules_to_flows +from simod.case_arrival.optimizer import CaseArrivalOptimizer +from simod.case_arrival.settings import HyperoptIterationParams as CaseArrivalHyperoptIterationParams from simod.cli_formatter import print_section, print_subsection from simod.control_flow.discovery import discover_process_model, add_bpmn_diagram_to_model from simod.control_flow.optimizer import ControlFlowOptimizer @@ -66,6 +68,8 @@ class Simod: # Optimizer for the Control-Flow and Gateway Probabilities _control_flow_optimizer: Optional[ControlFlowOptimizer] + # Optimizer for the Case Arrival Model + _case_arrival_optimizer: Optional[CaseArrivalOptimizer] # Optimizer for the Resource Model _resource_model_optimizer: Optional[ResourceModelOptimizer] # Optimizer for the Extraneous Delay Timers @@ -89,6 +93,10 @@ def __init__( create_folder(self._control_flow_dir) self._resource_model_dir = self._output_dir / "resource_model" create_folder(self._resource_model_dir) + self._discover_inter_arrival_times = not self._settings.case_arrival.use_observed_arrival_distribution + if self._discover_inter_arrival_times: + self._case_arrival_dir = self._output_dir / "case_arrival" + create_folder(self._case_arrival_dir) if self._settings.extraneous_activity_delays is not None: self._extraneous_delays_dir = self._output_dir / "extraneous-delay-timers" create_folder(self._extraneous_delays_dir) @@ -134,9 +142,9 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): print_section("Discovering initial BPS Model") runtimes.start(RuntimeMeter.INITIAL_MODEL) self._best_bps_model.case_arrival_model = discover_case_arrival_model( - self._event_log.train_validation_partition, # No optimization process here, use train + validation + self._event_log.train_partition, self._event_log.log_ids, - use_observed_arrival_distribution=self._settings.common.use_observed_arrival_distribution, + use_observed_arrival_distribution=self._settings.case_arrival.use_observed_arrival_distribution, ) calendar_discovery_parameters = CalendarDiscoveryParameters() self._best_bps_model.resource_model = discover_resource_model( @@ -177,6 +185,14 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): self._best_bps_model.event_attributes = event_attributes runtimes.stop(RuntimeMeter.DATA_ATTRIBUTES_MODEL) + # --- Case Arrival Optimization --- # + if self._discover_inter_arrival_times: + print_section("Optimizing case arrival parameters") + runtimes.start(RuntimeMeter.CASE_ARRIVAL_MODEL) + best_case_arrival_params = self._optimize_case_arrival() + self._best_bps_model.case_arrival_model = self._case_arrival_optimizer.best_bps_model.case_arrival_model + runtimes.stop(RuntimeMeter.CASE_ARRIVAL_MODEL) + # --- Resource Model Discovery --- # print_section("Optimizing resource model parameters") runtimes.start(RuntimeMeter.RESOURCE_MODEL) @@ -201,7 +217,6 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): runtimes.start(RuntimeMeter.FINAL_MODEL) self.final_bps_model = BPSModel( # Bypass all models already discovered with train+validation process_model=get_process_model_path(self._best_result_dir, self._event_log.process_name), - case_arrival_model=self._best_bps_model.case_arrival_model, case_attributes=self._best_bps_model.case_attributes, global_attributes=self._best_bps_model.global_attributes, event_attributes=self._best_bps_model.event_attributes, @@ -248,6 +263,19 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): ) self.final_bps_model.gateway_probabilities = \ map_branch_rules_to_flows(self.final_bps_model.gateway_probabilities, self.final_bps_model.branch_rules) + # Case arrival model + if self._discover_inter_arrival_times: + self.final_bps_model.case_arrival_model = discover_case_arrival_model( + self._event_log.train_validation_partition, + self._event_log.log_ids, + outlier_threshold=best_case_arrival_params.outlier_threshold, + ) + else: + self.final_bps_model.case_arrival_model = discover_case_arrival_model( + self._event_log.train_validation_partition, + self._event_log.log_ids, + use_observed_arrival_distribution=True, + ) # Resource model print_subsection("Discovering best resource model") self.final_bps_model.resource_model = discover_resource_model( @@ -275,7 +303,8 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): if best_resource_model_params.discover_batching_rules: print_subsection("Discovering batching rules") self.final_bps_model.batching_rules = discover_batching_rules( - self._event_log.train_validation_partition, self._event_log.log_ids + self._event_log.train_validation_partition, + self._event_log.log_ids, ) # Extraneous delays if self._best_bps_model.extraneous_delays is not None: @@ -303,7 +332,12 @@ def run(self, runtimes: Optional[RuntimeMeter] = None): # --- Export settings and clean temporal files --- # print_section(f"Exporting canonical model, runtimes, settings and cleaning up intermediate files") canonical_model_path = self._best_result_dir / "canonical_model.json" - _export_canonical_model(canonical_model_path, best_control_flow_params, best_resource_model_params) + _export_canonical_model( + file_path=canonical_model_path, + case_arrival_settings=best_case_arrival_params if self._discover_inter_arrival_times else None, + control_flow_settings=best_control_flow_params, + resource_model_settings=best_resource_model_params, + ) runtimes_model_path = self._best_result_dir / "runtimes.json" _export_runtimes(runtimes_model_path, runtimes) if self._settings.common.clean_intermediate_files: @@ -324,10 +358,32 @@ def _optimize_control_flow(self) -> ControlFlowHyperoptIterationParams: base_directory=self._control_flow_dir, ) best_control_flow_params = self._control_flow_optimizer.run() + shutil.copy( + self._control_flow_dir / "evaluation_measures.csv", + self._best_result_dir / "control_flow_iterations_measures.csv" + ) return best_control_flow_params + def _optimize_case_arrival(self) -> CaseArrivalHyperoptIterationParams: + """ + Case Arrival (inter-arrival distribution) discovery. + """ + self._case_arrival_optimizer = CaseArrivalOptimizer( + event_log=self._event_log, + bps_model=self._best_bps_model, + settings=self._settings.case_arrival, + base_directory=self._case_arrival_dir, + ) + best_case_arrival_params = self._case_arrival_optimizer.run() + shutil.copy( + self._case_arrival_dir / "evaluation_measures.csv", + self._best_result_dir / "arrival_model_iterations_measures.csv" + ) + return best_case_arrival_params + def _optimize_resource_model( - self, model_activities: Optional[list[str]] = None + self, + model_activities: Optional[list[str]] = None, ) -> ResourceModelHyperoptIterationParams: """ Resource Model (resource profiles, calendars an activity performances) discovery. @@ -340,6 +396,10 @@ def _optimize_resource_model( model_activities=model_activities, ) best_resource_model_params = self._resource_model_optimizer.run() + shutil.copy( + self._resource_model_dir / "evaluation_measures.csv", + self._best_result_dir / "resource_model_iterations_measures.csv" + ) return best_resource_model_params def _optimize_extraneous_activity_delays(self) -> List[ExtraneousDelay]: @@ -385,6 +445,8 @@ def _clean_up(self): print_section("Removing intermediate files") self._control_flow_optimizer.cleanup() self._resource_model_optimizer.cleanup() + if self._discover_inter_arrival_times: + self._case_arrival_optimizer.cleanup() if self._settings.extraneous_activity_delays is not None: self._extraneous_delays_optimizer.cleanup() if self._settings.common.process_model_path is None: @@ -394,13 +456,18 @@ def _clean_up(self): def _export_canonical_model( file_path: Path, + case_arrival_settings: Optional[CaseArrivalHyperoptIterationParams], control_flow_settings: ControlFlowHyperoptIterationParams, - calendar_settings: ResourceModelHyperoptIterationParams, + resource_model_settings: ResourceModelHyperoptIterationParams, ): + # Create dict with best params of each HyperOpt step canon = { "control_flow": control_flow_settings.to_dict(), - "calendars": calendar_settings.to_dict(), + "resource_model": resource_model_settings.to_dict(), } + if case_arrival_settings is not None: + canon["case_arrival"] = case_arrival_settings.to_dict() + # Export to file with open(file_path, "w") as f: json.dump(canon, f) diff --git a/tests/assets/bpic15/bpic15_1_with_model_v4.yml b/tests/assets/bpic15/bpic15_1_with_model_v4.yml index 0068bcd4..3a95c25c 100644 --- a/tests/assets/bpic15/bpic15_1_with_model_v4.yml +++ b/tests/assets/bpic15/bpic15_1_with_model_v4.yml @@ -1,16 +1,8 @@ -version: 4 +version: 5.2 common: train_log_path: BPIC15_1.csv.gz process_model_path: BPIC15_1.bpmn - num_final_evaluations: 1 # Number of evaluations of the discovered BPS model. - evaluation_metrics: # Metrics to evaluate the discovered BPS model with. - - 3_gram_distance - - 2_gram_distance - - absolute_event_distribution - - relative_event_distribution - - circadian_event_distribution - - arrival_event_distribution - - cycle_time_distribution + num_final_evaluations: 1 clean_intermediate_files: false log_ids: case: case:concept:name @@ -20,48 +12,20 @@ common: end_time: time:timestamp enabled_time: enabled_time preprocessing: - multitasking: false # Reassign activity durations when happening in multitasking. - enable_time_concurrency_threshold: 0.5 # Concurrency threshold for the enabled time computation. - concurrency_df: 0.75 # Concurrency thresholds for the start time (and enabled time) estimations when - concurrency_l2l: 0.9 # the start time is missing in the train event log. Using the Heuristics Miner - concurrency_l1l: 0.9 # concurrency oracle. + multitasking: false + enable_time_concurrency_threshold: 0.5 + concurrency_df: 0.75 + concurrency_l2l: 0.9 + concurrency_l1l: 0.9 +case_arrival: + num_iterations: 1 + num_evaluations_per_iteration: 3 control_flow: - optimization_metric: n_gram_distance - num_iterations: 1 # Number of iterations to run the hyper-optimization process for control-flow discovery - num_evaluations_per_iteration: 5 # Number of times to evaluate each iteration (using the mean of all of them) - gateway_probabilities: # Methods to discover the probabilities of each gateway - - equiprobable - - discovery - discovery_algorithm: sm1 # Process model discovery algorithm: sm1 (Split Miner v1) or sm2 (Split Miner v2) - epsilon: - - 0.0 - - 1.0 - eta: - - 0.0 - - 1.0 - replace_or_joins: - - true - - false - prioritize_parallelism: - - true - - false + num_iterations: 1 + num_evaluations_per_iteration: 3 resource_model: - optimization_metric: circadian_event_distribution - num_iterations: 1 # Number of iterations to run the hyper-optimization process for control-flow discovery - num_evaluations_per_iteration: 5 # Number of times to evaluate each iteration (using the mean of all of them) - resource_profiles: - discovery_type: differentiated # Resource discovery type ('undifferentiated', 'pool', or 'differentiated') - granularity: - - 15 - - 60 - confidence: - - 0.5 - - 0.85 - support: - - 0.01 - - 0.3 - participation: 0.4 + num_iterations: 1 + num_evaluations_per_iteration: 3 extraneous_activity_delays: - optimization_metric: relative_event_distribution - num_iterations: 1 # Number of iterations of the optimization process (if 1, direct discovery without optimization) - num_evaluations_per_iteration: 3 # Number of times to evaluate each iteration (using the mean of all of them) + num_iterations: 1 + num_evaluations_per_iteration: 3 diff --git a/tests/assets/configuration_simod_basic.yml b/tests/assets/configuration_simod_basic.yml index ceb269c6..30e5b55f 100644 --- a/tests/assets/configuration_simod_basic.yml +++ b/tests/assets/configuration_simod_basic.yml @@ -1,9 +1,10 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz test_log_path: LoanApp_simplified.csv.gz num_final_evaluations: 1 discover_data_attributes: true + clean_intermediate_files: false evaluation_metrics: - absolute_hourly_emd log_ids: diff --git a/tests/assets/configuration_simod_with_extraneous.yml b/tests/assets/configuration_simod_with_extraneous.yml index 835da3b0..18ee1944 100644 --- a/tests/assets/configuration_simod_with_extraneous.yml +++ b/tests/assets/configuration_simod_with_extraneous.yml @@ -1,7 +1,8 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz discover_data_attributes: true + clean_intermediate_files: false log_ids: case: case:concept:name activity: concept:name diff --git a/tests/assets/configuration_simod_with_model.yml b/tests/assets/configuration_simod_with_model.yml index bd205710..17fccbd9 100644 --- a/tests/assets/configuration_simod_with_model.yml +++ b/tests/assets/configuration_simod_with_model.yml @@ -1,8 +1,9 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz process_model_path: LoanApp_simplified.bpmn discover_data_attributes: true + clean_intermediate_files: false perform_final_evaluation: true num_final_evaluations: 1 evaluation_metrics: diff --git a/tests/assets/configuration_simod_with_model_and_batching.yml b/tests/assets/configuration_simod_with_model_and_batching.yml index 70eed272..f7c7a353 100644 --- a/tests/assets/configuration_simod_with_model_and_batching.yml +++ b/tests/assets/configuration_simod_with_model_and_batching.yml @@ -1,4 +1,4 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz test_log_path: LoanApp_simplified.csv.gz diff --git a/tests/assets/configuration_simod_with_model_and_extraneous.yml b/tests/assets/configuration_simod_with_model_and_extraneous.yml index e6a43cd8..6a315f51 100644 --- a/tests/assets/configuration_simod_with_model_and_extraneous.yml +++ b/tests/assets/configuration_simod_with_model_and_extraneous.yml @@ -1,8 +1,9 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz process_model_path: LoanApp_simplified.bpmn discover_data_attributes: true + clean_intermediate_files: false num_final_evaluations: 1 evaluation_metrics: - absolute_hourly_emd diff --git a/tests/assets/configuration_simod_with_model_and_prioritization.yml b/tests/assets/configuration_simod_with_model_and_prioritization.yml index cbd84653..8efd373d 100644 --- a/tests/assets/configuration_simod_with_model_and_prioritization.yml +++ b/tests/assets/configuration_simod_with_model_and_prioritization.yml @@ -1,4 +1,4 @@ -version: 5 +version: 5.2 common: train_log_path: LoanApp_simplified.csv.gz test_log_path: LoanApp_simplified.csv.gz diff --git a/tests/assets/configuration_simod_with_observed_arrivals.yml b/tests/assets/configuration_simod_with_observed_arrivals.yml new file mode 100644 index 00000000..46e75dc3 --- /dev/null +++ b/tests/assets/configuration_simod_with_observed_arrivals.yml @@ -0,0 +1,50 @@ +version: 5.2 +common: + train_log_path: LoanApp_simplified.csv.gz + discover_data_attributes: true + clean_intermediate_files: false + log_ids: + case: case:concept:name + activity: concept:name + resource: org:resource + start_time: start_timestamp + end_time: time:timestamp + enabled_time: enabled_time +preprocessing: + multitasking: false +case_arrival: + use_observed_arrival_distribution: true +control_flow: + optimization_metric: n_gram_distance + num_iterations: 3 + num_evaluations_per_iteration: 3 + discovery_algorithm: sm1 + epsilon: + - 0.0 + - 1.0 + eta: + - 0.0 + - 1.0 + replace_or_joins: + - true + - false + prioritize_parallelism: + - true + - false + gateway_probabilities: + - discovery + - equiprobable +resource_model: + optimization_metric: absolute_hourly_emd + num_iterations: 3 + num_evaluations_per_iteration: 3 + resource_profiles: + discovery_type: pool + granularity: 60 + confidence: + - 0.5 + - 0.85 + support: + - 0.01 + - 0.3 + participation: 0.4 diff --git a/tests/test_bpic15.py b/tests/test_bpic15.py index 48dda69d..1877461b 100644 --- a/tests/test_bpic15.py +++ b/tests/test_bpic15.py @@ -16,4 +16,11 @@ def test_bpic15(entry_point): optimizer = Simod(settings, event_log=event_log) optimizer.run() + assert optimizer.final_bps_model.case_arrival_model is not None + assert optimizer.final_bps_model.process_model is not None + assert optimizer.final_bps_model.gateway_probabilities is not None assert optimizer.final_bps_model.resource_model is not None + assert optimizer.final_bps_model.extraneous_delays is not None + assert optimizer._control_flow_dir.exists() and any(optimizer._control_flow_dir.iterdir()) # not empty + assert optimizer._resource_model_dir.exists() and any(optimizer._resource_model_dir.iterdir()) # not empty + assert optimizer._case_arrival_dir.exists() and any(optimizer._case_arrival_dir.iterdir()) # not empty diff --git a/tests/test_settings/test_simod_settings.py b/tests/test_settings/test_simod_settings.py index 2af91f68..ed267ae1 100644 --- a/tests/test_settings/test_simod_settings.py +++ b/tests/test_settings/test_simod_settings.py @@ -2,8 +2,61 @@ import yaml +from simod.settings.case_arrival_settings import CaseArrivalSettings from simod.settings.simod_settings import SimodSettings +settings_5_2 = """ +version: 5.2 +common: + train_log_path: assets/LoanApp_simplified.csv.gz + perform_final_evaluation: true + num_final_evaluations: 1 + evaluation_metrics: + - dl + - absolute_event_distribution + discover_data_attributes: true +preprocessing: + multitasking: false +case_arrival: + num_iterations: 2 + optimization_metric: arrival_event_distribution + num_evaluations_per_iteration: 4 + outlier_threshold: + - 5.0 + - 50.0 +control_flow: + num_iterations: 2 + mining_algorithm: sm1 + epsilon: + - 0.0 + - 1.0 + eta: + - 0.0 + - 1.0 + gateway_probabilities: + - equiprobable + - discovery + replace_or_joins: + - true + - false + prioritize_parallelism: + - true + - false +resource_model: + num_iterations: 2 + discover_prioritization_rules: true + resource_profiles: + discovery_type: differentiated_by_pool + granularity: 60 + confidence: + - 0.5 + - 0.85 + support: + - 0.01 + - 0.3 + participation: 0.4 +""" + settings_5 = """ version: 5 common: @@ -14,6 +67,7 @@ - dl - absolute_event_distribution discover_data_attributes: true + use_observed_arrival_distribution: true preprocessing: multitasking: false control_flow: @@ -95,8 +149,8 @@ """ -def test_configuration(): - config = yaml.safe_load(settings_5) +def test_latest_configuration(): + config = yaml.safe_load(settings_5_2) result = SimodSettings.from_yaml(config) assert result is not None @@ -106,11 +160,24 @@ def test_configuration(): assert_resource_model(config, result) -def test_configuration_legacy(): - ground_truth = SimodSettings.from_yaml(yaml.safe_load(settings_5)) +def test_configuration_legacy_5(): + ground_truth = SimodSettings.from_yaml(yaml.safe_load(settings_5_2)) + legacy = SimodSettings.from_yaml(yaml.safe_load(settings_5)) + + assert legacy is not None + assert legacy.case_arrival.use_observed_arrival_distribution + legacy.case_arrival = ground_truth.case_arrival # Override different case_arrival component to compare the rest + assert ground_truth.to_dict() == legacy.to_dict() + + +def test_configuration_legacy_4(): + ground_truth = SimodSettings.from_yaml(yaml.safe_load(settings_5_2)) legacy = SimodSettings.from_yaml(yaml.safe_load(settings_4)) assert legacy is not None + assert not legacy.case_arrival.use_observed_arrival_distribution + assert legacy.case_arrival.to_dict() == CaseArrivalSettings().to_dict() # Assert case arrival model is default + legacy.case_arrival = ground_truth.case_arrival # Override different case_arrival component to compare the rest assert ground_truth.to_dict() == legacy.to_dict() diff --git a/tests/test_simod.py b/tests/test_simod.py index f0a19acf..e2930342 100644 --- a/tests/test_simod.py +++ b/tests/test_simod.py @@ -17,14 +17,25 @@ { "name": "Simod basic", "config_file": "configuration_simod_basic.yml", + "observed_arrivals": False, "expect_extraneous": False, "expect_batching_rules": False, "expect_prioritization_rules": False, "perform_final_evaluation": True, }, + { + "name": "Simod observed arrivals", + "config_file": "configuration_simod_with_observed_arrivals.yml", + "observed_arrivals": True, + "expect_extraneous": False, + "expect_batching_rules": False, + "expect_prioritization_rules": False, + "perform_final_evaluation": False, + }, { "name": "Simod extraneous", "config_file": "configuration_simod_with_extraneous.yml", + "observed_arrivals": False, "expect_extraneous": True, "expect_batching_rules": False, "expect_prioritization_rules": False, @@ -33,6 +44,7 @@ { "name": "Simod with model", "config_file": "configuration_simod_with_model.yml", + "observed_arrivals": False, "expect_extraneous": False, "expect_batching_rules": False, "expect_prioritization_rules": False, @@ -41,6 +53,7 @@ { "name": "Simod with model & extraneous", "config_file": "configuration_simod_with_model_and_extraneous.yml", + "observed_arrivals": False, "expect_extraneous": True, "expect_batching_rules": False, "expect_prioritization_rules": False, @@ -49,6 +62,7 @@ { "name": "Simod with model & prioritization", "config_file": "configuration_simod_with_model_and_prioritization.yml", + "observed_arrivals": False, "expect_extraneous": False, "expect_batching_rules": False, "expect_prioritization_rules": True, @@ -57,6 +71,7 @@ { "name": "Simod with model & batching", "config_file": "configuration_simod_with_model_and_batching.yml", + "observed_arrivals": False, "expect_extraneous": False, "expect_batching_rules": True, "expect_prioritization_rules": False, @@ -89,13 +104,23 @@ def test_simod(test_data, entry_point): assert optimizer.final_bps_model.process_model is not None assert optimizer.final_bps_model.resource_model is not None assert optimizer.final_bps_model.case_arrival_model is not None + case_arrival_model = optimizer.final_bps_model.case_arrival_model assert optimizer.final_bps_model.case_attributes is not None assert len(optimizer.final_bps_model.case_attributes) > 0 + if test_data["observed_arrivals"]: + assert case_arrival_model.inter_arrival_times["distribution_name"] == "histogram_sampling" + assert not (optimizer._output_dir / "case_arrival").exists() + else: + assert case_arrival_model.inter_arrival_times["distribution_name"] != "histogram_sampling" + assert (optimizer._output_dir / "case_arrival").exists() # Created folder for arrival optimization + assert len(os.listdir(optimizer._output_dir / "case_arrival")) > 0 # Folder not empty if test_data["expect_extraneous"]: assert optimizer.final_bps_model.extraneous_delays is not None assert len(optimizer.final_bps_model.extraneous_delays) == 2 + assert (optimizer._output_dir / "extraneous-delay-timers").exists() # Created folder for arrival optimization else: assert optimizer.final_bps_model.extraneous_delays is None + assert not (optimizer._output_dir / "extraneous-delay-timers").exists() if test_data["expect_batching_rules"]: # Check if any of the iterations has batching rules batching_found = _search_element_in_resource_model_iterations(optimizer._output_dir, BATCHING_RULES_KEY)