import cs1705.*; // ------------------------------------------------------------------------- /** * This is a class demonstration for showing how multiple robots can * cooperate, with one sending messages to another. * * @author Stephen Edwards * @version 2003.09.16 */ public class HarvestField implements RobotTask { //~ Instance/static variables ............................................. HarvesterForeman karel = null; //~ Methods ............................................................... // ---------------------------------------------------------- /** * This task creates a HarvesterForeman and its team. */ public void task() { World.startFromFile( "field2.kwld" ); VPIRobot fieldHand = new VPIRobot( 5, 1, East, 0 ); HarvesterForeman subForeman = new HarvesterForeman( 3, 1, East, 0, fieldHand ); karel = new HarvesterForeman( 1, 1, East, 0, subForeman ); karel.harvestField(); } }