compute_fitness
Compute fitness stats from alignment results
Also constructs the empty-trace alignment (shortest path through model)
Also constructs the empty-trace alignment (shortest path through model)
fn compute_fitness(align_res*: Vec<VariantAlignmentResult>, net*: PetriNet, options: AlignmentOptions) → FitnessResult
Arguments
Returns
import r4pm
align_res = [{"activities": ['example'], "frequency": 1, "result": {"Ok": {"cost": 1, "moves": [{"SyncMove": {"trace_event_index": 1, "transition": 'example'}}], "states_visited": 1}}}]
net = {"arcs": [{"from_to": {"nodes": ['example', 'example'], "type": 'PlaceTransition'}, "weight": 1}], "places": {"something": {"id": '893f8ab9'}}, "transitions": {"something": {"id": '893f8ab9'}}}
# Optional argument: options, can also be omitted
options = {"cost_fn": {"log_move_cost": 1, "model_move_cost": 1, "silent_move_cost": 1, "sync_move_cost": 1}}
res = r4pm.bindings.compute_fitness(align_res, net, options)