Examples of School


Examples of trafficdefinition.School

        house.assignVehiclesToDrivers(area.getPossibilityDriverHasCar(), vehicleTypes);

        // Find closest school for every child in the house based on the
        // child's age and the school location and capacity
        for (Child child : house.getChildren()) {
          School closestAvailableSchool = FindClosestSchoolToLocation(schools, child.getSchoolType(), house.getLocation());
          child.setSchool(closestAvailableSchool);

          if (closestAvailableSchool != null) {
            closestAvailableSchool.setAvailableCapacity(closestAvailableSchool.getAvailableCapacity() - 1);
          }
        }

        // Add the house to the area's houses
        areaHouses.add(house);
View Full Code Here

Examples of trafficdefinition.School

   * @param location
   *            the location to search near for
   * @return the closest school near the specified location
   */
  private static School FindClosestSchoolToLocation(List<School> schools, SchoolType type, Point2D.Double location) {
    School closestSchool = null;
    double minimumSchoolDistance = Float.MAX_VALUE;

    // Loop through all schools
    for (School school : schools) {
      if ((school.getSchoolType() == type) && (school.getAvailableCapacity() > 0)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.