forked from AJMBrands/SoftwareThatMatters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
75 lines (66 loc) · 2.5 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
package main
import (
"github.com/AJMBrands/SoftwareThatMatters/cmd"
_ "net/http/pprof"
)
func main() {
//debug.SetGCPercent(10)
//TODO: Move to graph.go; Integrate nicely with cli
// To use the cli: go run main.go start.
cmd.Execute()
//v2 := g.ParseDebianVersion("1.3.4-1")
//v1 := g.ParseDebianVersion("1:1.3.10-0.3")
//constr := "= 1.3.4-1"
//fmt.Println(g.CompareVersions(*v1, *v2))
//fmt.Println(g.CheckConstraint(constr, *v2))
// var wg sync.WaitGroup
// go func() {
// fmt.Println(http.ListenAndServe("localhost:6060", nil))
// }()
// wg.Add(1)
//graph1, _, _, _ := graph.CreateGraph("data/input/debian.json", false)
//graph.Visualization(graph1, "graph")
//fmt.Println(graph1)
// pr := graph.PageRank(graph1)
// maxRank := 0.0
// var mostUsedId int64
// for id, rank := range pr {
// if rank > maxRank {
// maxRank = rank
// mostUsedId = id
// }
// }
// fmt.Printf("The highest-ranked node (%v) has rank %f \n", idToNodeInfo[mostUsedId], maxRank)
// graph.VisualizationNodeInfo(idToNodeInfo, graph1, "IDInfo")
// wg.Wait()
// pr := network.PageRankSparse(graph1, 0.85, 0.001)
//duration := 365 * 24 * time.Hour
//beginTime, _ := time.Parse(time.RFC3339, "2021-01-01T00:00:00Z01:00")
//endTime := beginTime.Add(duration)
////
//var nodeMap map[int64]g.NodeInfo
//var graph1 *simple.DirectedGraph
//var stringIDToNodeInfo map[string]g.NodeInfo
//graph1, _, stringIDToNodeInfo, nodeMap, _ = g.CreateGraph("data/input/processed-10k.json", false)
//x := g.GetTransitiveDependenciesNode(graph1, nodeMap, stringIDToNodeInfo, "1221-1.0.0")
//fmt.Println(x)
////
//g.FilterGraph(graph1, nodeMap, beginTime, endTime)
//fmt.Println(graph1)
//_ = network.PageRank(graph1, 0.85, 0.00001)
//var nodeMap map[int64]g.NodeInfo
//var stringMap map[string]g.NodeInfo
//var graph1 *simple.DirectedGraph
//graph1, _, stringMap, nodeMap, _ = g.CreateGraph("data/input/test_data.json", true)
//g.FilterGraph(graph1, nodeMap, beginTime, endTime)
//
//g.FilterNode(graph1, nodeMap, stringMap, "A-1.0.0", beginTime, endTime)
//_ = network.PageRank(graph1, 0.85, 0.00001)
//g.FilterNode(graph1, nodeMap, stringMap, "A-1.0.0", beginTime, endTime)
//g.GetTransitiveDependenciesNode(graph1, nodeMap, stringMap, "A-1.0.0")
//_ = network.PageRank(graph1, 0.85, 0.00001)
//Uncomment this to create the visualization and use these commands in the dot file
//Toggle Preview - ctrl+shift+v (Mac: cmd+shift+v)
//Open Preview to the Side - ctrl+k v (Mac: cmd+k shift+v)
//graph.Visualization(graph1, "OnlyIds")
}