pm4py.statistics.ocel.edge_metrics module#

class pm4py.statistics.ocel.edge_metrics.Parameters(*values)[source]#

Bases: Enum

EVENT_ID = 'param:event:id'#
OBJECT_ID = 'param:object:id'#
OBJECT_TYPE = 'param:object:type'#
EVENT_ACTIVITY = 'param:event:activity'#
EVENT_TIMESTAMP = 'param:event:timestamp'#
BUSINESS_HOURS = 'business_hours'#
BUSINESS_HOUR_SLOTS = 'business_hour_slots'#
WORKCALENDAR = 'workcalendar'#
pm4py.statistics.ocel.edge_metrics.performance_calculation_ocel_aggregation(ocel: OCEL, aggregation: Dict[str, Dict[Tuple[str, str], Set[Any]]], parameters: Dict[Any, Any] | None = None) Dict[str, Dict[Tuple[str, str], List[float]]][source]#

Calculates the performance based on one of the following aggregations: - aggregate_ev_couples - aggregate_total_objects

Parameters:
  • ocel – Object-centric event log

  • aggregation – Aggregation calculated using one of the aforementioned methods

  • parameters – Parameters of the algorithm, including: - Parameters.EVENT_ID => the event identifier - Parameters.EVENT_TIMESTAMP => the timestamp - Parameters.BUSINESS_HOURS => enables/disables the business hours - Parameters.BUSINESS_HOURS_SLOTS => work schedule of the company, provided as a list of tuples where each tuple represents one time slot of business hours. One slot i.e. one tuple consists of one start and one end time given in seconds since week start, e.g. [

    (7 * 60 * 60, 17 * 60 * 60), ((24 + 7) * 60 * 60, (24 + 12) * 60 * 60), ((24 + 13) * 60 * 60, (24 + 17) * 60 * 60),

    ] meaning that business hours are Mondays 07:00 - 17:00 and Tuesdays 07:00 - 12:00 and 13:00 - 17:00

Returns:

For each object type, associate a dictionary where to each activity couple all the times between the activities are recorded.

Return type:

edges_performance

pm4py.statistics.ocel.edge_metrics.aggregate_ev_couples(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#

Performs an aggregation of the occurrences of a given edge on the couple of events (source event, target event).

Parameters:

edges – Edges calculated using the find_associations_per_edge function

Returns:

A dictionary associating to each object type another dictionary where to each edge (activity couple) all the couples of related events are associated.

Return type:

aggregation

pm4py.statistics.ocel.edge_metrics.aggregate_unique_objects(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#

Performs an aggregation of the occurrences of a given edge in the involved object.

Parameters:

edges – Edges calculated using the find_associations_per_edge function

Returns:

A dictionary associating to each object type another dictionary where to each edge (activity couple) all the involved objects are associated.

Return type:

aggregation

pm4py.statistics.ocel.edge_metrics.aggregate_total_objects(edges: Dict[str, Dict[Tuple[str, str], Collection[Any]]]) Dict[str, Dict[Tuple[str, str], Set[Any]]][source]#

Performs an aggregation of the occurrences of a given edge on the triple (source event, target event, object).

Parameters:

edges – Edges calculated using the find_associations_per_edge function

Returns:

A dictionary associating to each object type another dictionary where to each edge (activity couple) all the triples (source event, target event, object) are associated.

Return type:

aggregation

pm4py.statistics.ocel.edge_metrics.find_associations_per_edge(ocel: OCEL, parameters: Dict[Any, Any] | None = None) Dict[str, Dict[Tuple[str, str], Collection[Any]]][source]#

Finds all the occurrences of a given edge (activity couple), expressed as triples (source event, target event, object ID).

Parameters:
  • ocel – Object-centric event log

  • parameters – Parameters of the algorithm, including: - Parameters.EVENT_ACTIVITY => the activity - Parameters.EVENT_ID => the event identifier - Parameters.OBJECT_ID => the object identifier - Parameters.OBJECT_TYPE => the object type

Returns:

A dictionary associating to each object type a dictionary where to each edge (activity couple) the list of triples (source event, target event, object ID) is associated.

Return type:

edges