예제 #1
0
def step_3(woflan_object, return_asap_when_unsound=False):
    woflan_object.set_place_invariants(
        compute_place_invariants(woflan_object.get_s_c_net()))
    woflan_object.set_uniform_place_invariants(
        transform_basis(woflan_object.get_place_invariants(), style='uniform'))
    woflan_object.set_s_components(
        compute_s_components(woflan_object.get_s_c_net(),
                             woflan_object.get_uniform_place_invariants()))
    woflan_object.set_uncovered_places_s_component(
        compute_uncovered_places_in_component(woflan_object.get_s_components(),
                                              woflan_object.get_s_c_net()))
    if len(woflan_object.get_uncovered_places_s_component()) == 0:
        woflan_object.set_left(True)
        if woflan_object.print_diagnostics:
            print('Every place is covered by s-components.')
        return step_10(woflan_object,
                       return_asap_when_unsound=return_asap_when_unsound)
    else:
        if woflan_object.print_diagnostics:
            print(
                'The following places are not covered by an s-component: {}.'.
                format(woflan_object.get_uncovered_places_s_component()))
        if return_asap_when_unsound:
            return False
        return step_4(woflan_object,
                      return_asap_when_unsound=return_asap_when_unsound)
예제 #2
0
def step_6(woflan_object, return_asap_when_unsound=False):
    woflan_object.set_weighted_place_invariants(
        transform_basis(woflan_object.get_place_invariants(),
                        style='weighted'))
    woflan_object.set_uncovered_places_weighted(
        compute_uncovered_place_in_invariants(
            woflan_object.get_weighted_place_invariants(),
            woflan_object.get_s_c_net()))
    if len(woflan_object.get_uncovered_places_weighted()) == 0:
        if woflan_object.print_diagnostics:
            print('There are no uncovered places in weighted invariants.')
        return step_10(woflan_object,
                       return_asap_when_unsound=return_asap_when_unsound)
    else:
        if woflan_object.print_diagnostics:
            print(
                'The following places are uncovered in weighted invariants: {}'
                .format(woflan_object.get_uncovered_places_weighted()))
        return step_7(woflan_object,
                      return_asap_when_unsound=return_asap_when_unsound)
예제 #3
0
def apply(net):
    place_invariants = compute_place_invariants(net)
    modified_invariants = transform_basis(place_invariants, style='uniform')
    return modified_invariants