// ForwardAvoid.java // // Code to start up a behavior-based controller. // // Simon Parsons // 17th October 2013 // // Based on an example at www.lejos.org import lejos.robotics.subsumption.*; public class ForwardAvoid { public static void main(String[] args) throws Exception{ // Which robot are we controlling? StandardRobot me = new StandardRobot(); // Setup the monitor // This isn't necessary for the behavior-based control. RobotMonitor rm = new RobotMonitor(me, 300); rm.start(); // Set up an arbitrator Behavior b1 = new ForwardBehavior(me); Behavior b2 = new AvoidBehavior(me); Behavior[] bArray = {b1, b2}; Arbitrator arb = new Arbitrator(bArray, true); arb.start(); } }