Ejemplo n.º 1
0
func TestWithCoord(t *testing.T) {
	fmt.Println("Testing With Coord")
	agnt := make(chan link.Message, 10)
	prox := make(chan link.Message, 10)
	simple := NewSimple(1)
	proxy := cagent.NewAgentProxy(prox, agnt)
	go func() {
		agent.Run(simple, agnt, prox)
	}()

	co := coord.NewCoordinator()
	co.Configure(
		config.NewConfig(
			0,
			[]cagent.Agent{
				proxy,
			},
			"noise",
			true,
			true,
			geo.NewPoint(0, 0),
			geo.NewPoint(10, 10),
		),
	)
	co.Run()
}
Ejemplo n.º 2
0
func RunAtAddress(address string) {
	c := coord.NewCoordinator()
	r := New(c, address)
	r.ExportMasterConn()
	r.ReadConfigFromMaster()
	r.RunExporter()
	r.FinishConfig()
	r.ConnectToPeers()
	r.WaitForGo()
	r.Run()
	r.log.Print("Done")
	r.Close()
}