// ForwardAvoid.java // // Code to start up a behavior-based controller, // based on the original code by Simon Parsons, 2013. // // Terry Payne // 6th October 2017 // import lejos.robotics.subsumption.Arbitrator; import lejos.robotics.subsumption.Behavior; public class ForwardAvoid { public static void main(String[] args) { // Which robot are we controlling? SimpleRobot me = new SimpleRobot(); // 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 ForwardBehaviour(me); Behavior b2 = new AvoidBehaviour(me); Behavior[] bArray = {b1, b2}; Arbitrator arb = new Arbitrator(bArray, true); arb.go(); } }