Ejemplo n.º 1
0
def main():
    """
    Test Cohen-Sadeh algorithm

    Arguments:
        infile - project file
    """
    # Parse arguments and options
    parser = argparse.ArgumentParser()
    parser.add_argument('infile')
    args = parser.parse_args()

    # Open the input file collecting the required information.
    activities, _, _, _ = fileFormats.load_with_some_format(args.infile, [fileFormats.PPCProjectFileFormat(),
                                                                          fileFormats.PSPProjectFileFormat()])
    successors = dict(((act[1], act[2]) for act in activities))

    gg1 = cohen_sadeh(graph.successors2precedents(successors))
    #subgraph = gg1.focus(787, 875) # Error en Large Tavares

    window = graph.Test()
    window.add_image(graph.pert2image(gg1))
    graph.gtk.main()
    print gg1
    print validation.check_validation(successors, gg1)
    return 0
Ejemplo n.º 2
0
def main():
    """
    Test Mouhoub algorithm

    Arguments:
        infile - project file
    """
    # Parse arguments and options
    parser = argparse.ArgumentParser()
    parser.add_argument('infile')
    args = parser.parse_args()

    # Open the input file collecting the required information.
    activities, _, _, _ = fileFormats.load_with_some_format(args.infile, [fileFormats.PPCProjectFileFormat(),
                                                                          fileFormats.PSPProjectFileFormat()])
    successors = dict(((act[1], act[2]) for act in activities))
    
    pert_graph = mouhoub(graph.successors2precedents(successors))
    
    window = graph.Test()
    window.add_image(graph.pert2image(pert_graph))
    graph.gtk.main()
    print pert_graph
    print validation.check_validation(successors, pert_graph)
    return 0   
Ejemplo n.º 3
0
#    print "gg::::::", gg
    return gg


def built_labels(node, node1, label, label1):
    for n in node:
        label = label + n + "-"
    for n1 in node1:
        label1 = label1 + n1 + "-"
#    l,l1
    label = label[:-1]
    label1 = label1[:-1]


# Test algorithm
if __name__ == "__main__":
    import prueba

    filename = sys.argv[1]
    data = prueba.openProject(filename)
    prueba.check_activities(data)

    result_graph = prueba.test_algorithm(data, algoritmoN)

    # Draw graph on screen
    window = None
    window = graph.Test()
    image1 = graph.pert2image(result_graph)
    window.images.append(image1)
    graph.gtk.main()