/* * BuildingModel.java * * Created on December 5, 2002, 2:11 AM */ package BuildSim; import CollabUtils.*; import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; /** See the documentation for IBuildingModel and IApplicationIdentification. */ public class BuildingModel implements IBuildingModel, IApplicationIdentification { /** Creates a new instance of BuildingModel */ public BuildingModel(int numberOfFloors, int numberOfElevators) { } /** Indicate that nothing has happened. The Controller may use this to * signal to the model that some number of time steps have passed. * Pre: timeIntervals >=0 * Post: if t is the time when the method is called, then t+timeIntervals * is the time when the method returns. */ public void advanceClock(int timeIntervals) { } /** Call an elevator. * Pre: there is such an elevator * Post: the elevator will eventually come to that floor */ public void callElevator(int elevatorID, int floor) { } /** A person enters the building. * Pre: the person is not already in the building. * Post: the person is in the building, on floor 1 */ public void enterBuilding(int personID) { } /** A person enters the elevator. * Pre: the elevator is on the same floor as the person. * Post: the person is in the elevator (and no longer considered to be on * any floor). */ public void enterElevator(int personID, int elevatorID) { } /** A person leaves the building * Pre: the person is in the building, on floor 1 * Post: the person is not in the building */ public void exitBuilding(int personID) { } /** A person leaves the elevator * Pre: the person is in the elevator, and the elevator is stopped * at some floor. * Post: the person is on that floor (and not in the elevator). */ public void exitElevator(int personID, int elevator) { } /** Return a (short) string identifying the authors of the program. * NOTE FOR CSE143 PROJECT 4: DO NOT GIVE PERSONAL INFORMATION UNLESS YOU * ARE COMFORTABLE WITH THE WHOLE WORLD SEEING IT! A code name or nickname * is sufficient. */ public String getApplicationAuthor() { } /** return a string (as long as desired) identifying the authors of the program. */ public String getApplicationAuthorDetails() { } /** return the date of creation or update */ public GregorianCalendar getApplicationDate() { } /** return a (short) description of the application. */ public String getApplicationDescription() { } /** return a string (as long as desired) describing the application */ public String getApplicationDescriptionDetails() { } /** Get a list of all the elevator IDs. */ public List getElevatorList() { } /** Answers, where is the elevator? * Pre: the elevator exists * Post: no state has changed * @return a double indicating the floor that the elevator is on. A non-integer * value indicates the elevator is between floors (in the natural interpretation). * The return value >= 1, and <= number of floors in the building */ public double getElevatorLocation(int elevatorID) { } /** Get a list of all the people in a given elevator. */ public List getElevatorOccupants(int elevatorID) { } /** Get a list of all the people on a given floor. @return a list of all people on the floor, if the floor exists. Return null iff the floor does not exist. */ public List getFloorInfo(int floor) { } /** Answers, where is the person? * Pre: the person exists * Post: no change in state * @return the floor where the person is located. 0 indicates the person * is known but is not in the building. * A positive integer indicates the FLOOR that a person is on. A * negative integer indicates the number (negated) of the ELEVATOR the person * is on. */ public double getPersonLocation(int personID) { } /** Answers, what time is it? * */ public int getTime() { } /** return a string (as long as desired) giving any details of * usage or applicability which the author wishes to convey to * a user or a client. */ public String getUsageInformation() { } /** Someone in the elevator pushes the button for a particular floor. * **** NEW METHOD **** added 12/6 * Pre: the elevator exists and is not empty; the floor exists. * Post: the elevator will eventually stop at the requested floor. */ public void requestFloor(int elevatorID, int floor) { } /** Tells whether the elevator has been requested to stop to at certain * floor, but has not stopped at that floor since being requested. * Such a request might have come from outside the elevator (callElevator) * or from inside it (requestFloor). * Pre: the elevator and floor are valid. * Post: no change in status. * @return -1 if the elevator has no current request for the floor. * @return 0 if the status is not available. * @return 1 if the elevator has a current request for the floor. * OPTIONAL method: implementors may choose to return 0 for all queries, in * which case the method is effectively optional. Otherwise, a value of * -1 or 1 should be returned, and 0 is never returned. * *** NEW METHOD *** added 12/6/2002 */ public int getElevatorFloorStatus(int elevatorID, int floor) { } }