Skip to content
This repository was archived by the owner on Aug 29, 2022. It is now read-only.
This repository was archived by the owner on Aug 29, 2022. It is now read-only.

A question about class PathBuilder #2

@HPDell

Description

@HPDell

This is the getPathsBetweenCollections function of class PathBuilder:

def getPathsBetweenCollections(self, sc1, sc2):
    trans1 = []
    trans2 = []
    paths = []
    n1 = len(sc1.states)
    n2 = len(sc2.states)
    num_paths = 0
    for i1 in range(n1):
        for i2 in range(n2):
            ps = self.getPaths(sc1.states[i1], sc2.states[i2])
            for path in ps:
                trans1.append((i1, num_paths))
                trans2.append((num_paths, i2))
                paths.append(path)
                num_paths += 1
    return (trans1, paths, trans2)

Why the variable num_paths don't need to be set to 0 when variable ps is changed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions