@Test
public void testDogBehavior() throws Exception{

	Selector<Dog> selector = new Selector<Dog>();
	Parallel<Dog> parallel = new Parallel<Dog>();
	selector.addChild(parallel);
	CareTask care = new CareTask();
	care.urgentProb = 0.8f;
	parallel.addChild(care);
	parallel.addChild(new AlwaysFail<Dog>(new RestTask()));
	Sequence<Dog> sequence = new Sequence<Dog>();
	selector.addChild(sequence);
	BarkTask bark1 = new BarkTask();
	bark1.times = MathUtil.random(1, 5);
	sequence.addChild(bark1);
	sequence.addChild(new WalkTask());
	sequence.addChild(new BarkTask());
	sequence.addChild(new MarkTask());
	BehaviorTree<Dog> tree=new BehaviorTree<Dog>(selector, new Dog("Buddy"));
	int setp=0;
	while(true) {
		System.out.println("步骤："+(++setp));
		tree.step();
		Thread.sleep(1000);
	}
}