org.cpsolver.coursett.model

## Class RoomLocation

- java.lang.Object
- - org.cpsolver.coursett.model.RoomLocation

- All Implemented Interfaces:
    Comparable<RoomLocation>

      public class RoomLocation
      extends Object
      implements Comparable<RoomLocation>

  Room part of placement.
  Version:
    CourseTT 1.3 (University Course Timetabling)
    Copyright (C) 2006 - 2014 Tomáš Müller
    muller@unitime.org
    http://muller.unitime.org
    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
    You should have received a copy of the GNU Lesser General Public License along with this library; if not see http://www.gnu.org/licenses/.
  Author:
    Tomáš Müller

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoomLocation(Long id, String name, Long bldgId, int preference, int size, Double x, Double y, boolean ignoreTooFar, RoomConstraint rc)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(RoomLocation o)`
    `boolean` | `equals(Object o)`
    `Long` | `getBuildingId()` Building id
    `double` | `getDistanceInMeters(DistanceMetric m, RoomLocation roomLocation)`
    `int` | `getDistanceInMinutes(DistanceMetric m, RoomLocation roomLocation)`
    `Long` | `getId()` Room id
    `boolean` | `getIgnoreTooFar()`
    `int` | `getMaxPreference()` Support for multiple rooms with different preferences: return max preference
    `int` | `getMinPreference()` Support for multiple rooms with different preferences: return min preference
    `String` | `getName()` Room name
    `Double` | `getPosX()` X-position of the building
    `Double` | `getPosY()` Y-position of the building
    `int` | `getPreference()` Room preference
    `int` | `getPreference(int roomIndex)` Support for multiple rooms with different preferences: override default room preference for the given index
    `Map<Integer,Integer>` | `getPreferenceByIndex()` Support for multiple rooms with different preferences: return preference overrides
    `RoomConstraint` | `getRoomConstraint()`
    `int` | `getRoomSize()` Room size
    `int` | `hashCode()`
    `boolean` | `hasPreferenceByIndex()` Support for multiple rooms with different preferences: has preference overrides for particular rooms
    `void` | `setCoordinates(Double x, Double y)` Position of the building
    `void` | `setPreference(int preference)` Set room preference
    `void` | `setPreference(int roomIndex, int preference)` Support for multiple rooms with different preferences: override default room preference for the given index
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### RoomLocation

          public RoomLocation(Long id,
                              String name,
                              Long bldgId,
                              int preference,
                              int size,
                              Double x,
                              Double y,
                              boolean ignoreTooFar,
                              RoomConstraint rc)

      Constructor
      Parameters:
        `id` - room id
        `name` - room name
        `bldgId` - building id
        `preference` - soft preference
        `size` - room size
        `x` - x-position of the building
        `y` - y-position of the building
        `ignoreTooFar` - true if distance conflicts are to be ignored
        `rc` - related room constraint

  - ### Method Detail

    - #### getId

          public Long getId()

      Room id
      Returns:
        room unique id

    - #### getBuildingId

          public Long getBuildingId()

      Building id
      Returns:
        building unique id

    - #### getName

          public String getName()

      Room name
      Returns:
        room name

    - #### getPreference

          public int getPreference()

      Room preference
      Returns:
        room preference

    - #### setPreference

          public void setPreference(int preference)

      Set room preference
      Parameters:
        `preference` - room preferences

    - #### getRoomSize

          public int getRoomSize()

      Room size
      Returns:
        room size

    - #### setCoordinates

          public void setCoordinates(Double x,
                                     Double y)

      Position of the building
      Parameters:
        `x` - X-coordinate (latitude)
        `y` - Y-coordinate (longitude)

    - #### getPosX

          public Double getPosX()

      X-position of the building
      Returns:
        X-coordinate (latitude)

    - #### getPosY

          public Double getPosY()

      Y-position of the building
      Returns:
        Y-coordinate (longitude)

    - #### getIgnoreTooFar

          public boolean getIgnoreTooFar()

    - #### getRoomConstraint

          public RoomConstraint getRoomConstraint()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### getDistanceInMeters

          public double getDistanceInMeters(DistanceMetric m,
                                            RoomLocation roomLocation)

    - #### getDistanceInMinutes

          public int getDistanceInMinutes(DistanceMetric m,
                                          RoomLocation roomLocation)

    - #### compareTo

          public int compareTo(RoomLocation o)

      Specified by:
        `compareTo` in interface `Comparable<RoomLocation>`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### getPreference

          public int getPreference(int roomIndex)

      Support for multiple rooms with different preferences: override default room preference for the given index

    - #### setPreference

          public void setPreference(int roomIndex,
                                    int preference)

      Support for multiple rooms with different preferences: override default room preference for the given index

    - #### hasPreferenceByIndex

          public boolean hasPreferenceByIndex()

      Support for multiple rooms with different preferences: has preference overrides for particular rooms

    - #### getPreferenceByIndex

          public Map<Integer,Integer> getPreferenceByIndex()

      Support for multiple rooms with different preferences: return preference overrides

    - #### getMinPreference

          public int getMinPreference()

      Support for multiple rooms with different preferences: return min preference

    - #### getMaxPreference

          public int getMaxPreference()

      Support for multiple rooms with different preferences: return max preference