// rpf, 011301 for JUG group cell phone project // done on hearthside // This creates and the objects, steps time and // runs each one time step at a time. // Command line argument is number of time steps desired. // Basic design is that phones and base stations communicate // via messages deposited in space and gathered from there. // For now space is a single object with only toBase and // fromBase "channels" for one phone. // javadoc added 020201 package jug; import java.io.*; import java.lang.Integer; import java.lang.String; /** * Drives the entire simulation. * Creates the three objects and then cycles by stepping * the base and the phone, which then xfer messages and * report what they see. */ public class Simulation1 { public static void main (String[] args) { int tMax = 10; if(args.length == 1) tMax = Integer.parseInt(args[0]); Space1 space = new Space1(); Base1 base1 = new Base1(space); CellPhone1 phone1 = new CellPhone1(space); for (int t = 0; t < tMax ; t++) { System.out.println("stepping"); base1.step(); phone1.step(); } } } // A run of this program with command line arg. 3: /* $ mjava jug.Simulation1 3 stepping Base hears: null init for toBase string Phone hears Hi from your base. stepping Base hears: I'm a phone Phone hears Hi from your base. stepping Base hears: I'm a phone Phone hears Hi from your base. $ */