Skip to content

Commit

Permalink
Store connections in Graph struct
Browse files Browse the repository at this point in the history
  • Loading branch information
vposloncec committed Jan 26, 2024
1 parent c93880b commit c9b3a9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion base/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ type Graph struct {
log *zap.SugaredLogger
nodeLog *zap.SugaredLogger
Nodes []*Node
Connections []ConnectionPair
printAdjacency bool
}

func NewGraph(log *zap.SugaredLogger, nodeNum int, connections []ConnectionPair) *Graph {
g := Graph{
Nodes: make([]*Node, nodeNum),
Nodes: make([]*Node, nodeNum),
Connections: connections,
}
g.log = log.Named("Graph")
g.nodeLog = log.Named("Node")
Expand Down
3 changes: 2 additions & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ func BenchmarkStart(b *testing.B) {

func TestStartRandom(t *testing.T) {
nodes := 155000
connMultiplier := 0.8
// multiplier pronaden na predavanju CS22W, Lecture 1.3,timestamp 12:14
connMultiplier := 6.3
connNum := int(float64(nodes) * float64(connMultiplier))

orchestration.StartRandom(nodes, connNum)
Expand Down

0 comments on commit c9b3a9a

Please sign in to comment.