コード例 #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()
}
コード例 #2
0
func TestSimple(t *testing.T) {
	fmt.Println("Testing Simple Turn Rollover")
	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)
	}()
	if !proxy.Turn() {
		t.Error("Turn did not complete.")
	}
}