Example #1
0
  protected void setSimulation(
      int numElevators,
      int elevatorCap, // Sets all values in the simulation
      int Floors,
      int numCallsInDay,
      int maxTime,
      int timeConstant,
      int numDays,
      SimulationValues sim) {
    setNumDays(numDays); // sets number of days
    setNumElevators(numElevators); // sets number of elevators
    setElevatorCap(elevatorCap); // sets elevator capacity
    setFloors(Floors); // sets number of floors
    setNumCallsInDay(numCallsInDay); // sets number of calls in a day
    setMaxTime(maxTime); // sets the total time of the simulated day
    setTimeConstant(timeConstant); // sets the time counter
    setArrayElevators(numElevators); // sets the array size to the number of elevators
    Building build = new Building(); // Creates building
    build.PopulateBuilding(Floors, numElevators, numCallsInDay, build); // initalizes the building
    setBuilding(build); // sets building
    intializeArrayElevators(); // Initializes all elevators in the array

    runSimulation(sim); // runs the simulation
  }