func NewNetwork(nodes []base.Node) *Network {
	return &Network{
		nodes:  nodes,
		buffer: base.NewEventBuffer(),
		wg:     &sync.WaitGroup{},
	}
}
NewNetwork creates a network with the given nodes, connections of nodes should be already established.
package ns_x
import (
	"github.com/bytedance/ns-x/v2/base"
	"github.com/bytedance/ns-x/v2/tick"
	"runtime"
	"sync"
	"time"
)
type Network struct {
	nodes  []base.Node
	buffer *base.EventBuffer
	wg     *sync.WaitGroup
}