Skip to content

Commit

Permalink
chore: tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Jul 17, 2019
1 parent 638d759 commit de95c1b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pert_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,24 @@ func FromPertConfig(config PertConfig) *Graph {
}
}

for _, vertex := range graph.Vertices() {
if vertex.Attrs.GetTitle() == "" {
vertex.Attrs.SetTitle(vertex.id)
}
}
if !config.Opts.NoSimplify { // simplify the graph
verticesToDelete := map[string]bool{} // creating a map so we can iterate over vertices while deleting some entries
for _, vertex := range graph.Vertices() {
if _, found := verticesToDelete[vertex.id]; found {
continue
}
if pertIsUntitledState(vertex) {
if pertIsUntitledState(vertex) || true {
if vertex.OutDegree() == 1 { // remove dummy states with only one dummy successor
log.Println(vertex)
successor := vertex.SuccessorEdges()[0]
if pertIsZeroTimeActivity(successor) {
for _, predecessor := range vertex.PredecessorEdges() {
log.Println(" ", predecessor)
predecessor.dst = successor.dst
}
graph.RemoveEdge(vertex.id, successor.dst.id)
Expand Down

0 comments on commit de95c1b

Please sign in to comment.